Android - how I can I achieve location accuracy in Google Map - android

I am self learning Android programming at the moment. I was about to write app that will display my location on map without using GPS.
I have tried using NETWORK_PROVIDER and found that my accuracy is constantly at 2000 even in city area with a lot of wifi around the area.
I would like to know how could other map application (e.g. GoogleMap) is able to achieve high accuracy without using GPS.

They use GPS. Or they lie about their accuracy. Ever seen the big blue circle around your position in Google Maps? That means they think you're somewhere in that circle, and are guessing about actual position.

The only way to get accuracy is to use GPS/GLONASS signals. A-GPS can help to fix position quickly because it provides info about which satellites are in view from your phone cell position (your device don't spend time trying to get signals from satellites not in view).
The 'High accuracy' mode is just a lie from Google to know your position all the time to monetize you in perverse ways

If you are using the network provider to fetch the location they are not very accurate. SO its not a good idea to fetch the accuracy of your position using
network provider. Its best to use GPS to get the location updates. You can use GetAccuracy() method of Location class and see for the value it returns.
Let Say if getAccuracy() retruns 25 then you can leave this value wait for another gps value which is more accurate.

Related

LocationProvider - Detecting highly inaccurate/incorrect locations

So I know you can use getAccuracy() to find the accuracy of a location but if you set up a cut off for the accuracy, can you prevent recording down one of those locations where it's hugely off mark of where the user is? Like if the user is still, most location updates cluster around his area but occasionally the location provider will hiccup and report the location as somewhere miles away.
Do these locations simply appear as "accurate" with getAccuracy? Or would they turn up as some insanely high getAccuracy() result? Programming a cut off point is easy enough but I was wondering if I would have to code extra checks such as if a location is way too different from the previous ones then it's a wayward one.
Accuracy is not the only deciding factor here. You should also look at the age of the location, and the provider if you get it (the Google Play Services location doesn't tell you, but the original Android LocationManager does).
In fact, Google has some useful sample code for maintaining a current best estimate. I have used a variation of this to filter out wild jumps in incoming location data. Essentially a location is not even reported if it doesn't pass this gate.

Jumps in location on using fused location api

I am tracking rider's location(bike rider) and calculating total distance travelled per session by him. I have used fused location api only (no GPS). There are times when I am getting jumps in location and due to these jumps extra distance is added,hence results in overall wrong distance. Please help me in finding these wrong latitude and longitudes. Is there any good filter which can be easily implemented in Android or any good method for the same?
Distance measurement on raw GPS data will always be noisy, because the underlying data is often inaccurate. These jumps are due to inaccurate location measurements. To achieve, accurate distance measurements, you can need to filter the noise in the data.
Some useful filtering techniques that you can explore are:
Smoothening location data using Kalman filters - see tutorial
Snapping to road with Google maps snap-to-roads API, or OSRM match service.
If you are looking for an end-to-end solution that gives accurate location data and distance measurements, you can also try the HyperTrack SDK for Android or iOS. You can read about how they filter locations to improve accuracy on their blog. (Disclaimer: I work at HyperTrack.)
Location isn't exact. Even with GPS it isn't. Fused location can be off by hundreds of meters. If you're standing still every few minutes you'll get one reading that's just really off. Sometimes I walk from my kitchen to the bathroom and it thinks I've gone a quarter mile. If you look at the accuracy it returns, remember that there's a 2/3 chance you're within that distance. There's still a 33% chance that you're nowhere within that radius.
You're going to have to accept inaccuracy. There are a few ideas you can do though
1)Ignore all updates unless they travel at least some minimum distance. Adding in all those little amounts will add a lot of inaccuracy quickly.
2)Require at least 2 updates near a new location before accepting that as the new location.
But if you're using network location for short movements- you're going to have a difficult time of it.
Go to Settings -> Location -> Mode.
And make sure the mode is set to Device only.
This will stops the jump

GPS tracking within vehicle in android

I am in need to develop an android app where the device will track the distance traveled while the user is in a moving vehicle. I am getting the GPS values at small interval so that I can retrieve the distance and sum them up. But the problem I am facing is, while the user is in the vehicle, the device is not getting a clear view of the sky. Hence, the GPS device cannot get values as frequently as I desire. Thus, the result produced contains huge fluctuations. I tried using the network provider, but that is even worse in this scenario.
It would be very much helpful if anyone can suggest me a solution to this problem.
Just put the receiver onto the inner side of the windshield, like all navigation systems do. This should give an acuracy of about 3-6m. (when SBAS correction is available in your location) or up to 10m if not.
If the receiver is not state of the art (combined GPS + GLONASS or BEIDOU) then you will have problem in cities, especially in urban canyons with location jumps up to 30m.
This is normal. To get correct result for a GPS application within a city you need advanced algorithms. Just summing up the distance between two consecutive locations is to primitive, this never works well. Distance calculation by GPS has be answered some times her at SO. Use the search engine, to get more info at that topic.
Of course, set the device to GPS provider only, with maximum precision.

how to get the most accurate location using GPS and AGPS with given time in android?

I have a below requirement.
Find location of user from GPS and AGPS. (we are going to use Samsung Galaxy ACE mobile phone)
Note: For every transaction first location will be the reference location for the next activities.
Below are the constraint which has to be considered while solving this problem.
user should be within 10meter range of the reference location. meaning (Reference location - current location) <= 10meter (distance calculation by Locaiton class API).
Location has to found in the given period of time.
let say 20-25sec for finding each locaiton. the time can be extended to max 35sec.
My user is always be outside of the Shop while taking the reference location and then inside for all the other activities.
What I am doing
find the reference location with accuracy of 30m with 25sec of time. store this in static variable.
find the location for next actiivty and calculate the difference. if difference >=10m tell user to perform that activity again.
My Queries
Is this possible with such fine accuracy in the distance with given Time and place?
How google calculate this distance?
Does google finds the location with such accuracy? or what is the accuracy of Google Map using GPS? for e.g. at given particular time and location given by the Google MAP by GPS how much it is accurate? like if i am standing near to my BANK then what is difference between co-ordinates on the google map on the server and the co-ordinate given by google map through GPS on mobile phone.
I have did enough experiment on this problem and finally came here for help.
i did the observation by doing variation in timing, place, accuracy. still need to find one final solution. as we have to answer the client whether it is possible or not?
The GPS can provide most accurate match but only outdoors. It is possible to achieve such accuracy but not guaranteed.
There are formulates for finding distance between two points on a sphere. However, for rough approximations euclidean distance can be tried.
The location and its accuracy depends on client side GPS. Google just reads it.

Android : Getting CURRENT coordinates (not lastKnownLocation)

Right now, I only know of one method to do this:
- Get last known location
- Have the location manager request location updates
However, I really only need to get the CURRENT coordinates ONCE right when the application is called, but it's not doing what I want.
What's the simplest way to get the current coordinates? Is there something I could call or some code I could use just to get the location RIGHT NOW ?
thanks in advance! I'm still a little new with android development.
What's the simplest way to get the current coordinates?
There is no way to get the current coordinates on demand.
Is there something I could call or some code I could use just to get the location RIGHT NOW ?
No, for three related reasons:
Not all location technologies are low power. GPS, for example, is a serious battery hog. Hence, GPS is not powered on unless something is actively seeking a GPS fix.
Not all location technologies are instantaneous. GPS, for example, takes some number of seconds to get a fix after being powered on.
No location technology is universally available. GPS, for example, may be unavailable because you are in a large building.

Categories

Resources