Hello,
I'm writing application to read and write on nfc tag. I'm using Mifare
Desfire for that purpose. I can write to the tag but i can't read.
the manifest file have the following filters:
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED"/>
</intent-filter>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
and the technology list:
<tech>android.nfc.tech.NfcA</tech>
<tech>android.nfc.tech.Ndef</tech>
The write function is:
Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
Ndef tag = Ndef.get(tagFromIntent);
try {
tag.connect();
if(tag.isConnected() && tag.isWritable()){
tag.writeNdefMessage(message);
tag.close();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (FormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
The program can't go through reading process because the follwoing condition
is always false.
if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())){
}
could you help me?
John
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en