-
Notifications
You must be signed in to change notification settings - Fork 319
Add FusedLocationEngine to Test App #1373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c374999 to
c01ed05
Compare
danesfeder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevinkreiser added some cleanup here and updating naming / formatting. Good to go for the test-app for now. Thanks again for running with this 🚀
c01ed05 to
c0c103e
Compare
Guardiola31337
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You crushed it again @kevinkreiser 💪
I've left some minor comments. Also noticed that the camera in ComponentNavigationActivity isn't tracking anymore 👀
I've double checked and this is also reproducible in master. Is that working as designed @danesfeder? If not, we should cut a ticket to fix.
| public void onPause() { | ||
| super.onPause(); | ||
| mapView.onPause(); | ||
| locationEngine.deactivate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed. Actually, it's stopping the location engine when putting the app in the foreground.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For testing purposes I went ahead and fix ☝️ in 5978bd9 cc @kevinkreiser @danesfeder
|
|
||
| private void createLocationRequest() { | ||
| locationRequest = new LocationRequest(); | ||
| locationRequest.setInterval(UPDATE_INTERVAL_IN_MILLISECONDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setInterval, setFastestInterval and setPriority are hardcoded. We should use set LocationEngine values instead.
| private Location lastLocation = null; | ||
| private final ForwardingLocationCallback forwardingCallback = new ForwardingLocationCallback(this); | ||
|
|
||
| public FusedLocationEngine(@NonNull Activity activity) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be this a Context instead?
c0c103e to
6041ae4
Compare
Found the "issue" thanks to @LukasPaczos. Latest changes in the LLP (mapbox/mapbox-plugins-android#544 (comment) and follow up PR mapbox/mapbox-plugins-android#583) + integrating them in the SDK (#1372, #1377 and #1386) introduced some camera gotchas https://www.mapbox.com/android-docs/plugins/overview/location-layer/#following-the-user-location-with-cameramode 👇
Going to open a PR that disables the camera tracking while not navigating. Also, while debugging this I noticed that |
|
The idea of exposing and requiring @NavigationCamera.TrackingMode instead of @CameraMode.Mode was to limit available camera mode options to those that are tested and well coordinated with the rest of the navigation UI/UX. Exposing the rest of camera tracking modes would generate another set of paths to maintain and wasn't in the scope of the original PR, but that's definitely an option we can explore going forward. |
6041ae4 to
5978bd9
Compare
Makes sense. Thanks for clarifying @LukasPaczos
Yeah, let's revisit this in a follow up PR. It seems like we're duplicating logic unnecessarily. While testing OP I tried to set the camera mode to |
|
Adding the support for |
…igation-native version to kk_animate-SNAPSHOT-5 for testing
…ompared against the system clock for proper navigation/animation
…lue is compared against the system clock for proper navigation/animation" This reverts commit 1a2781e.
…ompared against the system clock for proper navigation/animation
… request a context (instead of an activity) in fused location engine constructor
3492dd1 to
ea9bbfe
Compare
|
Going to go ahead and merge here. I opened a follow up ticket re. above camera mode discussion 👉 #1431 Thanks @kevinkreiser for running with this one 🙏 |

I've been testing with the sample app and have seen that the location updates using
LocationEngineare coming in between every 2 and 3 seconds on average. In practice sometimes we get no location updates for much longer periods of time. Additionally when sitting still we dont get updates with the conventionallyLocationEngine. This leads to a problem where we can't tell if we are sitting still or have no signal when navigating.I've been able to take a sample application, fork it, and instrument it to see that indeed my device is capable of secondly gps updates (even when sitting still). This work is here: https://github.com/kevinkreiser/android-play-location/blob/master/LocationUpdates/app/src/main/java/com/google/android/gms/location/sample/locationupdates/MainActivity.java
@Guardiola31337 suggested that the fastest way for me to try this approach within the SDK was to simply write an
AlternativeLocationEnginethat extended the conventional one so that is what I did. So far the results are promising. As with the other test app, I am getting secondly updates.