Search code examples
androidmanifestnfcandroid-2.3-gingerbread

start activity/app on scan of nfc tag


I'm trying to develop an application for android with NFC-tags. When I find a tag an activity should launch, even when that activity is not the active activity. At the moment it needs to be the activity activity, in all other cases it will launch a default app for nfc tags.

I suspect I need to change something in the manifest to accomplish this? To give my app high priority

it's for android 2.3 btw


Solution

  • Your goal is certainly possible. Android has quite sophisticated support for this, although in general the solution is simple: you need to add an intent filter for the desired type of NFC tag. Please, have a look at the on-line documentation for what is needed, especially this section. Possibly also of interest is this section on how to force your app to be started.