peterj
Apple Fan
Profile
Posts: 113
Reg: Jun 19, 2011
location unknow...
6,630
04/10/14 05:38 AM (10 years ago)

Android 3.0 tracking location even when disabled in config?

I have an Android 3.0 app with the "Start Tracking Location" set to "No, do not start GPS on launch", but one of my users says on his phone, the GPS indicator comes on when he launches my app. I don't think the iOS version of my app turns on location tracking when I start the app. I don't need location tracking in this app at all, so I'm fine actually commenting out the code where it would come on. I looked at code in BT_Activity_Host.java, but there's a lot of code about location. Is this an issue for anyone else? Is there a way in the java code to disable location tracking?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/10/14 07:18 AM (10 years ago)
I could be wrong, but I kinda think that control panel setting only affects the 'location awareness' of the BT Project, not the device. The setting in your app json is 'startLocationUpdates', and if you do a search on the code, it basically just turns on (or ignores) location updates, purportedly from the device. But it doesn't 'directly' alter device settings; have your user go into their device settings for the 'Global' setting. Hope that clears things up a bit. Cheers! -- Smug
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/10/14 08:35 AM (10 years ago)
You can also comment out these lines in your AndroidManifest.xml file, and it'll prevent GPS from being used: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> Mark
 
peterj
Apple Fan
Profile
Posts: 113
Reg: Jun 19, 2011
location unknow...
6,630
like
04/11/14 06:16 AM (10 years ago)
Thanks for the responses. I tried commenting out those two lines, and my tester (running a Samsung Galaxy Note 4) says my app is still tracking him. SmugWimp you might be right, but the comments and the "if" loop in BT_Activity_Host indicate otherwise: ======== Location Manager Logic (turn on GPS?) ------------------------------------- Should this device report it's location? The device will turn on it's GPS and begin tracking it's location if three things are true: 1) The application's configuration data is set to "startLocationUpdates" 2) The user has not turned on "allow location tracking" in a BT_screen_settingsLocation 3) The device is capable of tracking it's location (has GPS) ======== For me, #1 is not true. So right there it should jump to the end of the loop, and it appears to. When I launch the app in my emulator, it has the right message in LogCat, "Start GPS is set to 'No', not starting GPS". So the code appears to be working correctly. Now, my LogCat does show something else interesting, not sure if it's related. When the app checks lastModified with reportToCloudURL during startup, that big long URL has "device latitude" and "device longitude" in it. Is there a correlation?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/11/14 03:01 PM (10 years ago)
Not for Last Mod/Report Cloud. Typically that data (aka a 'merge field') is going to be used for your control panels app usage statistics. Cheers! -- Smug
 
peterj
Apple Fan
Profile
Posts: 113
Reg: Jun 19, 2011
location unknow...
6,630
like
05/13/14 01:24 PM (10 years ago)
Still stuck on this one...not sure what to do. I see a link on my app's page in the BT control panel called "show usage map", where I imagine a pin would appear on a map that shows the location of the user. I have start location updates off, and I've confirmed this in the config file. Still, the phone shows the GPS icon, indicating that it's being activated, when my app is started. Now, no pins appear on my map, which is what I'd expect because I set GPS not to start, but I can't figure out why the device shows the icon that GPS is being used when my app starts. I'm going to see if there's a way to comment out any any and all location code so that the GPS stays quiet.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.