Hi everybody!
I’m using location on android but when i put the EventListener it was spend a lot of time to determinate coordinates on Device.
I tried the same app on iOs and work perfectly…
Is there any way to reduce this time??
thanks
Hi everybody!
I’m using location on android but when i put the EventListener it was spend a lot of time to determinate coordinates on Device.
I tried the same app on iOs and work perfectly…
Is there any way to reduce this time??
thanks
I noticed that this thing depends on the internet connection …
But the strange thing is that it works on ios me to fly …
Hi @maucel89,
Did you include the following permission in your build.settings file? It allows Android to utilize GPS to determine the location (assuming the device can) instead of relying on just internet.
[lua]“android.permission.ACCESS_FINE_LOCATION”
[/lua]
Take care,
Brent
yes i did… and that’s the strange thing!!
i tried with two android device wifi connected and the delay is very long…
in htc one with 4G it works…
i also tried to comment “android.permission.ACCESS_COARSE_LOCATION” to force the fine location but it doesn’t work…
Interesting observation. Do the two Android wifi connected devices have GPS in them? Where there is no GPS in the device I believe OS relies on the wifi details to get a close enough location hit. This might be a slower process compared to a real GPS hit. Just speculating here but its an idea…
maybe what your are thinking is correct!
but what will be the solution?
To confirm if this is indeed the issue, can you bring that HTC 4G device into the same room, turn off 4G and see if the duration changes? Not sure if its possible to switch off the GPS but this could be an interesting test. Quite frankly if the lack of built in GPS is the issue I don’t know if anything could be done to help with this.
Yes the duration changes… I don’t know why in ios it works fine…
Some Android devices are slower at acquiring a lock with the GPS satellites than others. As in they can take a few minutes to acquire a lock with a GPS satellite. In fact, some devices can’t even get a lock while you’re indoors while others can, perhaps due to the sensitivity of the GPS sensor on the device. I find that if you go outside, you’ll acquire a lock much faster. I believe the iOS platform cheats a bit by caching current location (or perhaps the GPS is always on), but on Android the GPS is literally off unless you see its icon in the status bar.
First, have a look at the documentation here…
http://docs.coronalabs.com/api/event/location/index.html
There are 2 Android permissions for acquiring current location.
The “android.permission.ACCESS_FINE_LOCATION” is used to acquire current location via GPS satellite, which is the slowest means of acquiring location, but once you have a lock on the GPS satellite you’ll then get regular updates.
The “android.permission.ACCESS_COARSE_LOCATION” is used to acquire current location from WiFi and/or the cellular service. This is the fastest means of acquiring location, which I find usually acquires your current location within seconds.
I recommend that you add both of the above permissions to your app’s “build.settings” file. Have a look at sample project “Hardware/GPS” that is included with the Corona Simulator for a quick example.
Other than that, this is as good as it gets on Android.
I noticed that this thing depends on the internet connection …
But the strange thing is that it works on ios me to fly …
Hi @maucel89,
Did you include the following permission in your build.settings file? It allows Android to utilize GPS to determine the location (assuming the device can) instead of relying on just internet.
[lua]“android.permission.ACCESS_FINE_LOCATION”
[/lua]
Take care,
Brent
yes i did… and that’s the strange thing!!
i tried with two android device wifi connected and the delay is very long…
in htc one with 4G it works…
i also tried to comment “android.permission.ACCESS_COARSE_LOCATION” to force the fine location but it doesn’t work…
Interesting observation. Do the two Android wifi connected devices have GPS in them? Where there is no GPS in the device I believe OS relies on the wifi details to get a close enough location hit. This might be a slower process compared to a real GPS hit. Just speculating here but its an idea…
maybe what your are thinking is correct!
but what will be the solution?
To confirm if this is indeed the issue, can you bring that HTC 4G device into the same room, turn off 4G and see if the duration changes? Not sure if its possible to switch off the GPS but this could be an interesting test. Quite frankly if the lack of built in GPS is the issue I don’t know if anything could be done to help with this.
Yes the duration changes… I don’t know why in ios it works fine…
Some Android devices are slower at acquiring a lock with the GPS satellites than others. As in they can take a few minutes to acquire a lock with a GPS satellite. In fact, some devices can’t even get a lock while you’re indoors while others can, perhaps due to the sensitivity of the GPS sensor on the device. I find that if you go outside, you’ll acquire a lock much faster. I believe the iOS platform cheats a bit by caching current location (or perhaps the GPS is always on), but on Android the GPS is literally off unless you see its icon in the status bar.
First, have a look at the documentation here…
http://docs.coronalabs.com/api/event/location/index.html
There are 2 Android permissions for acquiring current location.
The “android.permission.ACCESS_FINE_LOCATION” is used to acquire current location via GPS satellite, which is the slowest means of acquiring location, but once you have a lock on the GPS satellite you’ll then get regular updates.
The “android.permission.ACCESS_COARSE_LOCATION” is used to acquire current location from WiFi and/or the cellular service. This is the fastest means of acquiring location, which I find usually acquires your current location within seconds.
I recommend that you add both of the above permissions to your app’s “build.settings” file. Have a look at sample project “Hardware/GPS” that is included with the Corona Simulator for a quick example.
Other than that, this is as good as it gets on Android.