From c7b63cd9a7eaef6ce1f577a1acd298d545fd82a5 Mon Sep 17 00:00:00 2001 From: SomeoneElseOSM Date: Fri, 24 Jan 2025 01:47:02 +0000 Subject: [PATCH] Add more detail documentation Android test app, one minor typo. (#3173) --- docs/mdbook/src/platforms.md | 2 +- platform/android/docs/getting-started.md | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/mdbook/src/platforms.md b/docs/mdbook/src/platforms.md index 01b70ae8f8b..20a83499e4c 100644 --- a/docs/mdbook/src/platforms.md +++ b/docs/mdbook/src/platforms.md @@ -26,7 +26,7 @@ You can find an app that uses GLFW in [`platform/glfw`](https://github.com/mapli Originally the project only supported OpenGL 2.0. In 2023, the [renderer was modularized](https://github.com/maplibre/maplibre-native/blob/main/design-proposals/2022-10-27-rendering-modularization.md) allowing for the implementation of alternate rendering backends. The first alternate rendering backend that was implemented was [Metal](https://maplibre.org/news/2024-01-19-metal-support-for-maplibre-native-ios-is-here/), followed by [Vulkan](https://maplibre.org/news/2024-12-12-maplibre-android-vulkan/). In the future other rendering backends could be implemented such as WebGPU. -What platfroms support which rendering backend can be found below. +What platforms support which rendering backend can be found below. | Platform | OpenGL ES 3.0 | Vulkan 1.0 | Metal | |---|---|---|---| diff --git a/platform/android/docs/getting-started.md b/platform/android/docs/getting-started.md index 9e05c22334b..bcd2c845d9f 100644 --- a/platform/android/docs/getting-started.md +++ b/platform/android/docs/getting-started.md @@ -1,6 +1,8 @@ # Quickstart -1. Add bintray Maven repositories to your project-level Gradle file (usually `//build.gradle`). +To follow this example from scratch, in Android Studio create a new "Empty Views Activity" and then select "Kotlin" as the language. Select "Groovy DSL" as the build configuration language. + +1. If you have an older project, you'll need to add bintray Maven repositories to your project-level Gradle file (usually `//build.gradle`). Add `mavenCentral()` to where repositories are already defined in that file, something like this: ```gradle allprojects { @@ -11,13 +13,15 @@ } ``` -2. Add the library as a dependency into your module Gradle file (usually `//build.gradle`). Replace `` with the [latest MapLibre Android version](https://github.com/maplibre/maplibre-native/releases?q=android-v11&expanded=true) (e.g.: `org.maplibre.gl:android-sdk:11.5.2`): + A newly-created app will likely already have `mavenCentral()` in a top-level `settings.gradle` file, and you won't need to add it. + +2. Add the library as a dependency into your module Gradle file (usually `//build.gradle`). Replace `` with the [latest MapLibre Android version](https://github.com/maplibre/maplibre-native/releases?q=android-v11&expanded=true) (e.g.: `org.maplibre.gl:android-sdk:11.8.0`): ```gradle dependencies { ... implementation 'org.maplibre.gl:android-sdk:' - ... + } ``` @@ -35,17 +39,16 @@ ... ``` -5. Initialize the `MapView` in your `MainActivity` file by following the example below: +5. Initialize the `MapView` in your `MainActivity` file by following the example below. If modifying a newly-created "Empty Views Activity" example, it replaces all the Kotlin code after the "package" line. ```kotlin import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.view.LayoutInflater - import org.maplibre.android.Maplibre + import org.maplibre.android.MapLibre import org.maplibre.android.camera.CameraPosition import org.maplibre.android.geometry.LatLng import org.maplibre.android.maps.MapView - import org.maplibre.android.testapp.R class MainActivity : AppCompatActivity() {