I'm facing a really annoying problem. In some point of the program, I
need to track the user position. For that I register a listener for
all the providers available and request updates. This was working
really good until I updated my phone to Android 4.0. But the same code
is working perfectly in older versions.
Now, the listener is not being called. But only under some conditions:
if i have gps coordinates, this works perfectly ok, even if the gps
coordinates are lost, I get also network
but if there is no gps coordinates and there is no wifi signal (but
the wifi on the phone is enable), I should be able to get the
coordinates using the 3g. Here is were it's not working. If I debug, I
can see how the listener is being registered but it is never called.
Please, help!!!!
Don't know whether you have gone through this.
If not, it would be useful for you.
Do you have a sim card in the device? I found this resolved the issue for me.
Incidentally, I found that after I upgraded my Galaxy Nexus to Android 4.x (specifically, 4.2.2) weird things started happening with my device. Perhaps this there are some bugs in the updates?
Related
We have a ReactNative app, running on both iOS and Android.
We developed our own native module for GPS updates.
On iOS, it's working OK !
On Android, we're using FusedLocationProviderClient.
My problem: in some very rare cases on android, less than a few % of our GPS data, we see GPS data with correct latitude, but longitude keeps jumping around the real one (e.g. this seems to happen on some Samsung S9+)
See this screenshot
This bug only last a few minutes, then seems to resolve on its own...
Has anyone encoutered this bug too ?
If so, how did you fix it ?
(note: I can add code samples if you think it can help, but I'm having big difficulties reproducing this bug myself, so I doubt it's useful in this case...)
GPS takes awhile to lock, and depending on the phone, it can take quite awhile and be unreliable. The best thing you can do is check the accuracy that is reported, and also live poll the user's location when they open a relevant activity so by the time you need the location, it most likely has an accurate lock.
Also if needed, ask the user to apply their highest location accuracy settings. Details on how to do this can be found here
GPS takes some time to latch, and there should be at least 3 satellites to be able to latch for the device, if the user is indoor, it is nearly impossible to latch.
You will have to check for the accuracy, on testing I have found that if accuracy value becomes 2.9 (may be different on different devices, but till now I haven't seen) then your device location is set.
Or give some time to devise and record coordinates when you think it's feasible depending upon accuracy.
Hope this may help you...
I am trying to connect a device with phone via bluetooth by calling following two function for the service. First one "mBluetoothGatt.getService(uuid)" and "BluetoothGattCharacteristic.getCharacteristic(UUID)".
Problem is sometimes one of the service returns null. Sometime back it was working correctly, but now its not working at all.
But it works when i restart the bluetooth of the phone. After sometime (5-6 mins) it again stops working.
Please help, on what steps to follows to debug further for getting it work.
Thanks in Advance.
Test using a second device. It is very possible that there might an issue with your current device.
You said you're checking multiple devices, are you also checking on multiple software versions. From what I have found a lot of android 4.4.X have this issue. From what I have found there is no push to the latest version that fixes the issue. This is a resolution that worked for some people.
This is a strange issue which mostly appears on Samsung devices but I cannot confirm its only on Samsung.
My app won't get or update to the correct location fix. It listens to GPS, network and cell providers but the location fix I get is still outdated and inaccurate sometimes the fix is like a day earlier.
I thought it might be a bug in my code but then I opened other apps (Yelp, etc...) and they also have the same problem.
I then open Google Maps and the location is perfectly accurate and up-to-date.
Is this an Android platform bug? Do Maps use a different internal location source provider? Has anyone dealt with this issue before and can provide a solution?
I ran into the same issue.
It is an Android platform bug and it seems that this is an open issue that Google knows about:
https://code.google.com/p/android/issues/detail?id=57707
It is randomly happening.
Google maps is working because their location is based on Google services (Fused Location) which you can also use.
But they also have a bug with the january 2014 update: if you are outside and request a fastest location update rate (e.g. every second) and you are connected to the both network and gps receiver, you will receive a new location only at around 10 seconds even if gps is connected.
They ruined my app which used to work fine with this update and still not fixed to this day!
So what you can do is wait for the fix or use google location service fused location if it fits for you!
Go to settings>wifi>advanced and turn off ALWAYS ALLOW SCANNING
I know it sounds weird. It happens that those Locating APIs regarding WiFi/celluar assistance are disabled in most Android handsets in China. That is, I could hear the callbacks of GPS_PROVIDER when I was out of the building. But if I was in the building, I would never hear the callbacks of NETWORK_PROVIDER. As a result, my app won't be able to locate if put indoor. (I did some experiments with handsets shipped from the states. My app located perfectly well with the NETWORK_PROVIDER if put indoor.)
My guess is that those Chinese Android handsets have sort of castrated the Android OS so that any API related to WiFi/celluar assistance locating has been removed.
But my app still needs to locate. A city-level accuracy will do.
So my question is, is there any possible solution for my situation. Right now I'm considering:
IP address reverse-lookup. But the accuracy is far worse than city-level.
Let my app collect any necessary information (such as router MAC address, celluar tower info) and send them to a third-party server. That server would locate and send back location info to me.
Find (magically) a third-party SDK and hopefully that SDK would do the trick.
Thanks in advance!
IP lookup is fine. You can also try skyhook wireless's location SDK: here
iOS in the early days are using them, and they are actually better/more accurate than Google's location service.
It is definetly possible. You look at the services of Imere's ULaP.
I have some trobule using Google Maps API on Android.
In onLocationChanged() I create an overlay and add it to the MapView, which works fine on the emulator using Android 2.1, but when I try to debug on a device, nothing happens. What could be the problem?
The device is Sony Ericsson Xperia Arc with Android 2.3.
Thanks, Ivan.
Real devices does not always get GPS signals, especially indoors. I guess you should use NetworkProvider in your listener if GPS is not available.
This is a good reference
http://android-developers.blogspot.com/2011/06/deep-dive-into-location.html
Wait for the device get the fix, sometimes the GPS needs more time than usual.