android.nfc.tech.MifareUltralight Java Examples

The following examples show how to use android.nfc.tech.MifareUltralight. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Tag.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
private static HashMap<String, Integer> getTechStringToCodeMap() {
    HashMap<String, Integer> techStringToCodeMap = new HashMap<String, Integer>();

    techStringToCodeMap.put(IsoDep.class.getName(), TagTechnology.ISO_DEP);
    techStringToCodeMap.put(MifareClassic.class.getName(), TagTechnology.MIFARE_CLASSIC);
    techStringToCodeMap.put(MifareUltralight.class.getName(), TagTechnology.MIFARE_ULTRALIGHT);
    techStringToCodeMap.put(Ndef.class.getName(), TagTechnology.NDEF);
    techStringToCodeMap.put(NdefFormatable.class.getName(), TagTechnology.NDEF_FORMATABLE);
    techStringToCodeMap.put(NfcA.class.getName(), TagTechnology.NFC_A);
    techStringToCodeMap.put(NfcB.class.getName(), TagTechnology.NFC_B);
    techStringToCodeMap.put(NfcF.class.getName(), TagTechnology.NFC_F);
    techStringToCodeMap.put(NfcV.class.getName(), TagTechnology.NFC_V);
    techStringToCodeMap.put(NfcBarcode.class.getName(), TagTechnology.NFC_BARCODE);

    return techStringToCodeMap;
}
 
Example #2
Source File: Tag.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
private String[] generateTechStringList(int[] techList) {
    final int size = techList.length;
    String[] strings = new String[size];
    for (int i = 0; i < size; i++) {
        switch (techList[i]) {
            case TagTechnology.ISO_DEP:
                strings[i] = IsoDep.class.getName();
                break;
            case TagTechnology.MIFARE_CLASSIC:
                strings[i] = MifareClassic.class.getName();
                break;
            case TagTechnology.MIFARE_ULTRALIGHT:
                strings[i] = MifareUltralight.class.getName();
                break;
            case TagTechnology.NDEF:
                strings[i] = Ndef.class.getName();
                break;
            case TagTechnology.NDEF_FORMATABLE:
                strings[i] = NdefFormatable.class.getName();
                break;
            case TagTechnology.NFC_A:
                strings[i] = NfcA.class.getName();
                break;
            case TagTechnology.NFC_B:
                strings[i] = NfcB.class.getName();
                break;
            case TagTechnology.NFC_F:
                strings[i] = NfcF.class.getName();
                break;
            case TagTechnology.NFC_V:
                strings[i] = NfcV.class.getName();
                break;
            case TagTechnology.NFC_BARCODE:
                strings[i] = NfcBarcode.class.getName();
                break;
            default:
                throw new IllegalArgumentException("Unknown tech type " + techList[i]);
        }
    }
    return strings;
}