-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[android] Integration of the new events library #10999
Conversation
6532a4e
to
a30a81b
Compare
@Guardiola31337 @electrostat Parallel to this PR, @osana is working on integrating the MAS 3.x on #10920 and I believe she's encountering some (old) telemetry integration issues. Would you recommend working on MAS 3.x integration as branched work from this PR, or should we continue with the current approach on #10920? |
@zugaldia @electrostat @Guardiola31337 @cammace @tobrun Turned out that the issue I had was related to my JNI code but the error message said that it was not finding some class related to GoogleLocationEngine. I should be good for now. If needed I will cherry-pick my change into the a child branch of this one. |
So far, we needed to create So, whatever is easier for you ¯\_(ツ)_/¯ |
@@ -36,6 +35,8 @@ | |||
private String accessToken; | |||
private Boolean connected; | |||
private LocationEngine locationEngine; | |||
@SuppressLint("StaticFieldLeak") | |||
private static MapboxTelemetry telemetry; |
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.
any background on why this should be static?
// TODO transform.getZoom() may cause a NullPointerException | ||
MapState twoFingerTap = new MapState((float) latLng.getLatitude(), (float) latLng.getLongitude(), (float) | ||
transform.getZoom()); | ||
twoFingerTap.setGesture("TwoFingerTap"); |
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.
do we have any gesture constants? eg. for TwoFingerTap etc.
MapboxEvent.GESTURE_TWO_FINGER_SINGLETAP, transform)); | ||
MapEventFactory mapEventFactory = new MapEventFactory(); | ||
LatLng latLng = projection.fromScreenLocation(new PointF(event.getX(), event.getY())); | ||
// TODO transform.getZoom() may cause a NullPointerException |
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.
on top of this todo, would it be possible hardening add same checks as with #10959 ?
MapEventFactory mapEventFactory = new MapEventFactory(); | ||
LatLng latLng = projection.fromScreenLocation(new PointF(event.getX(), event.getY())); | ||
// TODO transform.getZoom() may cause a NullPointerException | ||
MapState twoFingerTap = new MapState((float) latLng.getLatitude(), (float) latLng.getLongitude(), (float) |
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.
Would it makes sense changing MapState to double instead of float?
@@ -65,7 +65,9 @@ public static synchronized Mapbox getInstance(@NonNull Context context, @NonNull | |||
} | |||
|
|||
ConnectivityReceiver.instance(appContext); | |||
Timber.d("instance: connectivity receiver started"); |
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.
How adding a log solves a JNI bug?
In any case, we should remove these logs before merging because they'd clutter Logcat unnecessarily.
@tobrun cc @electrostat |
88bc8f4
to
0d5aac4
Compare
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.
Looks Good.
@tobrun give it a once over, if you can. Then I think we are good to go on this one.
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.
Some comments to the PR, non-blocking, can be addressed in follow up tickets if necessary.
@@ -0,0 +1,79 @@ | |||
package com.mapbox.mapboxsdk.utils; | |||
|
|||
// TODO Remove this class if we finally include it within MAS 3.x (GeoJSON) |
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.
Remove or ticket.
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.
Ticketed
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.
Ticketed
This should be ticketed in this repo 👉 https://github.com/mapbox/mapbox-gl-native/issues
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.
Follow up ticket 👉 #11182
/** | ||
* Returns the location engine used by the SDK. | ||
* | ||
* @return the location engine configured | ||
*/ | ||
// TODO Do we need to expose this? |
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.
Remove or ticket.
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.
Ticketed
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.
Ticketed
This should be ticketed in this repo 👉 https://github.com/mapbox/mapbox-gl-native/issues
@@ -61,7 +61,8 @@ dependencies { | |||
implementation dependenciesList.supportRecyclerView | |||
implementation dependenciesList.supportDesign | |||
|
|||
implementation dependenciesList.lost | |||
// implementation dependenciesList.lost |
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.
Duplicated line.
@@ -9,6 +9,7 @@ ext { | |||
|
|||
versions = [ | |||
mapboxServices: '2.2.9', | |||
mapboxTelemetryVersion: '3.0.0-SNAPSHOT', |
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.
Is it necessary to rely on a SNAPSHOT? If so, upgrading to a stable version needs to be ticketed.
@@ -42,6 +43,7 @@ ext { | |||
supportRecyclerView : "com.android.support:recyclerview-v7:${versions.supportLib}", | |||
|
|||
lost : "com.mapzen.android:lost:${versions.lost}", | |||
gmsLocation : 'com.google.android.gms:play-services-location:11.0.4', |
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.
We should use ${versions.*}
for consistency here too.
@@ -25,6 +25,8 @@ android { | |||
minSdkVersion androidVersions.minSdkVersion | |||
targetSdkVersion androidVersions.targetSdkVersion | |||
buildConfigField "String", "GIT_REVISION_SHORT", String.format("\"%s\"", getGitRevision()) | |||
buildConfigField "String", "MAPBOX_SDK_IDENTIFIER", String.format("\"%s\"", "mapbox-maps-android") | |||
buildConfigField "String", "MAPBOX_SDK_VERSION", String.format("\"%s\"", project.VERSION_NAME) | |||
buildConfigField "String", "MAPBOX_VERSION_STRING", String.format("\"Mapbox/%s\"", project.VERSION_NAME) |
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.
Is MAPBOX_VERSION_STRING
still being used or was it replaced by MAPBOX_SDK_VERSION
?
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.
It's still being used in HTTPRequest
👀
Line 210 in e2a4dff
BuildConfig.MAPBOX_VERSION_STRING, |
5b6fde7
to
35e618c
Compare
35e618c
to
867ed80
Compare
can we update this PR with telem beta version and merge this? |
…ed methods from math utils class
bcf3d42 addresses ☝️ I guess that we’re moving forward and we’ll remove |
Follow up ticket 👉 #11182 |
* [android] integration of the new events library * JNI Bug - current build with JNI bug * fix #10999 comments * Clean-up - clean-up timbers and test code * [android] fix sdk identifier and sdk version * [android] merge from master (MAS 3.0) * [android] bump events lib version to 3.0.0-beta.1 and remove never used methods from math utils class
* [android] integration of the new events library * JNI Bug - current build with JNI bug * fix #10999 comments * Clean-up - clean-up timbers and test code * [android] fix sdk identifier and sdk version * [android] merge from master (MAS 3.0) * [android] bump events lib version to 3.0.0-beta.1 and remove never used methods from math utils class
cc @electrostat @tobrun @osana @zugaldia @boundsj