Code example for MifareClassic

Methods: authenticateSectorWithKeyA, close, connect

0
	private void writePoster()  
	{ 
		boolean succes = false;
		try { 
			/* Connect to the Tag */ 
			mClassic.connect();
 
			/* Authenticate the MAD Sector, sector 0, with key A */ 
			succes = mClassic.authenticateSectorWithKeyA(0, MifareClassic.KEY_MIFARE_APPLICATION_DIRECTORY );
 
			if (succes) {
				/* Authentication succeeded proceed to write */ 
			} 
			else { 
				/* Authentication failed */				 
			} 
 
			mClassic.close();
		} 
 
		/* Catch the TagLostException */ 
		catch (final TagLostException tag) {
			tag.printStackTrace();