O'Reilly logo

Near Field Communication with Android Cookbook by Vitor Subtil

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Locking tags

Until now, we probably used and reused the same tags to write different content types during the implementation of recipes. There is absolutely no problem with that while we are in the development stage since we need to constantly test what we are doing. In real-life usage, we may need/want to prevent tag rewrites to prevent malicious users from changing the tag content.

How to do it…

We will make some changes in the NfcHelper class and allow the user to choose whether or not to make the tag read-only:

  1. Open Eclipse and create a new Android application project named NfcBookCh10Example3 and the package named nfcbook.ch10.example3.
  2. Make sure the AndroidManifest.xml file is configured correctly. Refer to the Requesting NFC permissions recipe ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required