aspose file tools*
The moose likes Android and the fly likes can we detect location if GPS is not accesible Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "can we detect location if GPS is not accesible" Watch "can we detect location if GPS is not accesible" New topic
Author

can we detect location if GPS is not accesible

sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1202
I need to know whether there is a way to detect location if GPS is not accesible?
Saurabh Pillai
Ranch Hand

Joined: Sep 12, 2008
Posts: 509
I think you can get the IP address and there are APIs which can resolve location from IP.
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1202
how to get IP address for Mobile phone ?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
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.
 
Don't get me started about those stupid light bulbs.
 
subject: can we detect location if GPS is not accesible