NFC Mock Tags and Successfully Writing NFC Tags

by muasif80 » Mon, 31 Jan 2011 18:07:13 GMT


Sponsored Links
 I would like to ask one thing about NFC demo available in gingerbread.
There are three mocked nfc tags available in this demo. Now can anyone
tell me how can I create one more mocked tag.

For example we have

/**
     * A Smart Poster containing a URL and no text.
     */
    public static final byte[] SMART_POSTER_URL_NO_TEXT =
        new byte[] {(byte) 0xd1, (byte) 0x02, (byte) 0x0f, (byte)
0x53, (byte) 0x70, (byte) 0xd1,
            (byte) 0x01, (byte) 0x0b, (byte) 0x55, (byte) 0x01, (byte)
0x67, (byte) 0x6f,
            (byte) 0x6f, (byte) 0x67, (byte) 0x6c, (byte) 0x65, (byte)
0x2e, (byte) 0x63,
            (byte) 0x6f, (byte) 0x6d};

Inside MockNdefMessages.java

Now this data is actually the  http://www.google.com/ 
Now I want to have  http://www.wikipedia.com/ in my 
SMART_POSTER_URL_NO_TEXT data member. How can I get the bytes for it
any idea.

Also I have seen that the people at Gibraltar Software Factory have
successfully used the NFC feature of gingerbread to write NFC tags.
Here is the url  http://gibraltarsf.com/blog/?p=13 but they did not 
provide complete code, if someone can see there demo and build
complete code for that demo and share then it will be pleasure for me.

Regards,
Asif

-- 



Re: NFC Mock Tags and Successfully Writing NFC Tags

by Jie Sheng Chua » Fri, 20 May 2011 09:34:02 GMT


 Hi Asif,

SMART_POSTER_URL_NO_TEXT is equivalent to a NdefRecord.TNF_WELL_KNOWN and
NdefRecord.RTD_URI record.
i create a generic method to create these record.
after you retrieve the NdefRecord, you could get the bytes via
NdefRecord.toByteArray().
the code is here,
 http://freakcodes.blogspot.com/2011/05/ndefrecordgeneratorjava.html 

i have other related code here,
 http://freakcodes.blogspot.com/search/label/nfc 
the full project code is also available here,
 http://www.comp.nus.edu.sg/ ~jiesheng/dl/android/whollyNFC.zip

Jie Sheng

-- 
Jie Sheng, Chua
(+65) 97520245
chuajiesh...@gmail.com

The contents of this email are confidential to the intended recipient and
may not be disclosed. Although it is believed that this email and any
attachments are virus free, it is the responsibility of the recipient to
confirm this.




-- 


Sponsored Links


Other Threads

1. Connect between two simulators by multicast through the WIFI

Hi all,

I am trying to connect two Android simulator by multicast in WIFI
network. Is there anybody have experience about it. (although I have
made some search before, and known that Android simulator provide a
poor support for such protocol, is there any update in new version
2.0 ?).

Thanks much

-- 

2. Weird Issue with CheckedTextView in a ListView

Hi;
I had a similar issue when I implemented a listview with checkbox
items using the Efficient Adapter example. I realised that the checked
items were not being stored, so I built a static Boolean in my custom
adapter and listen to the checkbox when it is checked/unchecked and
update the Boolean array. I think you should also do something
similar; store the checked items yourself. To make sure the checked
items are checked when I scroll I check or uncheck the listview item
in the getView() method inside my custom adapter.

It might take a while, but it's certainly not hard to fix when you
think about it.

Hope to be helpful.

-- 

3. big-endian mips ICU for android?

4. Multiple Binds to Single Service?

5. when will android 1,6 OTA IN SINGAPORE, WHY?

6. about TTS issue

7. How to Load Asset PDF in Browser or Webview ?