In my Application i need to use user's current location.
Through GPS, i knw how to do it but can any body have idea that how it can be done using Wifi?
Pls do my help,
thanks.
Have a look at the Android Obtaining User Location documentation - especially the usage of the NETWORK_PROVIDER.
Related
My question is to get location while having no internet and GPS off, is there any way?
Please don't give ans about GPSTracker class etc.. I used it..
Please give logical answer only.
no "NETWORK_PROVIDER" and no "GPS_PROVIDER"
is that possible?
I think its not possible, Itried a lot. I didn't found solutions...
Sorry if I am wrong.. Its my opinion.
There is company called IP2Location which maintains a number of databases which can convert an IP address into country, state, city, latitude, and longitude. Have a look at the following link:
http://www.ip2location.com/databases/db5-ip-country-region-city-latitude-longitude
This database can be useful if you need to get a user's location but you can't assume that he will be able to access either GPS or a web service.
I suggest try to use Google Maps Geolocation Api
you need POST a request, the the service will return a location with accuracy in meters.
I need to have latest gps coordinates when gps was enabled , for example I turned on my gps yesterday , today gps is not enabled but I need to have latest coordinate.
is there any way to get latest user gps coordinates when the gps was enabled ?
Thanks
I think that, there is not a direct way to get a "non-existent" gps location. You have to use some of the repository, and then take the data from there. Storing in a database, file, server etc.
LocationManager.getLastKnownLocation() might do what you want.
I am developing an android application in which i want to use wifi only to find user's location is it possible to find location of your device just by using Wifi ?
In this app i m trying to guide user to go from one place to another inside a building so i want exact location cell tower location or gps location will not be of any help
LocationManager.NETWORK_PROVIDER will use either Wifi or cell tower location (not GPS). If you want the best location, that would be fine GPS (wifi is the least accurate.) You can ask the LocationManager to getBestProvider and require fine GPS with:
criteria.setAccuracy(Criteria.ACCURACY_FINE);
Based on your latest comment, I think you would like to guide a user inside a building and somehow get more accurate locations than a gps location (which would probably not be accurate inside a building anyway). While there may be some specific situation in which this would be possible, I would say no, there is not a general solution that could be applied.
For Current Location, using GPS is highly recommended. Because with only Wifi, it will not be accurate. But still you can use this:
String uriName = "geo:"+ lat+ "," + lon+ "?q=my+street+address";
startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uriName)));
This should work with roughly accuracy.
I think you want to guide the user while inside the building, if so, then I don't think that GPS or Wifi will be able to help you.
GPS provides a very fine location but require clear contact with the gps satellites in the space which won't be available inside buildings. Also the accuracy is within some meter distance which won't be effective in your case.
Cellular wifi will provide you location using the nearby cell tower which i think is self explanatory in your case. So, I don't think that both location services will of use in your case.
I am developing an restaurant locator for that i need to find the current location of mobile without using the GPS, is it possible?
kindly help me with the codes
Yes you can use the NETWORK_PROVIDER but why would one do that?
http://developer.android.com/reference/android/location/LocationManager.html#NETWORK_PROVIDER
is it possible to detect a speed of a car using GPS or accelerometer in android phone ?
can anyone give me the road map to implement this ?
Yes, it's possible using GPS via object of Location class. There is getSpeed() method in this class.
It's very easy to find code of getting location. Check this link for example.