Thanks for your help. In the definition of the intent-filter I cannot use the android:path part as this one matches only if it is an exact match, i.e. in the above example only if the tag contains the URL http://commonsware.com/nfctest. It is not possible to add wildcards in the path part. But somewhere I have to add the tag specific data!
The solution is to ommit the path part and to define a special host (e.g. android:host="nfctest.commonsware.com". Best wishes Dominik On Jun 10, 2:24 pm, Mark Murphy <mmur...@commonsware.com> wrote: > On Thu, Jun 9, 2011 at 8:53 PM, Dominik <dominik.gru...@fhnw.ch> wrote: > > Question: How do i have to pack this information on the tag? Two > > NdefRecords in the same NdefMessage or (if that is possible) two > > NdefMessages? > > AFAIK, neither. As "andrew" said, Google will only launch one > startActivity() Intent per tag. > > Hence, one strategy that I expect to see is for you to set up the > <intent-filter> for your activity to be launched by the tag like this: > > <activity android:name="URLHandler" > android:label="@string/app_name"> > <intent-filter android:label="@string/app_name"> > <action android:name="android.nfc.action.NDEF_DISCOVERED" /> > <data android:scheme="http" > android:host="commonsware.com" > android:path="/nfctest" > /> > <category android:name="android.intent.category.DEFAULT" /> > </intent-filter> > </activity> > > If your application is installed, your app will launch. If your > application is not installed, the Tags application will display the > URL, and one tap will bring up the Web browser. Make the URL and path > something you control, and put something on that page to steer the > user in the direction of your application for download (e.g., Market > URL). > > This is the basic strategy employed by Barcode Scanner -- you can > construct a URL that will trigger the Barcode Scanner if its installed > or brings up a ZXing Web page if it is not installed. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > Android 3.0 Programming Books:http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en