Android GPS is not updating location at high altitude inside aircraft - android

I am building an application for Android devices for skydivers to log location data during a skydive.
I have set the app up to record the device GPS location every 5 seconds in a foreground service. It seems to be working fine until the user is inside an aircraft, at which point the location may no longer update, or update very infrequently. Location updates will resume when the user has deployed their parachute.
The aircraft is a Cessna Grand Caravan
I can't work out why this may be the case? Could this be something to do with the altitude making the GPS sensor ineffective? Or maybe to do with being inside an aircraft? The location tracking works absolutely fine at ground level such as when tracking a route in a car.
I am collecting location updates the same way as in the Android documentation, available here:
https://developer.android.com/training/location/request-updates
Any help would be greatly appreciated

Related

Monitoring android GPS location

I am building an app that will monitor where a user is using GPS and alert him if he is within a certain distance of a particular place. I would provide the app with a list of the places and their latitude and longitude and the app would check against this list. Once the user has launched the app to start the location monitoring process, then most of the time he does not need to know anything about it and will be using other apps, making phone calls, or whatever. A user interface will only be displayed when the app finds a match with a location in the list.
I guess that this means that the location monitoring should run in background mode, but I am fairly new to android and I don't really understand about background processes or about location monitoring. Can anyone point me to a good tutorial or information?
to building this app that will monitor where a user is using GPS and alert him if he is within a certain distance, you will using service in background and using gps to get altitude and longitude and you will using a function to calculate a distance bitween a user location giving by gps and others location in the list and you can also start your Service on Boot Automatically.
good luck.

Google FusedProvider does not call onLocationChanged() in an environment without GPS

My app works fine if the area has GPS (such as outside) or in houses/first or second floor buildings but it does not receive a location update if the area is something like the 4th-10th floor of a tall building, is this expected behavior or is this a limitation of location services?
Even with an internet connection on a high floor it still does not receive an update, this makes me believe that it is not falling back to Wi-Fi/mobile networks but I tried setting my Location method to Wi-Fi/Mobile only in the Android settings but it still works in normal environments.
Can anyone give me advice on what is happening? Do location services simply not work at higher altitudes or certain areas with very poor reception? I have not tested it in underground parking areas though.
I am using PRIORITY_HIGH_ACCURACY as my priority.
I am using PRIORITY_HIGH_ACCURACY as my priority.
That's the reason you are not getting Location change inside a building. Because HIGH_ACCURACY gets location from GPS provider. As we know GPS doesn't work well inside houses as it collects location from satellite.
You can try out other options.
PRIORITY_BALANCED_POWER_ACCURACY (About 100 meter)
PRIORITY_LOW_POWER (About 10km)
PRIORITY_NO_POWER (Act as a passive listener )
You may visit here if you havn't yet. Hope this helps.

Tracker GPS App - Android

I would create an app with the following features:
The App should be listening to the movement of the accelerometer in the background if the cell move continuously, the app should trigger the GPS system and send every 30 seconds some data to a server such as:
IMEI
Date and time
Latitude
Longitude
Speed
Battery voltage
among others...
I am a beginner, I tried to build it but I did not have success ... Below my code, please help me:
https://drive.google.com/file/d/0BxfW2TCNVyLQNmF1Z1FGeHB0WmM/view?usp=sharing
Try to use Google Play services for location. Checkout these guidelines, you can set time to get location, when location is changed so on and so forth depending upon your requirement.

Fused location API gives highly inaccurate location after closing google maps

Our application uses Google Fused location API to receive location updates every 3 minutes.
The location request settings are as follows –
Interval – 3min
Fastest interval – 1 min
Priority - PRIORITY_BALANCED_POWER_ACCURACY
In a normal running scenario, the location updates are received properly and the location accuracy is pretty good (around 20-25 m).
When the Maps application is opened, it received GPS location, and therefore our application also starts receiving location updates, which are basically from the GPS transceiver (I know this as the subsequent location updates have a speed and altitude value as well).
Problem occurs when the Maps application is now closed. Our application receives location updates, but the location coordinates do not change and every subsequent update received has a higher accuracy value. The updates may go up to even 1000m of accuracy and no accurate location are received. Opening the maps application again will make our application receive accurate and updated locations once again.
This problem can also be device specific as I saw this problem on a Motorola Moto G and not on my other Samsung or Karbonn phones.
In my experience, setting the priority to PRIORITY_BALANCED_POWER_ACCURACY never gets positions from the GPS, unless other app is using it. That's the same behaviour that you are finding in your app (in your case you only get GPS positioning when Maps is open), and that seems to be the general behaviour (see Does PRIORITY_BALANCED_POWER_ACCURACY exclude the GPS provider?).
I haven't found any official documentation to background this so I think that it may be device-dependant. In my tests, whenever I need GPS positioning I need to change the priority to PRIORITY_HIGH_ACCURACY.
Anyway, there is a known issue (57707) that is showing in some devices that causes the location provider to stop receiving position updates when set in PRIORITY_BALANCED_POWER_ACCURACY until the device is restarted.

Getting GPS co-ordinates quicker programmatically without internet, but using network provider and mobile GPS

I have referred many questions on this topic, but it seems some of my requirements are missing:
I want to get the GPS location at ~0.0001 accuracy
Don't want to use internet; Though GSM/CDMA network is ok
Should be obtained programmatically when the app starts
Should be quicker, say within a minute (like iPhone, which probably works in Airplane mode as well!)
The code should work in most of the devices
The phone may switch-on/off anytime and travel any distance
Is there any way to get just the co-ordinates with above mentioned requirements? Any sample code snippet will be much appreciated.
Checking various apps like "Locate Me", "Maverick", which claim to show offline locations. But in various scenarios without internet, they don't give track the location (in India).
I have referred plenty of old/new questions inside/outside SO. Below are few:
Is it possible to have the gps location while offline with the nexus
7?
Does GPS require
Internet?
How to get current exact location in android without internet
connection?
[Note: I am asking this question on behalf of my Android team and will be happy to clarify the details if asked for. Should you feel that this post belongs to Android.Stackexchange, then kindly move it.]
1. I want to get the GPS location at ~0.0001 accuracy
You can listen only to GPS provider and discard a location when it doesn't have the minimun accuracy you want:
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 5, myLocationListener); // "myLocationListener" must be an object from a class that implements LocationListener
// "myLocationListener" implementation of LocationListener.onLocationChanged
public void onLocationChanged(Location location)
{
int MIN_ACCURACY = 5; // in metters
if ((!location.hasAccuracy()) || (location.getAccuracy() > MIN_ACCURACY))
{
// discard this location and keep listening to new location readings
}
else
{
// that's a good reading!
// do somethings you want... blah, blah, blah...
// stop updates when you get the location to preserve users' battery.
locationManager.removeUpdates(myLocationListener);
}
}
2. Don't want to use internet; Though GSM/CDMA network is ok
Yes, GPS works totally off-line. Android can make use of internet ONLY to update A-GPS data cache and provide faster reads in cold-start updates.
3. Should be obtained programmatically when the app starts
Then call item locationManager.requestLocationUpdates on mainActivity's onCreate event.
4. Should be quicker, say within a minute (like iPhone, which probably
works in Airplane mode as well!)
Keep in mind that iPhone works with "high quality hardware". Android can be run on crappy devices. So it'll depend of:
The device's hardware quality;
The number of satellites that are visible in the sky at that moment;
The age of almanac and ephemeris data on gps cache;
GPS can fail to read satellites because user is inside a building or something.
5. The code should work in most of the devices
What is the oldest Android's API you want it to run?
6. The phone may switch-on/off anytime and travel any distance
I didn't get it. What is your concern about this?
------------------------------------------------------------------------------
Update 1:
"...I would like to use Android 4.0 and above..."
I've tested GPS features from Android 2.3 to 5.0 devices. Everything runs pretty fine on all of them.
"...I have observed that 1 geo-coordinates based demo app which was working in other devices, din't work in my LGG3 with Android 5.0. Any idea on that?..."
Did you check GPS permissions on Android settings? (Maybe it's disabled) Or can be a hardware issue? Did you try in another similar device?
"...Suppose the GPS is showing correct location in New York,
I switch off the phone and then switch on after reaching to London,
then will it still show correct location (without internet)?..."
Sounds you're confusing things: reading a GPS location is one thing. Showing that location into a MAP is another different thing!
You don't need to be connected to the internet to do GPS location reading. But, if you want to show that location into a MAP, probably you're gonna need internet (to load map resources, etc.).
If you nedd to stay collecting GPS locations periodically (let's say, from 10 to 10 minutes), then it will be better to use AlarmManager to schedule a timer that will "finger" your app and say "hey, time to make a GPS reading!".
"...Also what is your opinion about the latest Fused API?..."
I've tested it and used it for a while, but I gave it up. It needs that Google Play Services be installed to work (not a problem, most users have it on their devices). But if you need ACCURACY (as I do), it will not work. It uses "fused sensors" (accelerometer, gps, wifi, compass, etc...) to try to get user location with minimum power possibile. Sometimes, it says you're 10 miles away from where you're really is. I couldn't make it work fine to keep the "path" where user has been. But it really saves battery.
Suggestion is to use Google Location Services
It takes the best possible and accurate location as accurate as it can at current moment. It automatically (with configuration of course) takes best current accuracy too - whatever is available GPS, network, internet, GSM/CDMA/LTE... It also cashes last known location so, basically, you know it every moment - the best what you can.
Of course you have to realize that each service provides its own accuracy and in it's own time. Look, for example, GPS Test App on Android and see how accuracy increases with time and used satellites.
Also Location Services is good for you because it simply provides coordinates - just as you asked and hides a lot of work to determine what real service to use based on time and accuracy. However, of course, if none of the services on your particular device and location can give you required accuracy then there is no way to get it. That's why services also provide accuracy measurement.
Here is another link
Use fused location API provided by Android SDK.Implement fused location in a Service and call it in your application MainActivity.

Categories

Resources