This example emulates a NFC Forum Type-4 tag with an a single NDEF record (RTD_TEXT). The project uses aid-filter F0394148148100 (which is an example that is defined in the Android documentation) for the APDU SELECT command.
The NFC Forum Type 4 Tag Operation Specification 3.0 outlines how to interact with tags. Using Host Card Emulation in Android, we can do something pretty nifty:
- We can write an application on the card reader side that sends the proper APDU SELECT and associated commands and interact with a "card".
- That "card" in this case is emulated in our Android application.
There are various copies on the Internet, but the place to go is to sign the specification license and download direct from the NFC Forum document library.
You have to follow the commands in your client application. You can also compile and run the sample in the apdu_exchange_tester directory that is based on the APDU examples from libNFC (for detailed instructions, see the readme in that folder).
You'll need API 19 (aka Android 4.4) to use HCE. See Host-based Card Emulation @ developers.android.com for all the details.
This is a different sort of thing and you'll want to look into ISO-DEP.