Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can we detect location if GPS is not accesible

 
sam liya
Ranch Hand
Posts: 1240
  • 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: 524
  • 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: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to get IP address for Mobile phone ?
 
Tim Moores
Bartender
Posts: 2749
38
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic