[TinyTut] - Reading out the Phone's number
What you learn: You will learn how to read out the phonenumber of the device your application is running on.
Difficulty: 1 of 5

Description:
Nothing is easier to be done, if you know where to search for it

The SystemProperties provide a bunch of data of the current Phone-'Properties', like:
- the operator-Name (i.e.: "T-Mobile" or "AT&T"
- the ISO-Country-Name (i.e.: "us" or "de")
- and of course your Phone-Number

Using java Syntax Highlighting
- String phoneNumber = android.os.SystemProperties.get(
- android.telephony.TelephonyProperties.PROPERTY_LINE1_NUMBER);
- String operatorISOCountry = android.os.SystemProperties.get(
- android.telephony.TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY);
- String operatorName =android.os.SystemProperties.get(
- android.telephony.TelephonyProperties.PROPERTY_OPERATOR_ALPHA);;
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
On the emulator this will return: "15555218135", "us" and "Android".
Regards,
plusminus





