android GPS calibration - android

When moving a big distance, like to another city, with the GPS off, it takes very much time for it, when turned on, to get the first correct point.
So if by example I register to the gps provider, it could take up to 10 min until the first onLocationChanged call.
The network provider will respond faster, but is less accurate.
Is there a way to help the gps provider? To give it an approximate location (the one from the network provider), so it can find my location faster?
I think that google maps made some kind of optimisation, because their app finds my location faster than my basic app, that only register to the gps provider.
Any idea how I could accelerate the process of obtaining my location with decent accuracy ( <30 m) ?

You are right that if you move a long way with the phone switched off, then it can take a long time to get a satellite fix. This is where AGPS helps. The 'A' stands for 'assisted' which is very much carrier and handset dependent in its implementation. In essence it gets an approximate location from cell towers or from public WiFi like coffee shops and then downloads ephemeris and almanac data which tell the phone which satellites are likely to be overhead at that time in that rough location. The phone can then start listening on the frequencies corresponding to the visible satellites first. This should speed up the time to first fix.

Common practice is to use WiFi SSIDs or the location of the cell tower you're registered with to look up your current location via providers like WeFi or Skyhook. Google uses its own service for that (and sees that no one else does).
Another method would be, in case your smartphone has a barometer, to look up the air pressure and try to pin it down to a location. While all these methods can theoretically be used offline, it is easier to fetch the data from the internet.
Also note that inaccurate NTP settings on the phones may lead to longer GPS search times.

Is there a way to help the gps provider?
NickT has answered this, but the android phone has to call the AGPS. In your app you cannot controll that.
I think that google maps made some kind of optimisation, because their
app finds my location faster than my basic app, that only register to
the gps provider.
This should not be the case, probaly you are doing something wrong, or the google app can enable assisted GPS. Try to compare with other android GPS apps (e.g compare with Motion-X-GPS)
it could take up to 10 min until the first onLocationChanged call.
Normally this is far too long, either your phone is known to have a weak GPS quality, or the device did not have free view to open sky. Even without assisted GPS, after 45 seconds, you should have a valid GPS position (asuming free view to open sky).
But this situation can happen, either the first time you use GPS on your device, or when you fly by airplane to a location far away to your last GPS position.
On my iphone i rarly saw such a situation when another GPS app was somehow disturbing, after a reboot of the device the GPS was immedeatly valid.
Again check if it is the fault of your app, by comparing if other apps needs 10 minutes too. (It could be your fault, when you wait to recieve an accuracy <30m while other apps would take the first valid position they get.
If google needs 10 minutes, too, then you could do nothing on that phone, except to expose it to good view to sky.
(Inside an urban canyon it's more difficult to obtain a valid first fix, then on an big place.)

Related

Why do we call everything a GPS location?

At the moment I'am working on a application that is using the location of a phone. Before I started with building my application I did some research about how the phone location is working.
The conclusion is that a mobile phone can talk to a GNSS satellite and then determine the location of the device (in real life there is much more technology behind this, but I will leave that aside for the sake of simplicity). However, I noticed that when we talk about Geographic locations, many people talk about a GPS location. But why is it called a GPS location? Because during my research I also read that the latest phones are now equipped with a multi-GNSS system that allows them to talk to different GNSS systems and use all this data together to determine a location even more accurately. However, this means that not only the GPS data is used, but also data from GLONASS.
So why is it always called a GPS location? Or is my theory wrong?
I already did some research about this topic on the internet but I cant find any information about this topic.
Because the average person doesn't care about details. GPS was the first major positioning satellite system you could use to get location. So people called it the GPS location. When other systems came up, people kept using the old name because they were used to it, and because they weren't technical enough to care about the difference. THat's why you still tape TV shows when recording digitally, all acetompinophine is called "Asprin", the save button is still a floppy disk, and my mother still calls any video game system "playing Nintendo". If you're talking to professionals in the field where the different satellite systems matter, they'll use more specific terminology. Everyone else will still say "GPS".

Using the GPS to detect whether an android device is indoors

The app which i'm writing need to somehow detect if an android device is indoors or outdoors. My goal is to detect if the user left a certain building as soon as possible.
I tried to use the user location signals. I'm not initiating any GPS sampling since I don't want to waste too much battery power, so the only way to detect if a user left a building is to wait for him to be far enough from the place and then use location signals which were sampled by wifi or cell.
The problem is that it takes quite some time for me to detect that the user left the building.
I know that when a user is indoors, his GPS signal is weaker. Can I somehow use the GPS status to find out if the user is indoors or outdoors? Will it be wasteful as initiating a GPS location sample?
Thanks.
I don't think you can do what you want to do with the FusedLocationProvider as this uses WiFi and cell tower triangulation. You will need to use the LocationManager.
It is also difficult to detect if you're inside and as far as I know there is no definitive way of doing this. You can make informed guesses however.
In terms of detecting a "weak" GPS signal you have a few things you could check:
The number of satellites available to you. If a low number then you are either indoors or somewhere with poor satellite coverage.
The horizontal accuracy of a received GPS location. If this value is high it can be deemed as poor accuracy which could be because you're inside.
No location has been received for a period of time. This could be because you're inside.
Have you thought of doing other checks as well as GPS so if they're connected to WiFi it increases the likelihood of them being inside?

Why android GPS is not able to find location untill google map is on even if my phone supports A-GPS

I have make an android application which help us to get GPS Location using A-gps in my android phone. I am getting latitude and longitude successfully in Metro Cities of my country, but when I am going to some forest area,GPS do not get location and for this I need to run GPRS of my phone,after running google map once in my phone ,GPS successfully gets latitude and longitude even if I closes my internet connection or remove sim card from my phone. But since I do not want to use google map, what should I do now and why it is happening?? Any help will be appreciable
It takes a long time (several minutes) to get the GPS location with high precision. However, if you enable network based location (e.g. cell tower, WiFi), it's way faster but with lower precision.
As a result, you should listen to all the providers with LocationManager, and figure out which provides the best location. Or, if your app targets Android 8 and above, you can use the Location APIs provided with Google Play Services, which hides the details as using LocationManager directly.
First make sure that it is not the fault of your phone or its operation system version.
Download a well working known GPS App, look if they get a GPS signal without internet.
Place it under very good cointions: free view to sky, outside dense city, at least an open place.
You should get a signal within one minute, maybe if the phone has a poor built-in GPS antenna, a bit more, wait some minutes.
If the well working foreign app still don't get GPS it's an Operating system bug.
If you get one, then it´s your fault, and it is worth for further investigation.
*first check your GPS working or not properly with **ANDROITS GPS TEST*.
if it finds and fixes satellite do not worry. as AGPS is fast , standlone GPS needs to have much more time to fix on its own especially in city as many radio waves disturbs GPS fixure.
better first fix with AGPS and then you can turn off data or internet, still it will work as it already had its location and satellites fixed.
with standlone GPS it takes huge time and battery.**
If your phone use GPS h/w to get the location information, it don't require any internet connection. It should be able to get the location fix using GPS without the help of internet. But it may take some time to get the location fix.
You can install the this free app from play-store to test the GPS of your phone : "TestYourGPS".
https://play.google.com/store/apps/details?id=com.eorsavik.testyourgps

Android Fused Location provider gets lost

I've been testing android's new Location API's for a few weeks. In general they work quite well, however, the new Location provider frequently loses the plot.
Specifically, I wire up an example based on the receive location updates example. It works correctly, and the location updates are received as expected.
The problem seems to be with the Fused provider itself. In some areas (notably around my home) it completely gets lost. It will suddenly think I am kilometers away from where I am. Around where I work (which is a more built up area) it is much more accurate and always reasonably close to where I actually am (in Balanced mode).
I have made many attempts to fix this, including switching to PRIORITY_HIGH_ACCURACY when I suspect it is in error, or using the older LocationManager to try get a GPS fix to establish where I really am. But nothing seems to help too much. I suspect Google has bad data on where certain mobile towers of WiFi hotspots are around my home, and when it connects to certain towers is suddenly jumps a few km from the true location. It's very annoying and will interfere with the Geofence API also. Any advice on how I can fix this?
Can you just ignore the location updates that are inaccurate? This code was released at Google IO 2013 I think, so it might still have some bugs.
(I am experiencing the same thing as you. Rural area, the Fused Location provider is giving me locations all over the place)
There is bad data about some WIFI APs from time to time, and these tend to fix themselves after a while. A clue to what's happening to you can be found in the accuracy returned. If when it goes to the wrong place, the accuracy is a large number (hundreds of meters), that implies the fused location provider is using a cell location. It may mean there aren't a lot of APs where you live, and that you can only get a wifi location once in a while (or once in a while you can't get a wifi location). The FLP should get better at avoiding these jumps over time as algorithms improve.
If the bad location you get has a small accuracy (around 30 meters), that implies it's a wifi location, and bad AP database information probably explains the issue.

GPS Location without service

I am a new developer and have a simple question that I have searched all over for, but have not found a clear answer yet...
Simply put, I am developing an application that needs to be able to use GPS. The trick is however that I would like to use GPS to get a phone's location even if they have no carrier service.
With that said I have 2 questions.
Is is possible to get the GPS location of a phone with no carrier service with a wifi connection?
Is is possible to get the GPS location of a phone with no carrier service AND no wifi service?
Thanks in advance
Yes, it is on many handsets. The WiFi network may be mapped which will speed up the AGPS chip, or allow offloading of position calculation to the provider.
Varies by the GPS chip in question. In some cases, it will simply not work (the GPS processor requires network communication). In most cases the GPS will take up to 10 minutes to fix from a cold start, as it must receive the current satellite almanac in order to compute position.
While it it true that AGPS is dependent on some kind of data communication most Android phones have true GPS chipsets which means that they communicate with satellites in space regardless of any data connection. This will provide a more accurate position, but will be slower to acquire. Your best bet is to listen for position updates from both Network and GPS providers so that phones with a data connection will get a fast, rough fix that can be refined by the GPS and phones that don't have a data connection will simply not raise an event until the GPS gets a fix. If you want to be extremely robust then don't block waiting on the fix so the user can at least continue to use your app instead of staring at a spinning icon.

Categories

Resources