2

The API demo is not understandable for me. I have bought A Milfare 1K Labels-Tag, works great with the well known "NFC TagWrite" App.

So I want to implement this into my own app. I do not need to write content to tags, but read it. I know there must be a decleration in my Manifest (with MIME-Type) in order to tell my app to come app, whenever a specific tag type has been touched to the phone. I do know there must be a kind of Nfc-Record to make a specific Ndef Message.

How can this be done? I have my activity, which should be come a, whenever a tag with typ "XYZ" has been touched to the phone. It should simply show plain-text, nothing else. On the screen, the content should appear in a simple TextView (id=tagContent).

What do I have to do?

Jørgen R
  • 10,568
  • 7
  • 42
  • 59
Basti909851
  • 127
  • 8

2 Answers2

0

There are bunch of things that needs to be in place to do this. Luckily, everything is described in the following post:

http://mifareclassicdetectiononandroid.blogspot.com/2011/04/reading-mifare-classic-1k-from-android.html

Good luck!

Albin
  • 4,180
  • 2
  • 27
  • 19
  • Very thank you for the answer. I tried this, it works not completly, just a part of it. Whenever one of my Mifare 1K Tags is touched to the phone I can choose my app to handle it. So the manifest works great now. By debug mode I know that it reaches the resolveIntent() method, but never passes the authentication, the "auth" is never set to true. Do you know why? – Basti909851 Nov 20 '11 at 19:14
  • I figured out, that the App "Tagwriter" from NXP seems to change the auth key?! Why in hell are they doing this? I found nothing about the new key, is it secret? Do somebody know there key? Or are tags, written with app not usable anymore? – Basti909851 Nov 20 '11 at 20:10
  • I know from accidentally writing a random key to a tag how annoying it is to not have the key. :-P I hope you find out what TagWriter does. – Albin Nov 20 '11 at 21:32
  • Thanks... I found nothing so far... I've contaced the developer of the app, but I think there will not be a satisfing answer at all... If there is anyone who can help me, please write it here! =P – Basti909851 Nov 21 '11 at 17:42
  • Different companies that make software/hardware to write Mifare Tags format it with their own auth key's. I don't know why they change it from the default, maybe so you always have to use their app/phone to use it. (Old Nokia NFC phones did this.) The Auth code is used for tag security, kind of like a attempt at "NFC DRM." But I have always found it to be annoying. – Ben Ward Nov 22 '11 at 06:53
  • Annying is the right expression... It really sucks. But I found out, that the "Tags" App by Google is able to read the tags I wrote with "TagWriterNXP". So there have to be a chance to read this in our apps, too, havn't it? – Basti909851 Nov 22 '11 at 13:28
0

I think you should try authenticating with mfc.authenticateSectorWithKeyB instead of the 'A' in the sample. it worked for me.

Eran Tal
  • 187
  • 3
  • 3
  • 7