Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can we detect location if GPS is not accesible  RSS feed

 
sam liya
Ranch Hand
Posts: 1246
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to know whether there is a way to detect location if GPS is not accesible?
 
Saurabh Pillai
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can get the IP address and there are APIs which can resolve location from IP.
 
sam liya
Ranch Hand
Posts: 1246
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to get IP address for Mobile phone ?
 
Tim Moores
Saloon Keeper
Posts: 3419
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would be a dynamic IP of the telco provider network - not much you can infer from that.

But you can use the network location provider if the user has enabled that. That's what the ACCESS_COARSE_LOCATION permission is all about (as opposed to the ACCESS_FINE_LOCATION which covers GPS). As usual, the Android docs have all the details: http://developer.android.com/guide/topics/location/obtaining-user-location.html

You really need to spend time reading through the documentation, most of your question are answered right there, even with code examples.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!