Josiel Denardi6690187
Posts: 0
Joined: Mon Feb 24, 2014 9:23 pm

Saving GPS latitude and longitude on localstorage not working on Android Devices.

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.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Saving GPS latitude and longitude on localstorage not working on Android Devices.

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

Josiel Denardi6690187
Posts: 0
Joined: Mon Feb 24, 2014 9:23 pm

Saving GPS latitude and longitude on localstorage not working on Android Devices.

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.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Saving GPS latitude and longitude on localstorage not working on Android Devices.

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 ...

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Saving GPS latitude and longitude on localstorage not working on Android Devices.

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 ...

Josiel Denardi6690187
Posts: 0
Joined: Mon Feb 24, 2014 9:23 pm

Saving GPS latitude and longitude on localstorage not working on Android Devices.

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.

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

Saving GPS latitude and longitude on localstorage not working on Android Devices.

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

Josiel Denardi6690187
Posts: 0
Joined: Mon Feb 24, 2014 9:23 pm

Saving GPS latitude and longitude on localstorage not working on Android Devices.

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.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Saving GPS latitude and longitude on localstorage not working on Android Devices.

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.

Return to “Issues”