Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to get phone number from my android app?  RSS feed

 
Suzzane Pinto
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
i have written this simple code to get phone number programaticly

it doesnt give any output...

any idea?

 
Tim Moores
Saloon Keeper
Posts: 3512
77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you verified that the code is being run?
 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you had set permission in manifest as permission READ_PHONE_STATE
 
Suzzane Pinto
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

yes,i hav given permission in manifest.
still no output
 
Suzzane Pinto
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and is it possible to get the andriod version,model of phone and network from my app code??
if yes how?
 
Tim Moores
Saloon Keeper
Posts: 3512
77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:Have you verified that the code is being run?
 
Suzzane Pinto
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried to run but no output....many say dat it is running while some say its not sure
 
Suzzane Pinto
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and is it possible to get the andriod version,model of phone and network from my app code??
if yes how?
 
Tim Moores
Saloon Keeper
Posts: 3512
77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Posts: 3512
77
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your first step should be to verify positively that the code runs, for example by writing something to the Log.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!