Code example for NdefMessage

0
		 byte[] mimeBytes =  "application/com.oreilly.demo.android.pa.sensordemo".getBytes(Charset.forName("US-ASCII"));
		 NdefRecord mimeRecord = new NdefRecord(NdefRecord.TNF_MIME_MEDIA, mimeBytes, new byte[0], text.getBytes());
		  
		 NdefMessage msg = new NdefMessage(new NdefRecord[] {mimeRecord});
		  
		 NdefMessage msgWaAAR = new NdefMessage(new NdefRecord[] {mimeRecord,
				 NdefRecord.createApplicationRecord("com.oreilly.demo.android.pa.sensordemo")});		
		  
		return AARUSE ? msgWaAAR : msg;
	} 
	  
	@Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.nfc40);
 
        setTitle("Near Field Communication - 4.0");
    } 
	 
	@Override 
	public void onResume() {