I have a working code to get the current location using GPS. However it stopped working suddenly. On further debugging using GpsStatusListner, I noticed Satellite count is always 0 (before it used to show upto 8/9 sats).
And other navigation software (google navigator, At&t navigator) none of them are able to get fix on GPS.
Is there a way to reset/reccaliberate the GPS component in my phone? I tried disabling/enabling GPS/Network under Location settings and rebooted the phone multiple times :(
Device: HTC Inspire.
thank you!
Ok many had this problem
Make sure gps is disabled
Go to the market
Download "Fast Reboot"
Run it
Run navigation (when it's done)
It'll ask you to show location settings
Click okay
Enable gps
Open navigation again
it should work
Related
In AOSP there is libhardare library which contains interface to the GPS driver - gps.h. Using this interface you can get access to GPS driver on low level (C++), turn on GPS and get current location of the device.
On the Internet there are several projects, that use this GPS interface. For example, this one created by kanru. This code works almost perfectly - I could connect to GPS driver and get correct location.
But I ran into a problem. If you turn on GPS driver using kanru project and after awhile turn on GPS via standard method (in GUI), then C++ program will suddenly stop receive information from GPS driver. At the same time in GUI you can see that GPS is On and you can start Google Maps or any other GPS-related application and get your coordinates.
I tried to restart GpsInterface, turn off and on GPS driver via hw_device_t pointer, even restart whole C++ executable - no effect.
After restart of the program GPS driver change status to GPS_STATUS_ENGINE_ON and then - silence.
Also I tried to change the order of actions. I turned on GPS in GUI, launched Google Maps and waited several minutes till I got my location. Then I started my C++ program. It successfully connected to GPS driver and started to get location data. Meanwhile GUI "lost" connection with GPS driver.
I tried to test my program on several devices with Android 4.2 and 5.1 and get same problem on the most of them. Only on Samsung S6 with Android 5.1 my program was able to work perfectly under all conditions.
It seems like on some devices GPS driver configured so that it can work with only one data consumer.
Perhaps someone faced a similar problem?
I'm using Google Play Services to get the current location of the user. Basically I use the codes at http://www.androidhive.info/2015/02/android-location-api-using-google-play-services/ to get the location. So herein lies my problem:
1) I can get the current user location on my Xperia Mini (Running ICS) without any problem. If I didn't enable the GPS, the location that I'd receive (expectedly) isn't that accurate, but I will still get it. And if I enable the GPS, I would (again, expectedly) receive a much more accurate location.
2) But when I tried running my app on my Zenfone C (Running KitKat), if I didn't enable location, I would never get any location. getLastLocation and onLocationChanged will always return null. Only after I enable location, I'd get the location. But after I disable location and tried to getLastLocation again, it will again, return null.
The situation that occurs on my Zenfone C puzzles me, because from my understanding, even if we didn't enable location/GPS, we would still be able to get the current location from the mobile network or wifi triangulation, because that's what happening with my Xperia Mini, and I thought that should be the standard for all Android devices? Or is the enable location on/off on some Android devices have some other meaning? Perhaps on some device, when location is turned off, there's no way we can get the location. Can anyone here shed some light on this?
Thanks
There's no way for the device to get new locations once the location mode is set to off, but it's possible that the one device had a cached location from when the location mode was set to on.
Network location (Power saving mode on some Android versions) needs to be enabled to get a location from mobile data or WiFi. Note that if you use the toggle button, it enables/disables both network location and GPS (High Accuracy mode). You can use the sub-modes to enable only one location mode (Power Saving for Network only, or GPS only).
For more info, take a look at the screenshots in this answer.
There are similar posts on this issue. It seems to be related to some devices running ICS and above that after a while (device entering "sleep mode"-if there is one?) there are no location updates from the NETWORK_PROVIDER any more even though Network provider is enabled. The GPS_PROVIDER still works just fine in open air. Have tried to toggle Wifi and such, but the only thing that seems to help is to reboot the device. Must be a solution for this?
I am developing an application of getting current GPS location. For that to get current latitude and longitude.
I opened "Emulator Control"
Noticed a Disabled Send button
And tried a lot but it doesn't Enable. Any way to enable the Send button on the Emulator
Try this,
First of all open Devices and then select your emulator or Devices
. After Send Button will be
will be enabled automatically.
Is there a recognized problem with geolocation via the default browser in Android 2.3.4 Gingerbread?
On an HTC G2 android 2.3.4, the default browser does not appear to use the GPS satellites to determine location. As a result, the location the browser sends to the app is off by a mile or so. Yes, the GPS and wi-fi were both on in the phone. We turned wi-fi off and got the same (bad) result.
Is there some voodoo that can be done to get the default browser in 2.3.4 to do proper geolocation?
On an iPhone 3s geolocation with the very same browser app works perfectly. The following link starts the Gmap4 app (I am the developer) and shows your location on the Google 'Hybrid" map:
http://www.mappingsupport.com/p/gmap4.php?mylocation=on
I believe this is not a browser problem, but a phone specific issue. If you are getting a position off by a mile, for sure the position has been acquired from wifi.
When you start the map, it tries to get the LastKnownLocation, and if it's to old it reverts to wifi position. Now, if you turn wifi off, the position acquiried using wi-fi will remain available as a recent LastKnownLocation and will be used to position the map again.
Until you get a better position from GPS this one will be used.
At least some phones discard the LastKnownLocation when you restart them. You can try it, with wifi off, to see what happens.
Regards.