Has anyone successfully used the new Android Geolocation manual mode? I have been trying to get it to work but the function
Ti.Geolocation.Android.setManualMode(true);comes back with a null reference exception saying the method is undefined. After looking through the source code it appears that
Ti.Geolocation.Android.manualMode = true;also will not turn on manual mode. Any ideas on how to enable this?
1 Answer
I think you also need to define custom gps/wifi provider and gps/wifi location rule:
For example:
Ti.Geolocation.Android.manualMode = true; // modify only the gps var gpsProvider = Ti.Geolocation.Android.createLocationProvider({ name: Ti.Geolocation.PROVIDER_GPS, minUpdateTime: 30, minUpdateDistance: 100 }); Ti.Geolocation.Android.addLocationProvider(gpsProvider); var gpsRule = Ti.Geolocation.Android.createLocationRule({ provider: Ti.Geolocation.PROVIDER_GPS, accuracy: 100, // in meters maxAge: (1000 * 30), minAge: (1000 * 5) }); Ti.Geolocation.Android.addLocationRule(gpsRule);Configuration depends on what you need so you might need to tweak that.
Your Answer
Think you can help? Login to answer this question!