Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Brammos committed Jan 24, 2022
2 parents 667d0c6 + 4bd1b12 commit fd9bb10
Show file tree
Hide file tree
Showing 47 changed files with 100 additions and 1,820 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Hello and thanks for contributing! To help us diagnose your problem quickly, ple
-->

**Android API:**
**Flitsmeister Navigation SDK version:**
**Maplibre Navigation SDK version:**

### Steps to trigger behavior

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

If you have a usage question pertaining to the Flitsmeister Navigation SDK for Android, or any of our other products, contact us through [our support page](https://www.mapbox.com/contact/).
If you have a usage question pertaining to the Maplibre Navigation SDK for Android, or any of our other products, contact us through [our support page](https://www.mapbox.com/contact/).

If you want to contribute code:

Expand All @@ -14,7 +14,7 @@ If you want to contribute code:

## Adding or updating a localization

The Flitsmeister Navigation SDK for Android features several translations contributed through [Transifex](https://www.transifex.com/mapbox/mapbox-navigation-sdk-for-android/). If your language already has a translation, feel free to complete or proofread it. Otherwise, please [request your language](https://www.transifex.com/mapbox/mapbox-navigation-sdk-for-android/) so you can start translating. Note that we’re primarily interested in languages that Android supports as system languages.
The Maplibre Navigation SDK for Android features several translations contributed through [Transifex](https://www.transifex.com/mapbox/mapbox-navigation-sdk-for-android/). If your language already has a translation, feel free to complete or proofread it. Otherwise, please [request your language](https://www.transifex.com/mapbox/mapbox-navigation-sdk-for-android/) so you can start translating. Note that we’re primarily interested in languages that Android supports as system languages.

While you’re there, please consider also translating the following related projects:

Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 Maplibre
Copyright (c) 2019 Flitsmeister
Copyright (c) 2018 Mapbox

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
</a>
</p>

The Flitsmeister Navigation SDK for Android is built on a fork of the [Mapbox Navigation SDK v0.19](https://github.com/flitsmeister/flitsmeister-navigation-android/tree/v0.19.0) which is build on top of the [Mapbox Directions API](https://www.mapbox.com/directions) and contains logic needed to get timed navigation instructions.
The Maplibre Navigation SDK for Android is built on a fork of the [Mapbox Navigation SDK v0.19](https://github.com/flitsmeister/flitsmeister-navigation-android/tree/v0.19.0) which is build on top of the [Mapbox Directions API](https://www.mapbox.com/directions) and contains logic needed to get timed navigation instructions.

With this SDK you can implement turn by turn navigation in your own Android app while hosting your own Map tiles and Directions API.

# Why have we forked

1. Mapbox decided to put a closed source component to their navigation SDK and introduced a non open source license. Flitsmeister wants an open source solution.
1. Mapbox decided to put a closed source component to their navigation SDK and introduced a non open source license. Maplibre wants an open source solution.
2. Mapbox decided to put telemetry in their SDK. We couldn't turn this off without adjusting the source.
3. We want to use the SDK without paying Mapbox for each MAU and without Mapbox API keys.

Expand All @@ -24,13 +24,12 @@ All issues are covered with this SDK.
# What have we changed

- We completely removed the UI part from the SDK so it will only contain the logics for navigation and not the visuals.
- We upgraded the [Mapbox Map SDK](https://github.com/mapbox/mapbox-gl-native/tree/master/platform/android) to version 8.5.0.
- We upgraded the [Mapbox Core](https://github.com/mapbox/mapbox-events-android) to version 1.3.0.
- We upgraded the [Mapbox Map SDK](https://github.com/mapbox/mapbox-gl-native/tree/master/platform/android) to [maplibre SDK](https://github.com/maplibre/maplibre-gl-native/tree/master/platform/android) version 9.4.0.
- We upgraded the [NavigationRoute](https://github.com/flitsmeister/flitsmeister-navigation-android/blob/master/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/NavigationRoute.java#L425)
with the possibility to add an intercepter to the request.
- We changed the [locationLayerPlugin](https://github.com/mapbox/mapbox-plugins-android) to the [location component](https://docs.mapbox.com/android/api/map-sdk/8.5.0/com/mapbox/mapboxsdk/location/LocationComponent.html)
- We updated the logic around the implementation of the locationEngine so it can be used with the new locationEngine from the [Mapbox SDK](https://github.com/mapbox/mapbox-gl-native/tree/master/platform/android).
- We removed the telemetry class from the project. Nothing is being send to Mapbox or Flitsmeister.
- We removed the telemetry class from the project. Nothing is being send to Mapbox or Maplibre.

# Getting Started

Expand Down
7 changes: 5 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion androidVersions.compileSdkVersion
Expand Down Expand Up @@ -44,7 +44,10 @@ android {
dependencies {
// Flitsmeister Navigation SDK
implementation project(':libandroid-navigation')
implementation dependenciesList.mapboxMapSdk
implementation(dependenciesList.mapLibre){
exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-sdk-geojson'
exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-sdk-turf'
}

// Support libraries
implementation dependenciesList.supportAppcompatV7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.mapbox.android.core.permissions.PermissionsListener;
import com.mapbox.android.core.permissions.PermissionsManager;
import com.mapbox.mapboxsdk.location.permissions.PermissionsListener;
import com.mapbox.mapboxsdk.location.permissions.PermissionsManager;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mapbox.services.android.navigation.testapp

import android.annotation.SuppressLint
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
Expand All @@ -21,6 +22,9 @@ import com.mapbox.mapboxsdk.camera.CameraUpdateFactory
import com.mapbox.mapboxsdk.geometry.LatLng
import com.mapbox.mapboxsdk.location.LocationComponent
import com.mapbox.mapboxsdk.location.LocationComponentActivationOptions
import com.mapbox.mapboxsdk.location.engine.LocationEngineCallback
import com.mapbox.mapboxsdk.location.engine.LocationEngineRequest
import com.mapbox.mapboxsdk.location.engine.LocationEngineResult
import com.mapbox.mapboxsdk.location.modes.CameraMode
import com.mapbox.mapboxsdk.location.modes.RenderMode
import com.mapbox.mapboxsdk.maps.MapboxMap
Expand All @@ -40,6 +44,7 @@ import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import timber.log.Timber
import java.lang.Exception
import java.lang.ref.WeakReference

class MockNavigationActivity : AppCompatActivity(), OnMapReadyCallback,
Expand All @@ -57,6 +62,7 @@ class MockNavigationActivity : AppCompatActivity(), OnMapReadyCallback,
private var waypoint: Point? = null
private var locationComponent: LocationComponent? = null

@SuppressLint("MissingPermission")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_mock_navigation)
Expand Down Expand Up @@ -138,7 +144,7 @@ class MockNavigationActivity : AppCompatActivity(), OnMapReadyCallback,
navigationMapRoute = NavigationMapRoute(navigation, mapView, mapboxMap)

mapboxMap.addOnMapClickListener(this)
Snackbar.make(findViewById(R.id.container), "Tap map to place waypoint", BaseTransientBottomBar.LENGTH_LONG).show()
Snackbar.make(findViewById(R.id.container), "Tap map to place waypoint", Snackbar.LENGTH_LONG).show()

newOrigin()

Expand Down Expand Up @@ -206,7 +212,7 @@ class MockNavigationActivity : AppCompatActivity(), OnMapReadyCallback,
}

val navigationRouteBuilder = NavigationRoute.builder(this).apply {
this.accessToken(accesstoken)
this.accessToken("pk.0")
this.origin(origin)
this.destination(destination)
this.voiceUnits(DirectionsCriteria.METRIC)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Flitsmeister Navigation SDK pro Android</string>
<string name="app_name">Maplibre Navigation SDK pro Android</string>

<string name="title_mock_navigation">Simulované navigování</string>
<string name="description_mock_navigation">Simulované navigování využívá simulované určování polohy.</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Flitsmeister Navigation SDK für Android</string>
<string name="app_name">Maplibre Navigation SDK für Android</string>

<string name="title_mock_navigation">Simulierte Navigation</string>
<string name="description_mock_navigation">Simuliere eine Navigationssitzung durch Verwendung von simulierten Standorten</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-he/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Flitsmeister Navigation SDK for Android</string>
<string name="app_name">Maplibre Navigation SDK for Android</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Flitsmeister Navigation SDK per Android</string>
<string name="app_name">Maplibre Navigation SDK per Android</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values-uk/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Flitsmeister Navigation SDK для Android</string>
<string name="app_name">Maplibre Navigation SDK для Android</string>

<string name="title_mock_navigation">Симуляція навігації</string>
<string name="description_mock_navigation">Симуляція навігації за маршрутом з використанням рушія підстановки даних про місцеположення.</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Flitsmeister Navigation SDK for Android</string>
<string name="app_name">Maplibre Navigation SDK for Android</string>

<string name="title_mock_navigation">Mock Navigation</string>
<string name="description_mock_navigation">Mock a navigation session using a mock location engine.</string>
Expand Down
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'jacoco'

buildscript {
ext.kotlin_version = '1.3.60'
ext.kotlin_version = '1.6.0'
apply from: "${rootDir}/gradle/dependencies.gradle"

repositories {
Expand All @@ -12,7 +11,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath pluginDependencies.gradle
classpath pluginDependencies.coveralls
classpath pluginDependencies.errorprone
Expand All @@ -29,7 +28,6 @@ task testReport(type: TestReport, group: 'Build') {
allprojects {
repositories {
google()
jcenter()
maven { url 'https://plugins.gradle.org/m2' }
}

Expand Down
3 changes: 0 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
- run:
name: Check Java code style
command: make checkstyle
- run:
name: Run unit-test and generate Jacoco test report
command: ./gradlew createDebugUnitTestCoverageReport
- run:
name: Build release to test ProGuard rules
command: ./gradlew app:assembleRelease
Expand Down
60 changes: 31 additions & 29 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,40 @@ ext {

androidVersions = [
minSdkVersion : 15,
targetSdkVersion : 28,
compileSdkVersion: 28,
buildToolsVersion: '28.0.3'
targetSdkVersion : 30,
compileSdkVersion: 31,
buildToolsVersion: '30.0.3'
]

version = [
mapboxMapSdk : '9.2.1',
mapboxSdkServices: '4.8.0',
autoValue : '1.5.4',
autoValueParcel : '0.2.5',
junit : '4.12',
supportLibVersion: '27.1.1',
constraintLayout : '1.1.2',
mockito : '2.21.0',
hamcrest : '2.0.0.0',
errorprone : '2.3.1',
butterknife : '8.8.1',
leakCanaryVersion: '1.6.1',
timber : '4.7.1',
testRunnerVersion: '1.0.1',
espressoVersion : '3.0.2',
spoonRunner : '1.6.2',
commonsIO : '2.6',
robolectric : '4.0',
lifecycle : '1.1.1',
picasso : '2.71828',
gmsLocation : '15.0.1'
mapLibreVersion : '9.4.0',
mapLibreService : '5.9.0',
mapLibreTurf : '5.9.0',
mapLibreAnnotations : '1.0.0',
autoValue : '1.5.4',
autoValueParcel : '0.2.5',
junit : '4.12',
supportLibVersion : '28.0.0',
constraintLayout : '1.1.2',
mockito : '2.21.0',
hamcrest : '2.0.0.0',
errorprone : '2.3.1',
butterknife : '8.8.1',
leakCanaryVersion : '1.6.1',
timber : '4.7.1',
testRunnerVersion : '1.0.1',
espressoVersion : '3.0.2',
spoonRunner : '1.6.2',
commonsIO : '2.6',
robolectric : '4.0',
lifecycle : '1.1.1',
picasso : '2.71828',
gmsLocation : '16.0.0'
]

pluginVersion = [
checkstyle : '8.2',
pmd : '5.8.1',
jacoco : '0.8.1',
errorprone : '0.0.13',
coveralls : '2.8.1',
spotbugs : '1.3',
Expand All @@ -44,10 +45,11 @@ ext {
]

dependenciesList = [
// mapbox
mapboxMapSdk : "com.mapbox.mapboxsdk:mapbox-android-sdk:${version.mapboxMapSdk}",
mapboxSdkServices : "com.mapbox.mapboxsdk:mapbox-sdk-services:${version.mapboxSdkServices}",
mapboxSdkTurf : "com.mapbox.mapboxsdk:mapbox-sdk-turf:${version.mapboxSdkServices}",
// maplibre
mapLibre : "org.maplibre.gl:android-sdk:${version.mapLibreVersion}",
mapLibreServices : "org.maplibre.gl:android-sdk-services:${version.mapLibreService}",
mapLibreTurf : "org.maplibre.gl:android-sdk-turf:${version.mapLibreTurf}",
mapLibreAnnotations : "org.maplibre.gl:android-plugin-annotation-v9:${version.mapLibreAnnotations}",

// AutoValue
autoValue : "com.google.auto.value:auto-value:${version.autoValue}",
Expand Down
68 changes: 0 additions & 68 deletions gradle/jacoco.gradle

This file was deleted.

6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Nov 19 14:50:49 CET 2019
#Fri Jan 07 14:24:22 CET 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
Loading

0 comments on commit fd9bb10

Please sign in to comment.