hi Michael, Thanks for the pointer, could u suggest me , a start up point from where i can understand and proceed further, fyi i am layman , so a step by step will help me a lot.
br sansknowledge On Aug 1, 3:56 pm, Michael Roland <[email protected]> wrote: > Hallo, > > > when i try to write to a mifare classic 1k card , > >Ndef.get(tag) returns null, upon searching, i find that tag is not > > listed in tech list. but when i issue getTechList() command, i am able > > to find > > MifareClassic , NdefA and Ndefformatable are listed, so where am i > > missing. > > So you are missing quite the obvious: > > You can only access technologies of a tag if the tag supports them. > Thus, as your MF1K tag supports MifareClassic, NfcA and > NdefFormatable, you can only access this tag using these three > technologies. Therefore, asNdefis not listed you can also not use it > to access the tag. > > Usually tags supportingNdefprovide either NdefFormatable (if the tag > supportsNDEFbut has not been initialized to theNDEFformat) orNdef > (if the tag is already prepared forNDEFdata). So you need to check > which of these two technologies is supported and then use the proper > one to write yourNDEFmessage to the tag. > > > MifareClassic mfc=MifareClassic.get(tagFromintent); > > boolean auth=false; > > try { > > String[] ttype=tagFromintent.getTechList(); > > Ndefndef1=Ndef.get(tagFromintent); > > mfc.connect(); > > auth = mfc.authenticateSectorWithKeyA(0, MifareClassic.KEY_DEFAULT); > > } catch (IOException e1) { > > So here you got another (potential) problem. You should not mix using > different technologies. Either use MifareClassic for access to the > tags raw data or useNdef/NdefFormatable togethigh-level access toNDEFdata. > > br > Michael -- 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

