Page 1 of 3

Geolocation not working on phone

Posted: Fri Jul 12, 2013 10:01 am
by Manuel Menéndez Román

Hello,
I have a page that geolocates the user and prints its coordenates. The on success of the geolocation service, it shows a list of items. It works via web on chrome, explorer, firefox and safari, but when I export the .apk to my phone, it doesn't work.

This is a screen capture of the page on any web browser:
Image

On my android phone the coordinates are empty and the geolocation service is never invoked successfully so the list is not shown.

The permissions I've set in my app settings include:
ACCESS_COARSE_LOCATION
ACCESS_FINE_LOCATION
ACCESS_LOCATION_EXTRA_COMMANDS

What can be wrong?
Thanks


Geolocation not working on phone

Posted: Fri Jul 12, 2013 10:41 am
by Kateryna Grynko

Hi Manuel,

There are several ways to get coordinates of the user's position.

Those that run on a desktop browser usually do not work on mobile devices and vice versa.

If your application is running on the desktop browser then you are not using Device Service Geolocation.

To read more: http://docs.appery.io/tutorials/build...


Geolocation not working on phone

Posted: Fri Jul 12, 2013 11:07 am
by Manuel Menéndez Román

Hi,
I think I'm doing just as the tutorial.

This is my device service:
Image

This is the mapping:
Image

And here I invoke it:
Image


Geolocation not working on phone

Posted: Fri Jul 12, 2013 12:03 pm
by Kateryna Grynko

Hi Manuel,

Please try using Page Show event and let us know about the result.


Geolocation not working on phone

Posted: Fri Jul 12, 2013 1:01 pm
by Manuel Menéndez Román

I already tried that and it doesn't work. I've also set an event on fail for the geolocation service, to send an alert, and it is in fact failing:

Image

Image


Geolocation not working on phone

Posted: Fri Jul 12, 2013 1:27 pm
by Kateryna Grynko

Is location enabled on your device?


Geolocation not working on phone

Posted: Fri Jul 12, 2013 1:38 pm
by Manuel Menéndez Román

That was it. I should have know from the beggining. But other apps request to enable location when needed. How can I do this from my app?

Thanks


Geolocation not working on phone

Posted: Fri Jul 12, 2013 3:41 pm
by Manuel Menéndez Román

Wait, testing on another device I get the error even when location is enabled:
Image


Geolocation not working on phone

Posted: Fri Jul 12, 2013 8:46 pm
by Illya Stepanov

Hi Manuel, have you any error messages in console (logcat)?


Geolocation not working on phone

Posted: Tue Mar 11, 2014 7:02 pm
by Luca

I have same problem!

Any support please?

Thanks