I want to enable the NFC function for my Project Tango Development Tablet. I added the following lines to the AndroidManifest:
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="false" />
And I added the following lines to my onCreate() function:
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(this);
if(nfcAdapter != null && nfcAdapter.isEnabled()) {
Toast.makeText(this, "NFC available", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "NFC not available", Toast.LENGTH_LONG).show();
}
But NFC is not available. I read that the Tango tablet has RFID/NFC hardware here . Can anyone help me with my problem?
I can answer my own question. I forgot to enable NFC in the settings. You have to turn on NFC, go to Settings>More...>NFC and switch it on .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.