Fix for geolocation on Android/Intel xdk? [fixed]

Discussion and feedback on Construct 2

Post » Tue Jun 07, 2016 12:52 am

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?

Thanks

[Edit]

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:

Intel XDK:
- 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)

'geolocation plugin:
- 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"

C2:
- 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.
Last edited by hmott on Sat Jun 11, 2016 2:09 pm, edited 1 time in total.
B
17
S
2
Posts: 88
Reputation: 1,503

Post » Tue Jun 07, 2016 1:03 pm

Hello, can you shoot me a tip to get mine working? I an running the demo out of the templates and cant get geo to work. Says needs app permissions. I checked the box in C2, is there one I need to check in Intel XDK? If I can get mine working maybe I can help you with your bug. thanks.
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Tue Jun 07, 2016 2:05 pm

On your phone go to settings > apps > (your app) > permissions.
B
17
S
2
Posts: 88
Reputation: 1,503

Post » Tue Jun 07, 2016 2:26 pm

Got it working thx, needed Geoloco in Intel XDK. Im running the template and only issue i see is that it dosesnt stop watching.
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Tue Jun 07, 2016 2:55 pm

In c2 you have to "get location". Then use the same trigger.
B
17
S
2
Posts: 88
Reputation: 1,503


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests