21

On an Android device equipped with NFC reader hardware, is there any in-built support to use the NFC tag contents to fire off an intent (e.g. starting an app)? I am asking whether the support is there by default, I know I could build my own app to listen for NFC events and handle them.

All the NFC tag writing apps I've seen appear to only support text/URLs/contacts, and the contacts support seems useless as many are far too big to fit in a tag.

Ollie C
  • 28,313
  • 34
  • 134
  • 217

4 Answers4

59

This is possible with Android Application Records. You basically write the package name of the app that you want to start into your NFC tag and when a device scans it, it will do its best to open the application. If its not there, it will take you to Market to download it. This is only available to 4.0 devices and up.

See this dev guide: https://developer.android.com/guide/topics/connectivity/nfc/nfc.html#aar

lqez
  • 2,898
  • 5
  • 25
  • 55
robertly
  • 2,132
  • 14
  • 9
4

According the the Android Developer site, it is possible for your app to filter NFC intents such as ACTION_NDEF_DISCOVERED.

castle1971
  • 517
  • 1
  • 5
  • 20
  • 1
    I think you misread my question. I said I do not want to write an app to listen for NFC events - I'm asking whether the NFC support, by default, supports firing an intent from tag contents. – Ollie C Dec 23 '11 at 11:17
  • 1
    Well, I think that's almost what I'm saying. Your app isn't monitoring NFC, but declares an intent filter so that it is launched by the system when an NFC tag is read. Is it what you need ? – castle1971 Dec 23 '11 at 11:27
  • I am not writing an app. I'm asking if there's a way to create NFC tags to open other, existing apps. I suspect the answer is no, that NFC contents can only do very basic things like open HTTP URLs. – Ollie C Dec 23 '11 at 11:32
  • 1
    Ok. Got it. In this case I think the answer is no. – castle1971 Dec 23 '11 at 11:39
1

If you are not trying to program your app to do this yourself then you can use a 3rd party app. Such as "Trigger" (I believe it used be called NFCTasker or something like that).

You can use that to read from tags and write to tags. You can create various actions including launch an app (others include changing volume, toggling wifi, text to speech, sending messages, etc).

RCB
  • 560
  • 4
  • 9
0

You can use NFC Tools for example to write a record to your NFC chip which targets a specific app by a package name. After writing it to a tag, whenever you tap the tag it will launch the app with the package name found in records automatically, if it's not installed it will open play store and show the app there.

Aram
  • 361
  • 3
  • 10