I tried to understand the effect of hasSpeed() function in android(Locatio), but i still stuck at this point ,anyone clarify my doubt ?
Simply put, it's the physically moving speed of the location provider. For example, this can be used to calculate the movement speed of a device using the GPS. You can read more on the official docs for Location Strategies.
Related
i'm looking for the best way to implement a road navigator that gets the velocity, distance between 2 points using the smartphones techniques.
through my searches i found 2 different tech. using either the accelerometer or android API (android.Location).
some opinions said that using accelerometer wont give me an accurate results because there will be so much noises as a bumpy roads, buildings...etc and calculations will be so complex.
on the other hand using the Android API (android.Location) means i should always be connected to the GPS, doesn't that affect on the battery?!! and as i found i can't open the GPS by myself i used always ask the user for a permission(so boring). and is there an limitation
So kindly help to take a decision, is it useful to be connected 24 hours on GPS in order to update the device location.. or to use the accelerometer??
You definitely should use GPS. The battery will be strained but you get much more accurate result. Sensor should be used only when GPS is not available and for a short distance.
Using GPS you can call location.hasSpeed() and if positive call location.getSpeed() together with getBearing() will give you the velocity.
I am trying find out the speed and altitude in android without using getspeed() and getAltitude() methods. If any one has any reference material or code snippet with respect to this,please share it so that it can be of some help to me.
Speed can be done by keeping track of location on subsequent updates, finding the distance between them, and dividing by the time difference. Altitude- good luck, you'd need signal strength info that I don't think you can get. You really don't want to do it.
I a trying to create an application that will be able to guide people in a city, with points of interest. For this, I need the better accuracy I get, in order not to place POI where there is nothing...
To do this I use droidAR (it gives me a radar, and I can place my POI thanks to their coordinates). But the accuracy is so bad I can't see how this can used.
For exemple, to determine if I a close to a POI, I calculate the distance between it and my GPS position. It can be that, with a 10 meters accuracy given by Android when I place the POI, it is then 80 meters away when I try to find it.
SO I looked forward to find another position systems, I found :
skyhook, which is supposed to give a more accurate position. With this, I took 1000 points and checked their distance to the last point, it is always moving and it was sometimes 300m away, so it seems even less precise. Maybe anyone could use it successfully ?
someone told me to use DCM algo (Direct Cosine Matrix), that can give me an accurate relative position (no problem for my use cases to do every positioninf relative to a start point). Some drones are using it, it could reach 1 meter accuracy. But I couldn't find any implementation or help with Android.
Did anyone succeed into using the android GPS with accuracy ?
Either your android phone has a bad GPS device, or more probably you are doing something wrong. you can set a POI in city aprox. 5m acuracy, sometimes 20m. that is sufficient. check it with another GPS app that allows setting a waypoint.
In your app you could concentrate on the 95% GPS accuracy. There is nothing better than GPS (espcecialla yon a mobile phone), the other methods you described are for short time assistance to GPS, but they will not work good for pedestrians, they are made for vehicles (vehicles move straight most of the times, they cannot change its direction so fast like a human does).
Your problem is not the GPS location accuracy, it is the augmented reality projection of droidAR.
I want to develop an application in which I need to know the position of my device within a building (the room in which the device currently is). GPS is not working in the building. Is there any way to find the position of the device in building? If yes how? Can i use position or motion sensors or combination of these for this purpose?
There is no general solution. In case you can place WiFi hotspots/repeaters in the building (preferably in every room), you can triangulate the position from the WiFi signal strengths. But that's also not straightforward, because of different signal losses through the walls and floors. You'll need to survey the building and make a signal strength map in advance and then, based on the signals you receive, look up your location on the map.
Motion sensors are also not precise enough and compass, if you are inside a steel construction, is inaccurate, too.
You can try using the Network to locate the user. If the signal is strong enough, it should return a decent location fix, though not as accurate as GPS
Unfortunately there is no easy solution. Network location is out of the question, since it is not precise enough to show buildings, not even mentioning rooms.
The only way I could think of for this to work is to use external sensors in building and somehow connect them with the device.
This seems like it should be simple enough, but I can't seem to get a clear example of how to calculate my speed using Android's Location Services.
All I want to do is calculate my speed based on my previous and current GPS position. getSpeed() doesn't work, because it needs to be set at some point using setSpeed().
So is there any sample code out there that I can run in Eclipse against my Android emulator running a GPX file, that will show me my pace in any measure (meters, feet, miles, etc., doesn't matter - I can always convert this to what I need).
Thanks in advance,
Alex
Do you just mean something like this? Gives you the speed in m/s.
oldLocation.distanceTo(newLocation) / (newLocation.getTime() - oldLocation.getTime())
getSpeed() doesn't work, because it needs to be set at some point using setSpeed().
(In case you are using an actual device -- ). No, the speed is determined by the GPS chipset and it should be more accurate than getting the distance and time between two consecutive locations. You do not need to setSpeed() . Call hasSpeed() to see if the speed is valid.
(In case you're not using an actual device)
I've had good success using the mock location provider where you can set the Location object you want with setSpeed() in meters/second
Here are some ways of doing this :
Mocking using NMEA
Mocking using code