Geolocation API problem on Android

// Expert user has replied.
l leo fake 3 years 6 months ago
21 1 0

Hi everyone,

We are a twelve-student team working on a Rhomobile suite project that uses the Geolocation API (the Ajax asynchronous one).
We have already compiled it for iOs with a Mac and converted the project to XCode (rake build:iphone:setup_xcode_project). On this device, the geolocation is working perfectly.
The problem is that it doesn't work at all on an Android mobile-phone with the same parameters...
We added the capabilities to the build.yml (-gps), added the mapping: yes to the same file, enabled the Geolocation on the phone but the app never asked to used the geolocation! Even if we have a message while installing the app preventing that the app will use these features.

It's actually in debug mode. We tried it on several versions of Android. We tried compiling the app with Android SDK API 19 and API 22. We use the NDK 9 (as recommanded on the documentation).

We don't know what to add/change in order to make it work for Android...

Thank you in advance for your help

The team

Please Register or Login to post a reply

1 Replies

P Pietro Francesco Maggi

Hi Leo,
if you're using the HTML5 Geolocation API, then you may have problems on Android devices using version of Android lower than  v4.3. This because RhoMobile uses the system browser to run your application and Android introduced support of the Geolocation API in v4.3:
http://caniuse.com/#search=geolocation

If you need to support older Android version you can use RhoMobile GeoLocation API:
Rhomobile | Geolocation API

This is available in Ruby and JavaScript and supports both iOS and Android.

Ciao
~Pietro

CONTACT
Can’t find what you’re looking for?