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. Video streaming, omx problem

Hello,
I want to stream video via sdp.
The stream url is set to a MediaPlayer as described in the api sample.
Most of the times it is working fine.
Sometimes, however, i get a black or green screen and the log says:

E/QCOmxcore(   51): OMX.qcom.video.decoder.avc Instance already
exists, return OMX_ErrorInsufficientResources

There isnt even an error callback to notify the user or initiate
appropriate measures.
I think the only way to fix this is to reboot the device, but i hope
there is a more convenient ;) method ..
Cheers,

-- 

2. How to stop a service, when all activities are finished?

I am not for sure, but I think your activity has to bind to the service, or
your service needs to listen to a broadcast and your activity would need to
broadcast an intent that your service listens for, to shut down.

Curious, why do you play the music in a service? Why not in a separate
thread of the game? I am trying to learn game programming myself, and
thought that the process of playing music + sound FX all occur within the
game loop.. that you would some how every iteration update a sound/music
pointer for example and continue playing. I suppose if you have the same
music playing over and over.. but I'd rather have music that changes based
on the game play.. like speeds up in a fight, or changes pitch, or what have
you to provide a bit more dynamic music with the game.





> 

3. Error parsing XML (using DOM/DocumentBuilder) from URI

4. Penemu Linux ,Linus Torvalds Loves His New Google Nexus One

5. Is there a way to measure the time-consumings of all my functions in percent after a game?

6. Downlaod sonic proxy 2010

7. Penemu Linux ,Linus Torvalds Loves His New Google Nexus One