Page 1 of 1

mobileSensorAvailable

Posted: Sun Feb 23, 2014 11:54 am
by paulsr
Greetings:

My iOS to Android porting anomalies continue...

(I'm using LC 6.6(dp1))

I have a Motorola Moto G running Android 4.4.2. It has GPS sensors. They are turned on, and seem to be working because Google Maps knows where I am.

I have an app that needs to use the sensors.

In iOS I use get mobileSensorAvailable("location") which returns true. In Android it returns false.

In iOS I follow this with mobileStartTrackingSensor "location", false

In Android, that doesn't seem to do anything.

So, just to test, I tried

Code: Select all

      put mobileSensorAvailable("location") into tLOC
      put mobileSensorAvailable("heading") into tHDG
      put mobileSensorAvailable("accelleration") into tACC
      put mobileSensorAvailable("rotation rate") into tROT
      answer tLOC & tHDG & tACC & tROT
The Android phone returns false true false false
And my iPad retina returns true true false true

All of which means I can't find any way to get location info from the Android phone.

I don't think this is a phone problem because, as I say, it has working GPS sensors, so it must be a code problem.

Could someone kindly point me in the right direction to get location info from an Android phone.

Many tkx...

--paul

Re: mobileSensorAvailable

Posted: Sun Feb 23, 2014 8:36 pm
by ChrisMukrow
Maybe a stupid a question, but do you have selected the right options in the standalone settings (GPS and location)?

http://developer.android.com/guide/topi ... ermissions

Re: mobileSensorAvailable

Posted: Mon Feb 24, 2014 10:22 am
by paulsr
ChrisMukrow wrote:Maybe a stupid a question, but do you have selected the right options in the standalone settings (GPS and location)?

http://developer.android.com/guide/topi ... ermissions
Thanks Chris. It's a very sensible question.

Until now, I didn't know anything about changing things in manifests. I find it a bit bizarre that I can't do this in the Standalone Application Settings.

More learning to do...

--paul

Re: mobileSensorAvailable

Posted: Mon Feb 24, 2014 11:25 am
by ChrisMukrow
You can do this in application settings! Standalone --> Android --> Right bottom corner - Application permissions

Re: mobileSensorAvailable

Posted: Mon Feb 24, 2014 11:59 am
by paulsr
Thanks Chris,

I thought I'd tried every setting imaginable, but I guess not.

"Fine Location" works... well... fine!

--paul