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.
Related
I'm trying to do a Indoor Positioning Systems (IPS). so GPS will not the best way to do this. my question is, s it possible to get location using Earth’s magnetic field (Sensor.TYPE_MAGNETIC_FIELD) ? why I come up like because of this article
Hope you guys will help me out... or if you guys have a good idea better than this please comment.... have a nice day....
GPS will give you coordinates,
Magnetic field will give BEARING.... It will not give the coordinate information.
The example of turtles that you gave are not concerned with their coordinates.... They use the magnetic field to know which direction they are heading in
If GPS is very slow/innacurate for you, Try using FusedLocation API,
It will use GPS, Network (signal triangulation), proximity and the magnetic sensors to provide an accurate Location and Bearing faster than just using a GPS...
NOTE: For it to work fast, the Data/wifi has to be on... else it will use just GPS if you requested a FINE Location and it will again be very slow indoors
Options for accuracy/power in fused provider
https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest
FusedLocationProvider details:
https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderApi
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.
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.
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
i did the GPS application which gets the current location.It is working in android emulator by using DDMS perspective(by passing mock location).But it is not working in android phone and phone is Samsung gt-i5801.please help me.
And one more thing i want to ask you guys.
(Why i need Gps) bcoz
in my appln i want to display the nearest cinema theatres by using latitude and longitude.
Is there any other way to do that.
Please tell me.
I think there is no problem in your code if it runs in emulator. But you have not start the gps on your phone, so it's giving a null pointer exception.
So now when you use gps, first check whether gps is on or not. Then fetch lat. and long.
You can check your gps is on or off by this:
LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
boolean val= mlocManager.isProviderEnabled(LocationManager.GPS_PROVIDER)
First of all, tell us what errors are you getting when you run it on the device. Logcat messages!?
Secondly, there must be any webservice which gives you the nearby cinema theatres, so you might be required to give it your current location in latitude and longitude.
For getting your current location, GPS is necessary.
On the other note, you can also use NETWORK_PROVIDER to get your current location.