[android-developers] Re: getting the serial number

2010-02-03 Thread guich
Hey, thanks

Worked fine on G2. This is the code i used:

#include sys/system_properties.h
  char buf[32];
  buf[0] = 0;
  __system_property_get(ro.serialno,buf);

Interestingly enough, i also tried this:

   char buf[2048];
   if ((in = open(/proc/cpuinfo, O_RDONLY))  0)
  debug(can't open); // 2mb at least, or some litebase tests
will just skip over.
   else
  {
   if (read(in, buf, sizeof(buf))  4)
  debug(can't read);
   else
   close(in);

and it outputs:

can't read
Processor  : ARMv6-compatible processor rev 2 (v6l)
BogoMIPS   : 383.38
Features   : swp half thumb fastmult edsp java
CPU implementer: 0x41
CPU architecture: 6TEJ
CPU variant: 0x1
CPU part   : 0xb36
CPU revision   : 2

Hardware   : sapphire
Revision   : 0080
Serial : 

The interesting thing is that Serial is 0!

cheers, guich

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: getting the serial number

2010-02-02 Thread guich
Hummm... i'm trying to find the adbd (adb daemon) sources that runs at
the device. Maybe the solution is written there. However, not even
google is able to find this code. Can someone point me to it?

I really can't understand why isn't this available through the api...

thx

   guich

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: getting the serial number

2010-02-02 Thread Mike Novak
I was able to pull the serial number of nexus one through the 
/system/bin/getprop command, however, My Samsung Moment did not have the serial 
field filled in (its blank).

I was able to execute getprop from an apk on a non-root device.

Mike

On Feb 2, 2010, at 5:24 PM, guich wrote:

 Hummm... i'm trying to find the adbd (adb daemon) sources that runs at
 the device. Maybe the solution is written there. However, not even
 google is able to find this code. Can someone point me to it?
 
 I really can't understand why isn't this available through the api...
 
 thx
 
   guich
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: getting the serial number

2010-02-02 Thread guich
Hi,

Can you post the code so i can test in the devices i have here? I
never used this command...

thx

   Guich

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: getting the serial number

2010-02-02 Thread Mike Novak
use the Java Process class to execute the following command `getprop 
ro.serialno`.

note that it appears Samsung devices do not set this property. I've confirmed 
this on a Moment and Galaxy.

Mike

On Feb 2, 2010, at 7:42 PM, guich wrote:

 Hi,
 
 Can you post the code so i can test in the devices i have here? I
 never used this command...
 
 thx
 
   Guich
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en