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. ExpandableListView indicator over my text

I'm using an ExpandableListView in one of my activity in a
RelativeLayout

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
        ...
        <Button
                android:id="@+id/searchNearBtnSearch"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/search"
                android:layout_centerHorizontal="true"
            android:layout_below="@id/searchNearSpinner"
            android:background="@drawable/btn_and_showtime"
                />
        <ExpandableListView
       android:id="@+id/searchNearListResult"
       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
            android:layout_below="@id/searchNearBtnSearch"
       />
</RelativeLayout>

and I'm using a custom expandableListAdaptaer which group view is :

public TextView getGenericView() {
                // Layout parameters for the ExpandableListView
                AbsListView.LayoutParams lp = new AbsListView.LayoutParams( //
                                ViewGroup.LayoutParams.FILL_PARENT, 64);

                TextView textView = new TextView(mainContext);
                textView.setLayoutParams(lp);
                // Center the text vertically
                textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
                // Set the text starting position
                textView.setPadding(36, 0, 0, 0);
                return textView;
        }

(Found on examples of API_Demos, ExpandableList1)

A user of my application report me this photo
http://binomed-android-project.googlecode.com/issues/attachment?aid=-2990980965246303896&name=AndroidShowtime.jpg
As you can see, the indicator of group items is over the text of group
item despite the padding of 36...

And if I'm running emulator WVGA800 or an emulator with "abstracted
LCD density" to 240 I have the same problem, but with my phone (HTC
G1), I don't have any problem.

What is strange is that I try the application API_Demo with an
emulator WVGA800 or an emulator with "abstracted LCD density" to 240
and I go to ExpandableList1 activity and all is alright !

I also try to copy the inner class available in ExpandableList1 for
adapter and I launch it into my activity and I also have the problem
see on photo


What I am doing wrong... ? I am forced to manage density into my
adapters in order to adjust the padding ?

-- 

2. mohon bantuan, pusing soal DREAM

mohon bantuan lg pusing berat soalnya
ceritanya :
1minggu yg lalu beli HTC dream n mau gw root spy bisa ganti rom :D
tapi pusing, sblm gw apa2 in dreamnya update sendiri ke firmware 1.5
nah trus gw ikutin cara root dari
http://wiki.cyanogenmod.com/index.php/Main_Page#How_do_I_upgrade_to_the_latest_CyanogenMod.3F

 dan dari sini
http://www.mreunion.net/android/wiki/index.php/HTC_Dream

tapi tetep g pernah berhasil, lalu gw coba donlot firmware 1.6 dr
HTCnya gw update sukses tapi tetep g bisa ganti room yg laen??!?!?!

pertanyaannya :
1. ada yg bisa bantuin g cara root yg gampang dr firm 1.6???
2. ato ada theme yg keren n gimana cara installnya yg gampangya.

tq master2 smua. tolong dibantuin
--~--~---------~--~----~------------~-------~--~----~
=========================
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:

Click  

3. Is there an explorer for all contentProviders?

4. what is envsetup.sh

5. internal compiler error: Segmentation fault (Eclair + 4.3.1 toolchain)

6. Accents in strings

7. Call Webservice From Android