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. Reading /proc and /sy

Hi All,

Whilst experimenting with naive apps etc I realized that there are no
restrictions on reading /proc or /sys/.  From /sys/class/power_supply/
battery/capacity I can get the amount of charge because all users have
read permission.

ls -l /sys/class/power_supply/battery/capacity
-r--r--r-- root     root         4096 2008-11-21 23:05 capacity

Whilst this is not a direct security threat it appears this should be
prohibited by android.permission.BATTERY_STATS. i.e. It's a violation
of the permission system.

Also being able to gather information from /proc/net it appears that
some read aspects of android.permission.ACCESS_NETWORK_STATE and
android.permission.ACCESS_WIFI_STATE are being violated.

$ ls -l /proc/net/tcp
-r--r--r-- root     root            0 2008-11-23 13:16 tcp
$ cat /proc/net/tcp
  sl  local_address rem_address   st tx_queue rx_queue tr tm->when
retrnsmt   uid  timeout
inode
   0: 6900A8C0:887C 0100A8C0:0050
   1: 6900A8C0:DD8F 0100A8C0:0050
   2: 6900A8C0:ACFB 0100A8C0:0050
   3: 6900A8C0:C734 0100A8C0:0050
where c0 = 192, a8 = 198, 00 = 0, 01 = 1.  and 50 = tcp port 80.

$ cat /proc/net/dev
tiwlan0:  366602     314    0    0    0     0          0         0
28948     339   (WiFi enabled)
rmnet0:   67757     168    0    0    0     0          0         0
128781     193  (GPRS enabled)

If I wrote a service with android.permission.RECEIVE_BOOT_COMPLETED
and android.permission.INTERNET  I could continually monitor /proc
these and gather information about what sites a user visits, without
permission, and  then export the info using the internet.  Obviously
this is not a huge security threat, but I think there are some issues
here.

What do you think?

Chris

2. PV2wayEngine crash

---------- Forwarded message ----------
From: srinu gorle <srinug.andr...@gmail.com>
Date: Fri, 15 May 2009 17:21:48 +0530
Subject: PV2wayEngine crash
To: android-develop...@googlegroups.com

Hi,
i want to test h324m Telephony,

i couldnt find any test case document in the
http://android.git.kernel.org/?p=platform/external/opencore.git;a=tree


i have tried to run
$adb shell
#cd system
#cd bin
./pv2way_omx_engine_test
i tried without any arguments

to give arguments i couldnt find any document related to test case numbers


please find Log :


I/DEBUG   (  539): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG   (  539): Build fingerprint:
'generic/generic/generic/:1.5/CUPCAKE/eng.root.20090513.180712:eng/test-keys'
I/DEBUG   (  539): pid: 720, tid: 722  >>> ./pv2way_omx_engine_test <<<
I/DEBUG   (  539): signal 11 (SIGSEGV), fault addr 00000000
I/DEBUG   (  539):  r0 00000000  r1 00000000  r2 a70d989c  r3 00000001
I/DEBUG   (  539):  r4 0013c800  r5 0000000c  r6 00000001  r7 0013c800
I/DEBUG   (  539):  r8 be9779a0  r9 afe39dd0  10 a73c4a05  fp 00000001
I/DEBUG   (  539):  ip a7116444  sp 4000cc70  lr a7350a61  pc a7350a28
 cpsr 00000030
I/DEBUG   (  539):          #00  pc 00050a28  /system/lib/libopencore_common.so
I/DEBUG   (  539):          #01  pc 00050a5c  /system/lib/libopencore_common.so
I/DEBUG   (  539):          #02  pc 00050aaa  /system/lib/libopencore_common.so
I/DEBUG   (  539):          #03  pc 0005d69a  /system/lib/libopencore_2way.so
I/DEBUG   (  539):          #04  pc 00067a86  /system/lib/libopencore_2way.so
I/DEBUG   (  539):          #05  pc 00067d18  /system/lib/libopencore_2way.so
I/DEBUG   (  539):          #06  pc 00067d44  /system/lib/libopencore_2way.so
I/DEBUG   (  539):          #07  pc 00067df2  /system/lib/libopencore_2way.so
I/DEBUG   (  539):          #08  pc 000c516c  /system/lib/libopencore_common.so
I/DEBUG   (  539):          #09  pc 0005705a  /system/lib/libopencore_common.so
I/DEBUG   (  539):          #10  pc 00057110  /system/lib/libopencore_common.so
I/DEBUG   (  539):          #11  pc 000571c6  /system/lib/libopencore_common.so
I/DEBUG   (  539):          #12  pc 000c4112  /system/lib/libopencore_common.so
I/DEBUG   (  539):          #13  pc 000c499c  /system/lib/libopencore_common.so
I/DEBUG   (  539):          #14  pc 000c4a8c  /system/lib/libopencore_common.so
I/DEBUG   (  539):          #15  pc 0000f880  /system/lib/libc.so
I/DEBUG   (  539):          #16  pc 0000f3f4  /system/lib/libc.so
I/DEBUG   (  539): stack:
I/DEBUG   (  539):     4000cc30  000000dc
I/DEBUG   (  539):     4000cc34  00002bb0
I/DEBUG   (  539):     4000cc38  be9779a0  [stack]
I/DEBUG   (  539):     4000cc3c  afe0b663  /system/lib/libc.so
I/DEBUG   (  539):     4000cc40  afe39dd0
I/DEBUG   (  539):     4000cc44  0000000c
I/DEBUG   (  539):     4000cc48  0000000f
I/DEBUG   (  539):     4000cc4c  fff3ff4d
I/DEBUG   (  539):     4000cc50  00000018
I/DEBUG   (  539):     4000cc54  afe0e940  /system/lib/libc.so
I/DEBUG   (  539):     4000cc58  0015a860  [heap]
I/DEBUG   (  539):     4000cc5c  afe0ecd4  /system/lib/libc.so
I/DEBUG   (  539):     4000cc60  0015a860  [heap]
I/DEBUG   (  539):     4000cc64  000001b4
I/DEBUG   (  539):     4000cc68  df002777
I/DEBUG   (  539):     4000cc6c  e3a070ad
I/DEBUG   (  539): #00 4000cc70  be9779a0  [stack]
I/DEBUG   (  539):     4000cc74  4000cccc
I/DEBUG   (  539):     4000cc78  a70d989c  /system/lib/libopencore_2way.so
I/DEBUG   (  539):     4000cc7c  00000000
I/DEBUG   (  539):     4000cc80  0014f4c0  [heap]
I/DEBUG   (  539):     4000cc84  0013c800  [heap]
I/DEBUG   (  539):     4000cc88  00000000
I/DEBUG   (  539):     4000cc8c  4000cccc
I/DEBUG   (  539):     4000cc90  a70d989c  /system/lib/libopencore_2way.so
I/DEBUG   (  539):     4000cc94  a7350a61  /system/lib/libopencore_common.so
I/DEBUG   (  539): #01 4000cc98  00000001
I/DEBUG   (  539):     4000cc9c  001493a8  [heap]
I/DEBUG   (  539):     4000cca0  00000000
I/DEBUG   (  539):     4000cca4  a70d989c  /system/lib/libopencore_2way.so
I/DEBUG   (  539):     4000cca8  a7116380
I/DEBUG   (  539):     4000ccac  a7350aaf  /system/lib/libopencore_common.so
D/dalvikvm(  606): GC freed 9824 objects / 554896 bytes in 193ms
D/dalvikvm(  567): GC freed 12801 objects / 597064 bytes in 195ms
D/dalvikvm(  606): GC freed 9637 objects / 541336 bytes in 253ms



Thanks.

--~--~---------~--~----~------------~-------~--~----~

3. why XmlPullParser.getName(); return null (urgent)

4. About logger_event

5. Intermittent service start

6. How can I use the apk internal named CoreTests.apk?

7. Found bug in WebView which makes JVM crash!