Hi all, I'm trying to get geolocation to work on Android/Intel xdk. When I make changes, and reinstall on my device, it works perfectly at first. Shortly after, the plugin gets stuck trying to get a location. Any way to get it working reliably?
The steps below seem to have fixed the issue. Now the stock geolocation plugin works on my nexus 5x (running official android 'N' beta). Geolocation has become much more intricate with these new phones. It can determine the location from GPS and GLANOS satellites, cell towers, wifi, etc. The location setting can also be modified on the phone to use all sources (high accuracy) or satellites only. With these hardware upgrades, the software still works, with the following method:
- Add the latest geolocation plugin (v2.2.0, this automatically adds an additional 'compat' plugin).
C2 'geolocation' plugin:
- open the plugin folder (Construct 2\exporters\html5\plugins\geolocation)
- in the 'geolocation' folder open the 'edittime' java file (best to do with notepad++, notepad-plus-plus.org)
- look for this line: "rotatable": false, // only used when "type" is "world". Enables an angle property on the object.
- enter this line under it: "cordova-plugins": "org.apache.cordova.geolocation"
- When getting a new location use "High accuracy". I set the timeout to ten seconds.
- During export I don't check "New Intel xdk project format", but I do check the "geolocation" permission.
- I haven't tried the minify script, so I'm not sure if it would have any effect.
It may not all be necessary, but this method made it work for my app on my device.