diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index d44f3122..aff191f5 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -36,8 +36,8 @@ jobs: - name: Install cargo-ndk run: cargo install cargo-ndk - - name: Touch local.properties (required for cargo-ndk) - run: touch local.properties + - name: Touch local.properties (required for build) + run: echo 'stadiaApiKey=' > local.properties working-directory: android - name: Build with Gradle @@ -77,7 +77,7 @@ jobs: run: cargo install cargo-ndk - name: Touch local.properties (required for cargo-ndk) - run: touch local.properties + run: echo 'stadiaApiKey=' > local.properties working-directory: android - name: Verify Kotlin formatting @@ -117,7 +117,7 @@ jobs: run: cargo install cargo-ndk - name: Touch local.properties (required for cargo-ndk) - run: touch local.properties + run: echo 'stadiaApiKey=' > local.properties working-directory: android - name: Unit test @@ -166,7 +166,7 @@ jobs: run: cargo install cargo-ndk - name: Touch local.properties (required for cargo-ndk) - run: touch local.properties + run: echo 'stadiaApiKey=' > local.properties working-directory: android - name: Verify snapshots @@ -215,8 +215,8 @@ jobs: - name: Install cargo-ndk run: cargo install cargo-ndk - - name: Touch local.properties (required for cargo-ndk) - run: touch local.properties + - name: Touch local.properties (required for build) + run: echo 'stadiaApiKey=' > local.properties working-directory: android - name: Run Connected Checks @@ -239,4 +239,4 @@ jobs: name: connected-reports path: | android/**/build/reports - retention-days: 5 \ No newline at end of file + retention-days: 5 diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index 28f963f6..dac95e6b 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -32,8 +32,8 @@ jobs: - name: Install cargo-ndk run: cargo install cargo-ndk - - name: Touch local.properties (required for cargo-ndk) - run: touch local.properties + - name: Creat local.properties (required for cargo-ndk and the demo app) + run: echo 'stadiaApiKey=' > local.properties working-directory: android - name: Publish to Maven Central diff --git a/Package.resolved b/Package.resolved index 5ea0cc53..f0a248a7 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/maplibre/maplibre-gl-native-distribution.git", "state" : { - "revision" : "def156895a9ce38ea9bf9632c1e2272280ce0ae3", - "version" : "6.6.0" + "revision" : "e409318144091c3ee9ad551b202e1c36695f8086", + "version" : "6.7.0" } }, { diff --git a/android/README.md b/android/README.md new file mode 100644 index 00000000..94aaff41 --- /dev/null +++ b/android/README.md @@ -0,0 +1,21 @@ +# Ferrostar Android + +This directory tree contains the Gradle workspace for Ferrostar on Android. + +* `composeui` - Jetpack Compose UI elements which are not tightly coupled to any particular map renderer. +* `core` - The core module is where all the "business logic", location management, and other core functionality lives. +* `demo-app` - A minimal demonstration app. +* `google-play-services` - Optional functionality that depends on Google Play Services (like a fused location client wrapper). This is a separate module so that apps are able to "de-Google" if necessary. +* `maplibreui` - Map-related user interface components built with MapLibre. + +## Running the demo app + +To run the demo app, you'll need a Stadia Maps API key +(free for development and evaluation use; no credit card required; get one at https://client.stadiamaps.com/). +You can also modify it to work with your preferred maps and routing vendor by editing `AppModule.kt`. + +Set your API key in `local.properties` to run the demo app: + +```properties +stadiaApiKey=YOUR-API-KEY +``` diff --git a/android/demo-app/build.gradle b/android/demo-app/build.gradle index 066a278f..230da289 100644 --- a/android/demo-app/build.gradle +++ b/android/demo-app/build.gradle @@ -3,6 +3,7 @@ plugins { alias libs.plugins.jetbrainsKotlinAndroid alias libs.plugins.ktfmt alias libs.plugins.compose.compiler + alias libs.plugins.mapsplatform.secrets.plugin } android { diff --git a/android/demo-app/src/main/AndroidManifest.xml b/android/demo-app/src/main/AndroidManifest.xml index dcdc85d7..9821568b 100644 --- a/android/demo-app/src/main/AndroidManifest.xml +++ b/android/demo-app/src/main/AndroidManifest.xml @@ -21,6 +21,12 @@ android:theme="@style/Theme.Ferrostar" tools:targetApi="31"> + + + Log.i(TAG, "Received alternate route(s): $routes") if (routes.isNotEmpty()) { - // NB: Use `replaceRoute` for cases like this!! + // NB: Use `replaceRoute` for cases like this! it.replaceRoute( routes.first(), NavigationControllerConfig( diff --git a/android/gradle/libs.versions.toml b/android/gradle/libs.versions.toml index b53a26c5..fa61fc69 100644 --- a/android/gradle/libs.versions.toml +++ b/android/gradle/libs.versions.toml @@ -22,6 +22,7 @@ junitCompose = "1.7.2" espressoCore = "3.6.1" okhttp-mock = "2.0.0" mavenPublish = "0.29.0" +secretsGradlePlugin = "2.0.1" material = "1.12.0" [libraries] @@ -73,3 +74,4 @@ cargo-ndk = { id = "com.github.willir.rust.cargo-ndk-android", version.ref = "ca ktfmt = { id = "com.ncorti.ktfmt.gradle", version.ref = "ktfmt" } paparazzi = { id = "app.cash.paparazzi", version.ref = "paparazzi" } mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" } +mapsplatform-secrets-plugin = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secretsGradlePlugin" } \ No newline at end of file