I can write my data on card successfully. I want that no one can write on my card, but that they can only read. Is this possible to achieve? Or is there any key where I can assign some password protection before writing data on my card?
To write data using:
public void writeTag(Tag tag) {
MifareUltralight ultralight = MifareUltralight.get(tag);
String[] mg= getParts(s, 4);
try {
ultralight.connect();
int j=4;
for (int i = 0; i < mg.length; i++) {
ultralight.writePage(j, mg[i].getBytes(Charset.forName("US-ASCII")));
j++;
}
Toast.makeText(getApplicationContext(), "Write Done!", Toast.LENGTH_LONG).show()
} catch (IOException e) {
Log.e(TAG, "IOException while closing MifareUltralight...", e);
} finally {
try {
ultralight.close();
} catch (IOException e) {
Log.e(TAG, "IOException while closing MifareUltralight...", e);
}
}
}
Any help would be appreciated!