Hi andrew, As you can see this code checks for Writable and Size limitations. I tried to write a Contact info. At this time I got Size limitation error.
Anyways i think by tag is writable and also has sufficient size. Just that I am not able to figure out why that error is occuring.. Also after this error, I deliberately tried to "Format" and write the ndef message. I got "Tag doesn't support NDEF." error. But this is not possible since ndef!=null code was executed previously. I am not sure why this is happening. Please advice. Regards, Ajith On Mon, May 16, 2011 at 1:46 PM, andrew <[email protected]> wrote: > I have a similar case, and I think I know why it happens, even if the > API is not ideal for handling it: > > If could be that your tag already has data written to it and that data > is locked or write-protected. > This happens in a tag I have that is a 1K tag, but I cannot write a > small Ndef to it. > > I suspect that the size reported is the total size of the tag, not the > size of the writable space that is left after some data has been > written and then write-protected or locked. > > I cannot find any way to confirm that theory in the code, and so as > (like you) I test almost everything else before trying the write, I > just surround my write with a Try/catch and assume the exception is > due to this reason. > > The IOException returned on this error has no info related to the > cause. > > So far, my only enhancement request to the Android team on the NFC API > would be to greatly enhance the IOExceptions returned in all the NFC > methods to give more information about the cause of the exception. > ("Not enough space", "Write protected", etc). > > If you find anything else that can help deal with this case, then > please post here and I will do the same. > > -- > 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 -- 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

