Select chapter



basics (6.papers)
activities (5.papers)
services (2.papers)
threads (2.papers)
receivers (1.papers)
advanced android (2.papers)
SQLite database (1.papers)
adapters (1.papers)
adb and ddms (1.papers)
widgets (1.papers)
fragments (1.papers)
UI (1.papers)
Hide

Sponsored Links


  

android nfc serial port interview questions and answers

1
How to Know Available bytes in Serial Port?
  1. private InputStream mInputStream;
    int readavailableBytes = mInputStream.available();
Show Answer
Share Facebook gmail Twitter
2
How to read available bytes from Serial Port?
  1. private InputStream mInputStream;
    int readavailableBytes = mInputStream.available();
    private byte Buffer = new byte[20];
    mInputStream.read(Buffer, 0, readavailableBytes);
    
Show Answer
Share Facebook gmail Twitter
3
What is  LineNumberReader ?
  1. Constructs a new LineNumberReader on the Reader in. The internal buffer gets the default size (8 KB).
    
Show Answer
Share Facebook gmail Twitter
4
how to know available drivers in Serial Port ?
  1. LineNumberReader r = new LineNumberReader(new FileReader("/proc/tty/drivers"));
    
Show Answer
Share Facebook gmail Twitter
5
What are the steps to load JNI files into Android?
  1. private native static FileDescriptor open(String path, int baudrate);
     public native void close();
     static {
      System.loadLibrary("serial_port");
     }
    
Show Answer
Share Facebook gmail Twitter
6
How do you check File Check access permission ?
  1.  public SerialPort(File device, int baudrate) throws SecurityException, IOException {
    
     
      device.canRead() 
      device.canWrite())  here
       
    File : The actual file referenced by a File may or may not exist. It may also, despite the name File, be a directory or other non-regular file. 
    
    This class provides limited functionality for getting/setting file permissions, file type, and last modified time. 
    
Show Answer
Share Facebook gmail Twitter
7
What is Baud Rate?
  1. a data transmission rate (bits/second) 
    
Show Answer
Share Facebook gmail Twitter
8
What is NFC?
  1. Near Field Communication (NFC) is a set of short-range wireless technologies, typically requiring a distance of 4cm or less to initiate a connection.
    
Show Answer
Share Facebook gmail Twitter
9
Which type of RFID cards work with NFC?
  1. All Mifare Cards shown below types
    
    SIZE_1K Tag contains 16 sectors, each with 4 blocks.
    SIZE_2K Tag contains 32 sectors, each with 4 blocks.
    SIZE_4K Tag contains 40 sectors.
    SIZE_MINI Tag contains 5 sectors, each with 4 blocks.
    TYPE_CLASSIC A MIFARE Classic tag
    TYPE_PLUS A MIFARE Plus tag
    TYPE_PRO A MIFARE Pro tag
    TYPE_UNKNOWN A MIFARE Classic compatible card of unknown type
    
Show Answer
Share Facebook gmail Twitter
10
How to discover Tag automatically?
  1. if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)
        || NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)
        || NfcAdapter.ACTION_TECH_DISCOVERED.equals(action))
    
Show Answer
Share Facebook gmail Twitter
11
What is NFC Tag?
  1. Tag is an immutable object that represents the state of a NFC tag at the time of discovery. It can be used as a handle to TagTechnology classes to perform advanced operations, or directly queried for its ID via getId() and the set of technologies it contains via getTechList(). Arrays passed to and returned by this class are not cloned, so be careful not to modify them
    
Show Answer
Share Facebook gmail Twitter
12
how to find TAG UID?
  1. Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
    String UID = tag.getId()
    
Show Answer
Share Facebook gmail Twitter
13
What are the methods to Authenticate Sectors?
  1. MifareClassic mfc = MifareClassic.get(TAG);
    mfc.connect();
    auth = mfc.authenticateSectorWithKeyA(0, MifareClassic.KEY_DEFAULT);
    auth = mfc.authenticateSectorWithKeyB(0, MifareClassic.KEY_DEFAULT);
    
Show Answer
Share Facebook gmail Twitter
14
How do you read and write mifare cards?
  1. to write
    
    public void writeBlock (int blockIndex, byte[] data) 
    before writing find MifareClassic.BLOCK_SIZE
    
    to Read
    public byte[] readBlock (int blockIndex) 
Show Answer
Share Facebook gmail Twitter
15
How to protect data in Mifare Card?
  1. Write block with Custom Key instead of MifareClassic.KEY_DEFAULT
    
Show Answer
Share Facebook gmail Twitter
16
How to Lunch App when TAG detected?
  1. add these to your MainActivity in Manifest File
    
    <intent-filter android:priority="100" >
                    <action android:name="android.nfc.action.TAG_DISCOVERED" />
    
                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
                <intent-filter android:priority="101" >
                    <action android:name="android.nfc.action.NDEF_DISCOVERED" />
    
                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
                <intent-filter android:priority="102" >
                    <action android:name="android.nfc.action.TECH_DISCOVERED" />
    
                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
    
Show Answer
Share Facebook gmail Twitter
Read more papers :