Any way to get some kind of phone serial number?

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Any way to get some kind of phone serial number?

Postby orbyone » Sat Jan 05, 2008 6:57 pm

Hi,

is there any way to get an Android phone's serial number or something else unique to a phone?

Thanks
orbyone
Freshman
Freshman
 
Posts: 7
Joined: Sat Jan 05, 2008 6:40 pm

Top

Postby plusminus » Sun Jan 06, 2008 1:36 pm

Hello orbyone,

did you try the java.util.UUID-Class ?

Some info about it:
I thought these were called GUIDs. What is a UUID?
Per the draft spec referenced below these are synonymous:
…UUIDs (Universally Unique IDentifier), also known as GUIDs (Globally
Unique IDentifier).


What is a UUID?
According to Wikipedia:
“…an identifier standard used in software construction, standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE). The intent of UUIDs is to enable distributed systems to uniquely identify information without significant central coordination. Thus, anyone can create a UUID and use it to identify something with reasonable confidence that that identifier will never be unintentionally used by anyone for anything else. Information labelled with UUIDs can therefore be later combined into a single database without need to resolve name conflicts. The most widespread use of this standard is in Microsoft’s Globally Unique Identifiers (GUIDs) which implement this standard.

A UUID is essentially a 16-byte number and in its canonical form a UUID may look like this:

550E8400-E29B-11D4-A716-446655440000


So these version 4 UUIDs are basically random numbers. Won’t my UUID collide with someone elses?
There are 122 significant bits in a type 4 UUID. 2122 is a *very* large number. Assuming a random distribution of these bits, the probability of collission is *very* low. How is the “randomness” determined?

Under the hood java.util.UUID is creating an instance of SecureRandom and using that to generate new UUIDs. If you are using the default Sun provider and default java.security file, you are using a SHA1PRNG ( Pseudo Random Number Generator based on Secure Hash Algorigthm 1 ) seeded from the operating system.

java.security

#
# Select the source of seed data for SecureRandom. By default an
# attempt is made to use the entropy gathering device specified by
# the securerandom.source property. If an exception occurs when
# accessing the URL then the traditional system/thread activity
# algorithm is used.
#
# On Solaris and Linux systems, if file:/dev/urandom is specified and it
# exists, a special SecureRandom implementation is activated by default.
# This "NativePRNG" reads random bytes directly from /dev/urandom.
#
# On Windows systems, the URLs file:/dev/random and file:/dev/urandom
# enables use of the Microsoft CryptoAPI seed functionality.
#
securerandom.source=file:/dev/urandom


:src: Read more ...


Let us know if it helped (As this could be pretty useful for others perhaps some final code :) )

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby orbyone » Sun Jan 06, 2008 4:04 pm

the idea of using a UUID is not entirely bad. the thing is, if the user deletes the application and then reinstalls it, the application will create a different UUID. think of it as a scenario for implementing product registration. we need a unique serial number of a device, that does not change after reinstallations.

Thanks again
orbyone
Freshman
Freshman
 
Posts: 7
Joined: Sat Jan 05, 2008 6:40 pm

Postby plusminus » Sun Jan 06, 2008 7:07 pm

Hello orbyone,

perhaps this is what you need :?: The IMSI:
:src: http://www.anddev.org/viewtopic.php?p=1703#1703

Let us know if it helped you :)

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby orbyone » Sun Jan 06, 2008 9:38 pm

great, that seems exactly what I want. I hope real phones can still provide that information, since privacy issues could be involved here.

thanks again
Themos
orbyone
Freshman
Freshman
 
Posts: 7
Joined: Sat Jan 05, 2008 6:40 pm

Postby Katharnavas » Tue Jan 08, 2008 7:14 am

orbyone wrote:great, that seems exactly what I want. I hope real phones can still provide that information, since privacy issues could be involved here.

thanks again
Themos


Hi,
IS there any possibility to obtain IMEI number rather than IMSI which is UNIQUE in all mobile phones.
Katharnavas
Senior Developer
Senior Developer
 
Posts: 100
Joined: Tue Dec 04, 2007 5:57 am
Location: India

Top

Postby Katharnavas » Tue Jan 08, 2008 7:31 am

Katharnavas wrote:
orbyone wrote:great, that seems exactly what I want. I hope real phones can still provide that information, since privacy issues could be involved here.

thanks again
Themos


Hi,
IS there any possibility to obtain IMEI number rather than IMSI which is UNIQUE in all mobile phones.


Sorry I found it inside the same telephony package..
Katharnavas
Senior Developer
Senior Developer
 
Posts: 100
Joined: Tue Dec 04, 2007 5:57 am
Location: India

Postby plusminus » Tue Jan 08, 2008 3:26 pm

Hey guys,

appended some extra lines for the IMEI in the same Tutorial as above:
:src: http://www.anddev.org/viewtopic.php?p=1703#1703

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Katharnavas » Wed Jan 09, 2008 4:54 am

plusminus wrote:Hey guys,

appended some extra lines for the IMEI in the same Tutorial as above:
:src: http://www.anddev.org/viewtopic.php?p=1703#1703

Regards,
plusminus


Thats a very fast modification.. I really like to thank you for ur contribution towards the android community ..
Katharnavas
Senior Developer
Senior Developer
 
Posts: 100
Joined: Tue Dec 04, 2007 5:57 am
Location: India

Top

Return to General

Who is online

Users browsing this forum: No registered users and 4 guests