[TIMOB-20522] FusedLocationProvider on Android
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-02-21T21:25:26.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.1.0 |
Components | Android |
Labels | n/a |
Reporter | Joseph Sachs |
Assignee | Gary Mathews |
Created | 2016-03-05T13:06:58.000+0000 |
Updated | 2021-03-30T09:11:20.000+0000 |
Hello, Thanks for reaching out. This is a valid new feature request. Our engineers will look into it for further process.
I've noticed a lot more developers are watching this ticket. I wonder if it would be possible to increase the priority on this feature?
@Joe it dosen't; This ticket is simply the newer/better way of getting the geolocation of the user on Android.
[~underlabs] Just wondering, which module are you using that provides the FusedLocationProvider?
It was a paid (closed) module a few years ago. The developer offers no support anymore.
I have developed this module with FusedLocationProvider. It should not be distributed, please remove the Dropbox link.
It's been removed from Dropbox. However, @Danny, maybe you can help on this ticket since you developed the module.
I haven't updated the module since SDK 5.0.2 ... will do it probably next month. The AppC team is much more experienced in native development. I don't think they need my help to implement this feature request.
It seems this ticket has no attention. Is it possible to increase priority for this ticket?
It is a feature-ticket and our Android-team currently has priority-bugfixes to work on, so we can't schedule it, yet.
Can't update one of our bigger Apps to 6.x due to one closed-module which uses Fused-Location. I agree with [~Topener] this should be a high priority, as this is the proper way to implement Geolocation. The current API Ti uses on Android is far too old and not recommended.
Any update on this 'really important' feature?
+1
Hello all, This sprint we will scope the work we think will be required for implementation. Once I have that, we can schedule it, but at this point I can't say when that will be. Stay tuned.
After two full days trying to get this running, I do have an Android Module https://github.com/yozef/FusedLocation (basically my first Android Module & playing around in Java). This Module works on it's own in a Ti App; However this Module *does Not work with ti.map* due to google-play-services.jar having similar classes in both modules. I see two options: - Maybe this module can help implement it in Ti.Geolocation by the AppC Devs - Maybe someone can figure out a way to fix google-play-services of FusedLocation (pull-request) in order to with Ti.Map in the same Ti Android App.
Looks like you have debugged my module, which tool did you use?
Hi Danny, I worked on it with Rainer Knoterich. Can you help with google-play-services issue?
Even the log messages are in the same place as in my original code, seriously?!
What log Messages? Your original module hasn't been touched in over 2 years mate. The issue we have is this, when used with other Android Module (such as Ti.Map):
If you can help, I'm on TiSlack
My module works perfect with Ti SDK 6.0. It's quite simple, just use the correct Google Play lib.
Just released FusedLocation android module: https://github.com/yozef/FusedLocation It returns a location object, exactly like how iOS would return the location object (also has some hardcoded values like DistanceFilter, etc; )
+1 for this ticket since it brings better parity with iOS and it is the recommended native way of implementing location-awareness on native Android apps.
I see this one is keep being pushed back. Is there a reason for this? For when is it actually planned?
Has this one ended up in the too hard pile as there has been no activity on this for months.
Any update on this being implemented?
This module stopped working after Ti 6.1.2.GA due to Google Play Services conflicts & I can't seem to get it to work with latest/updated .jar. Can we bump the priority on this ticket please, since we can't update to the latest Ti SDK for Android builds.
master: https://github.com/appcelerator/titanium_mobile/pull/9634
Love that there is a PR for this. Is there any way this can get backported in the 6.# branch? A 6.4 version for example.
7_1_X: https://github.com/appcelerator/titanium_mobile/pull/9826
FR Passed for both master & backport. Waiting for CR.
PR's merged.
Verified the fix in SDK 7.2.0.v20180305152636 & 7.1.0.v20180306061214. Closing. Studio Ver: 5.0.0.201712081732 OS Ver: 10.13.2 Xcode Ver: Xcode 9.2 Appc NPM: 4.2.12 Appc CLI: 7.0.2 Daemon Ver: 1.0.1 Ti CLI Ver: 5.0.14 Alloy Ver: 1.11.0 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 5 — Android 6.0.1 ⇨ google Nexus 6P — Android 8.0.0
Has anybody been able to run this module and have Location Update every 5 meters. Seems that regardless of the LocationProvider and LocationRules on Android, the geolocation triggers only after a fixed 30 seconds time laps. I assume it's due to the hardcoded final consts here: https://github.com/garymathews/titanium_mobile/blob/c4cc7bef37b8f48d3f23e5536493ece4b2b0fd0e/android/modules/geolocation/src/java/ti/modules/titanium/geolocation/GeolocationModule.java#L184 This is the Code I am trying to test on Simulator, with Ti 7.1.x the Fused Location should adhere to the settings:
This fires
location
event every 30 seconds, whereas it should update every provider settings and/or LocationRules settings. Maybe I'm missing an example to show this in action?My mistake... it Works! All I needed was to make sure this was added: Ti.Geolocation.Android.manualMode = true;
Guys, I believe this part of code is really poorly documented. The only reference is : "Starting at TiSDK 7.1.0.GA there is support for FusedLocationProvider. To enable this, the only thing you need to do is include the Ti.PlayServices module in your app. This will enable battery efficient geolocation API's in your app." In my case this was NOT the only changed required. At manualMode you say : "Manual mode gives developers low-level control of location updates, including enabling individual location providers and filtering updates, for the best combination of accuracy and battery life. Manual mode is used when the Titanium.Geolocation.Android.manualMode flag is set to true. In manual mode, the accuracy property is not used, and all configuration is done through the Titanium.Geolocation.Android module." For FuseLocation however even though manualMode must be set, accuracy property needs to be set for having high accuracy values. Also accuracy has to be set AFTER manualMode, otherwise minUpdateDistance and minUpdate values are not respected. All these are not mentioned anywhere at documentation. Also I couldn't find a way to use the old location provider but for removing play services library. It would be convenient to have this as a pref because someone might want to keep the old library but add play services for other features (like maps or firebase)
[~peaceofmind7] Valid points! Documentation can always be improved to help others. You could either add some valid information to https://github.com/appcelerator/titanium_mobile/tree/master/apidoc/Titanium/Geolocation or start a conversation at: https://github.com/appcelerator/titanium_mobile/discussions so others can join in and help in finding the best text for the documentation. I only use Fused it in non-manual mode and it "just works" :) But for other use cases it might be very useful to know those parts!