• Post Reply Bookmark Topic Watch Topic
  • New Topic

can we detect location if GPS is not accesible

 
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: 3336
61
  • 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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!