View Single Post
Old 12-17-2008, 01:24 PM   #1 (permalink)
jeromeng
Knows Where the Search Button Is
 
Join Date: Jun 2008
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 26
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default DeviceInfo.getDeviceId() gets Wrong PIN

Please Login to Remove!

Hi,
I used the code snippet below to retrieve my device PIN and got wrong values for both the simulator and real device (8310); the retrieved PIN was a 9 digit int (all are numbers) instead of an 8 digit string of the format 251CE***. What am I doing wrong?

Pls help

====== CODE STARTS========
import net.rim.device.api.system.DeviceInfo.*;

//retrieve device PIN
int _PIN = DeviceInfo.getDeviceId();

//convert INT to String
String sPIN = ""+ _PIN;

//append PIN to URL
String _url = "http://mypage.com?PIN=";
StringBuffer sb = new StringBuffer();
sb.append(_url);
sb.append(sPIN);
String full_URL = sb.toString();

//display PIN and URL on screen
RichTextField _path1 = new RichTextField(sPIN);
RichTextField _path2 = new RichTextField(full_URL);
add(_path1);
add(_path2);

=======CODE ENDS============
Offline   Reply With Quote