Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18023] Android: Feature Request: To be able to configure the android location update settings to use GPS, NETWORK, or PASSIVE so that we can just configure the updateDistance and time for the location updates

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-01-06T18:12:12.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.0.0
ComponentsAndroid
Labelsn/a
ReporterEduardo Gomez
AssigneeHieu Pham
Created2014-11-11T20:53:47.000+0000
Updated2015-04-09T20:53:52.000+0000

Description

Request Description

While using the Titanium.Geolocation.Android manual mode, only one provider is registered at the time. If the application is facing these scenarios: * If the application isn't getting updates frequently enough, it can adjust its provider settings to provide more updates, or relax its location rules to allow less accurate updates through. * If the application isn't receiving accurate enough updates from one provider, it can add another provider to try to improve results. * If the application is getting sufficiently accurate results from the network provider, it can disable the GPS provider to save power.

Customer's remarks

That would require a lot of additional logic for android only to have it switch between them during the scenarios outlined previously. Would it be possible that we be able to configure the android location update settings to use GPS, NETWORK, or PASSIVE so that we can just configure the updateDistance and time for the location updates. That would bring this into close parity with the iOS implementation.

Titanium Docs

http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Geolocation.Android

Comments

  1. Ingo Muschenetz 2014-12-10

    Related notes: http://developer.android.com/guide/topics/location/strategies.html
  2. Hieu Pham 2014-12-18

       var count = 0;
       var window = Ti.UI.createWindow({backgroundColor: "white"});
       var locationLabel = Ti.UI.createLabel({text: "Location: ", top: 0, color: "red"});
       var countLabel = Ti.UI.createLabel({text: "Count: 0", color: "blue"});
       window.add(locationLabel);
       window.add(countLabel); 
       Titanium.Geolocation.accuracy = Ti.Geolocation.ACCURACY_HIGH;
       Ti.Geolocation.addEventListener('location', function(e) {
       	if (e && e.provider && e.provider.name) {
       		locationLabel.text = locationLabel.text + e.provider.name + ", ";
       		count++;
       		countLabel.text = "Geo events count: " + count;
       	}
       });
       window.open();
       
    1. Run code and observe frequency of Geo events fired using simple mode. master PR: https://github.com/appcelerator/titanium_mobile/pull/6503
  3. Lokesh Choudhary 2015-04-09

    Verified the new implementation. Environment: Appc Studio : 4.0.0.201504081125 Ti SDK : 4.0.0.v20150408131013 CLI : 4.0.0-beta5 Alloy : 1.6.0-beta2 MAC Yosemite : 10.10.2 Appc CLI environment : preprod Appc npm : 0.3.39 Appc CLI : 0.2.235

JSON Source