mobileSensorAvailable

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
paulsr
Posts: 222
Joined: Thu Jul 19, 2012 9:47 am
Contact:

mobileSensorAvailable

Post by paulsr » Sun Feb 23, 2014 11:54 am

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

ChrisMukrow
Posts: 73
Joined: Mon Nov 12, 2012 4:13 pm

Re: mobileSensorAvailable

Post by ChrisMukrow » Sun Feb 23, 2014 8:36 pm

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

paulsr
Posts: 222
Joined: Thu Jul 19, 2012 9:47 am
Contact:

Re: mobileSensorAvailable

Post by paulsr » Mon Feb 24, 2014 10:22 am

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

ChrisMukrow
Posts: 73
Joined: Mon Nov 12, 2012 4:13 pm

Re: mobileSensorAvailable

Post by ChrisMukrow » Mon Feb 24, 2014 11:25 am

You can do this in application settings! Standalone --> Android --> Right bottom corner - Application permissions

paulsr
Posts: 222
Joined: Thu Jul 19, 2012 9:47 am
Contact:

Re: mobileSensorAvailable

Post by paulsr » Mon Feb 24, 2014 11:59 am

Thanks Chris,

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

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

--paul

Post Reply