Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[android] Integration of the new events library #10999

Merged
merged 7 commits into from
Feb 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions platform/android/MapboxGLAndroidSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildConfigField "String", "MAPBOX_EVENTS_USER_AGENT", String.format("\"MapboxEventsAndroid/%s\"", project.VERSION_NAME)
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@
import android.support.annotation.UiThread;
import android.text.TextUtils;

import com.mapbox.android.core.location.LocationEngine;
import com.mapbox.android.core.location.LocationEnginePriority;
import com.mapbox.android.core.location.LocationEngineProvider;
import com.mapbox.mapboxsdk.constants.MapboxConstants;
import com.mapbox.mapboxsdk.exceptions.MapboxConfigurationException;
import com.mapbox.mapboxsdk.location.LocationSource;
import com.mapbox.mapboxsdk.net.ConnectivityReceiver;
import com.mapbox.services.android.telemetry.MapboxTelemetry;
import com.mapbox.services.android.telemetry.location.LocationEngine;
import com.mapbox.services.android.telemetry.location.LocationEnginePriority;
import com.mapbox.services.android.telemetry.location.LocationEngineProvider;

import timber.log.Timber;

/**
* The entry point to initialize the Mapbox Android SDK.
Expand Down Expand Up @@ -56,15 +52,9 @@ public static synchronized Mapbox getInstance(@NonNull Context context, @NonNull
INSTANCE = new Mapbox(appContext, accessToken, locationEngine);
locationEngine.setPriority(LocationEnginePriority.NO_POWER);

try {
MapboxTelemetry.getInstance().initialize(
appContext, accessToken, BuildConfig.MAPBOX_EVENTS_USER_AGENT, locationEngine);
} catch (Exception exception) {
Timber.e(exception, "Unable to instantiate Mapbox telemetry");
}

ConnectivityReceiver.instance(appContext);
}

return INSTANCE;
}

Expand Down Expand Up @@ -145,23 +135,12 @@ public static synchronized Boolean isConnected() {
return (activeNetwork != null && activeNetwork.isConnected());
}

/**
* Returns a location source instance with empty methods.
*
* @return an empty location source implementation
* @deprecated Replaced by {@link Mapbox#getLocationEngine()}
*/
@Deprecated
public static LocationSource getLocationSource() {
return new EmptyLocationSource();
}


/**
* Returns the location engine used by the SDK.
*
* @return the location engine configured
*/
// TODO Do we need to expose this?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove or ticket.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ticketed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@electrostat

Ticketed

This should be ticketed in this repo 👉 https://github.com/mapbox/mapbox-gl-native/issues

public static LocationEngine getLocationEngine() {
return INSTANCE.locationEngine;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.mapbox.mapboxsdk.R;
import com.mapbox.mapboxsdk.constants.MapboxConstants;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.services.android.telemetry.utils.MathUtils;
import com.mapbox.mapboxsdk.utils.MathUtils;

/**
* Resembles the position, angle, zoom and tilt of the user's viewpoint.
Expand Down

This file was deleted.

This file was deleted.

Loading