0

I am creating an Andriod app using nfc to check in lets say the url in the tag is "http://examples.com" I want an application to open, only when I tap on that tag.

So basically I will just edit the intent filters in my mainfest. So that everytime I tap on a tag that has the url http://developer.andriod.com/index.html the app will open

   <intent-filter>
           <action android:name="android.nfc.action.NDEF_DISCOVERED" />
                <category android:name="android.intent.category.LAUNCHER" />    
                    <data android:scheme="http"
                    android:host="developer.android.com"
                    android:pathPrefix="/index.html" />                    
    </intent-filter>
mariomario
  • 660
  • 1
  • 9
  • 29
Busted .
  • 9
  • 2
  • Please read the documentation first: http://developer.android.com/guide/topics/connectivity/nfc/nfc.html#filtering-intents. Your case is completely explained in the examples. – NFC guy Jun 29 '12 at 07:33
  • You need to use "android.intent.category.DEFAULT"; both action and category need to match exactly. – NFC guy Jun 29 '12 at 11:34

1 Answers1

0

I'm not familiar with NFC, but to my point of view you should implement the following steps. You should delete from your main activity in AndroidManifest.xml intent-filter:

<intent-filter>
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Thus, your application will be not seen in launcher. After that you should add an intent to be run from NFC (here I cannot help you how to do this).

Yury
  • 20,618
  • 7
  • 58
  • 86