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. Best way to provide access to a Service?

I find my self over and over re-writing my service in my app.  I
essentially want to provide control over my service easily for things
such as home widgets or other apps.

What are the things my service supports:

Incoming:
-start playback
-stop playback
-toggle playback
-start special features

Outgoing:
-metadata
-media playback status
-special features reporting status
-playback time (every second)



Questions:
What are the things I should look for when deciding to implement an
aidl interface versus calling the service using Intents?

Should I use Broadcasts to report the service status and information
as opposed to aidl?

Sorry if my questions aren't making sense...

Thanks!
-Moto

-- 

2. Questions About Animations

Hi everyone,

I have some questions while I am trying to understand how to create
different layout animations with android. I have all the animations I
want working but I don't really understand what they mean....

My first question:
      What is the difference between
Animation.RELATIVE_TO_PARENT, .ABSOLUTE, .RELATIVE_TO_SELF .
I assume that Relative to parent means that the values you pass in for
start and finish apply to the coordinates of the parent, absolute
would be absolute pixels and relative to self would be based on the
coordinates of the control you are referring to?

So if I want to hide something off screen and slide into view I have
to use RELATIVE_TO_PARENT like below:
         Animation inFromLeft = new TranslateAnimation(
                        Animation.RELATIVE_TO_PARENT,  -1.0f,
Animation.RELATIVE_TO_PARENT,  0.0f,
                        Animation.RELATIVE_TO_PARENT,  0.0f,
Animation.RELATIVE_TO_PARENT,   0.0f

If I did .RELATIVE_TO_SELF would it still be hidden off screen and
work the same way?

Also is -1.0f off the left side, 0 shows and +1 is off the right side
or what to those number mean. I know the first set are X and the
second set are Y.

Thanks for your time and helping me understand how the code works.

Tommy

-- 

3. Widget is not removed after the application is uninstalled

4. Can I compile against this SDK? They give me an .apk that installs...

5. Cannot display "Hello World" per the suggestion of "Installing of SDK"

6. Getting CTS test failure for android.os.cts.DebugTest#testThreadCpuTimeNanos

7. Enabling FUSE in Android kernel