• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to lock nfc tag ?

Hello sir I want to lock nfc tag. That means after writing then i want to make write write protected the nfc tag.

I have used bellow code for write protected but it not working
public void makeReadOnly(Tag tag) {
if (tag == null) {
Log.e("tag", "Tag Is Null");
return;
}
try {

Ndef ndef = Ndef.get(tag);
if (ndef != null) {
Log.e("eeeeeee111111", "New1111");
ndef.connect();

if(ndef.canMakeReadOnly()){
ndef.canMakeReadOnly();
Log.e("Read Only", "Read Only");
}
Log.e("Lock.......", "Lock.......");

// ndef.canMakeReadOnly();
ndef.close();
// Log.e("22222.......", "2222.......");

}

} catch (IOException e) {
// TODO Auto-generated catch block
Log.e("EEEEEEEEEEEEE", e.toString());
e.printStackTrace();
}

}



Please help me..
 
Back
Top Bottom