I don't think you can filter by well known type, you'll probably have
to filter by tech and then the user would get a intent chooser.
I am also experimenting with Android NFC and was able to write a NFC
Tag with a NdefMessage including a TNF of TNF_MIME_MEDIA, a type of
"application/json" and some sample json {test:test} as payload.
When I start an activity with the foreground dispatch system, I can
see that the scanned tag is indeed an NDEF message tag, is et to a
TNF_MIME_MEDIA, has the type of apppliation/json and also the rigth
content. But somehow this intent-filter does not work:
<activity android:name=".MimeActivity" android:label="MIME">
<!-- Add a ndef mime filter -->
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/
>
<data android:mimeType="application/*" />
</intent-filter>
</activity>
I also tried application/json but the intent chooser does not offer me
the app.
Any ideas? Could it be a bug?
I wrote an intent filter using a tech list which worked. NDEF
filtering has priority, so this should actually work.
---
When I touch the tag, the defaults tags app comes up and I see a new
tag with record application/json in the list. I assume the tag itself
is ok.
Cheers
Sven
On Mar 9, 12:04 am, Dominik <[email protected]> wrote:
> I have defined an intent-filter for NDEF formatted tags as follows
>
> <intent-filter>
> <action android:name="android.nfc.action.NDEF_DISCOVERED" />
> <data android:mimeType="text/*" />
> </intent-filter>
>
> With the data field, a mime-type can be specified.
>
> Is it also possible to add additional data to an NDEF intent filter
> for NDEF tags which are not of type TNF_MIME_MEDIA? For example for
> NDEF tags with a "well-known" type name format, i.e. a NDEF tag of
> type TNF_WELL_KNOWN?
>
> Or for NDEF tags of type TNF_EXTERNAL_TYPE (i.e. NFC Forum external
> type tags)? Here tye type has fhe form urn:nfc:ext:company.com:app (or
> company.com:app for short)
>
> - Dominik
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en