Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / Geolocation sensors and compass activation

Author
Message
Alfred
17
Years of Service
User Offline
Joined: 22nd Jun 2006
Location: Jalisco, Mexico
Posted: 18th Jul 2013 19:21
Is a special command needed to activate the geolocation and compass sensors? I have AppGameKit beta 15 and the latest player updated from play store. I have tried accessing the latitude and longitude from several android phones (Galaxy ACE with android 2.3, Galaxy S3 with android 4.1, S3 mini and an LG L5) and in all of these it reports that both the latitude and longitude are 0.0000 and that the compass does not exist. I have tried opening the app while google maps is also open to make sure that the gps is on, but no luck.

Any pointers that you can share with me are greatly appreciated. Are these sensors supported on android? Or are they only for PC right now?

Hallowed are the ori.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th Jul 2013 19:52
Given that most PCs don't have GPS or compass, I guess that the Geolocation and Gyrometer commands are for portable devices.

But, the sample code for GetGeolocationExists and GetGyrometerExists doesn't appear to work, via Player anyway, on either my Android phone or my iOS iPad (both of which have both).

On my Android phone, the two apps that I know access the GPS (Google Maps and GPS Test) both have the 'Your Location' permission (which allows precise GPS location) and the Player does not. This is fixable in the AndroidManifest.xml file. But that means building/rebuilding your own player. If I can find the time, I'll see if that works on my Player and then I'll make it available with my v1076 Player.

This might be why the Geolocation commands don't work on Android.

I haven't been able to find someplace that lets you enable/disable the same on a per-app basis (for all apps) on my iPad. But there must be a way to set those permissions when an app is created.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Alfred
17
Years of Service
User Offline
Joined: 22nd Jun 2006
Location: Jalisco, Mexico
Posted: 18th Jul 2013 20:32
I've seen the PC version use a windows sensor dialog that allows sharing of your location, but yeah, so far I know of no PC that comes with a Gyrometer haha.

I agree, I've seen other apps that have their permissions to allow your location to be shared, but the player doesn't. I'll see if I can build the player from beta 108.15 as well, and add those permissions in the manifest.

Seems like a very good reason. If I recall correctly, there is an app in android that allows you to change permissions even after the app is installed. I'll see if that works as well and post my findings. Thanks!

Hallowed are the ori.

Login to post a reply

Server time is: 2024-04-23 18:21:49
Your offset time is: 2024-04-23 18:21:49