aspose file tools
The moose likes Android and the fly likes how to get  phone number from my android app? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "how to get  phone number from my android app?" Watch "how to get  phone number from my android app?" New topic
Author

how to get phone number from my android app?

Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 214
hi ,
i have written this simple code to get phone number programaticly

it doesnt give any output...

any idea?

Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2409
Have you verified that the code is being run?
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 632

Did you had set permission in manifest as permission READ_PHONE_STATE


Life is easy because we write the source code.....
Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 214
hi,

yes,i hav given permission in manifest.
still no output
Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 214
and is it possible to get the andriod version,model of phone and network from my app code??
if yes how?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2409
Tim Moores wrote:Have you verified that the code is being run?
Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 214
i tried to run but no output....many say dat it is running while some say its not sure
Suzzane Pinto
Ranch Hand

Joined: Feb 10, 2012
Posts: 214
and is it possible to get the andriod version,model of phone and network from my app code??
if yes how?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2409
and is it possible to get the andriod version,model of phone and network from my app code?

Check android.os.Build.VERSION, android.os.Build.MODEL, android.os.Build.MANUFACTURER and android.net.ConnectivityManager.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2409
Your first step should be to verify positively that the code runs, for example by writing something to the Log.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to get phone number from my android app?