Page 1 of 1
Saving GPS latitude and longitude on localstorage not working on Android Devices.
Posted: Wed Mar 18, 2015 7:05 pm
by Josiel Denardi6690187
I have been building a new project where I need the GPS latitude and longitude to be stored on the localstorage so I can retrieve it later, I have tested it on an iPad and on the browser, it all works fine, only on android phones it's not working, it isn't storing anything at the localstorage. The weird part is that I have another project with same functionality and it works perfectly fine, same code and all. I even tried cloning the former project and it didn't work. Is there anything to do with Appery itself? Maybe the code generator got updated and has a bug within it?
Thanks in advance.
Saving GPS latitude and longitude on localstorage not working on Android Devices.
Posted: Wed Mar 18, 2015 9:26 pm
by Bruce Stuart
Josiel,
Sounds like a bit of a baffling issue - and I'm not sure if the questions I might ask - are either helpful or not...
First thought - In your project - Android permissions settings - do you have the Access_coarse_location, fine, location extra and potentially the mock location set (clicked) ??
Just a thought....
have a great Wednesday...
Bruce
Saving GPS latitude and longitude on localstorage not working on Android Devices.
Posted: Fri Mar 20, 2015 6:38 pm
by Josiel Denardi6690187
I have only FINE_LOCATION, NETWORK_STATE, INTERNET, and WAKE_LOCK. Should I have those you mentioned checked? Because in my other application I haven't aswell.
Thanks and have a nice day.
Saving GPS latitude and longitude on localstorage not working on Android Devices.
Posted: Fri Mar 20, 2015 7:20 pm
by Bruce Stuart
Only an option to try ... Not necessarily a prescription for success from my perspective.
In terms of debugging ... You've tried inserting an alert after your geolocation call to see what comes back ... To ensure this isn't some sort of timing issue ? Also ... You'rve obviously checked the type of the local storage values being saved ... Numeric to numeric for example ? Some platforms deliver results back in different types ... And may cause data type errors when trying to save them ...
Just food for thought ...
Saving GPS latitude and longitude on localstorage not working on Android Devices.
Posted: Fri Mar 20, 2015 7:23 pm
by Bruce Stuart
Along that line if you're storing the location to local storage as character ... Force it to character using toString or if numeric force it to numeric using Numeric function ? Just a few more thoughts ...
Saving GPS latitude and longitude on localstorage not working on Android Devices.
Posted: Fri Mar 20, 2015 8:03 pm
by Josiel Denardi6690187
It returns null on android phones, and I've tried to work around timing issues by waiting for the service to give a "complete" status.
Saving GPS latitude and longitude on localstorage not working on Android Devices.
Posted: Sun Mar 22, 2015 12:55 pm
by Egor Kotov6832188
Hello Josiel,
Could you :
1) send us screeshots of how do yo save GSP values to LSV
2) which event triggers GPS ?
3) Which options selected in GPS settings
Saving GPS latitude and longitude on localstorage not working on Android Devices.
Posted: Mon Mar 23, 2015 2:30 pm
by Josiel Denardi6690187
Hello Egor,
I'm saving the values to localstorage through the drag 'n drop functionality of the services, just like I do with every one.
The GPS service is triggered by page loads and button clicks, and lastly it's: maximumAge 3000, timeout 5000, enableHighAccuracy True, and watchPosition False if that's what you mean.
Saving GPS latitude and longitude on localstorage not working on Android Devices.
Posted: Wed Mar 25, 2015 5:28 am
by Yurii Orishchuk
Hi Josiel,
Please use "timeout: 1080000" cause of GPS receiver have some delay before receives coordinates. Please read more about GPS almanac and why you need such timeout here: http://en.wikipedia.org/wiki/GPS_sign...
Regards.