Hey Nando,
You can get this through the TelephonyManager.
You could so something like:
TelephonyManager mTelephonyMgr =
(TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
String sDeviceID = mTelephonyMgr.getDeviceId();
String sSimSerial = mTelephonyMgr.getSimSerialNumber();
etc etc
Remember you can't guarantee you will have those be unique. In the
emulator they may not even exist. So account for that. And you will
require the android.permission.READ_PHONE_STATE to use it.
Hope that helps.
--
Regards,
Dana Epp
Microsoft Security MVP
On Fri, Jun 25, 2010 at 2:36 PM, Nando Android <[email protected]> wrote:
> Hello,
> I wonder how could I fetch the phone's phone number or an unique id
> to identify it?
> Thanks.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en