Skip to content

Android/iOS native core integration #572

@sargunv

Description

@sargunv

#544 added basic native core integration for desktop. Once that matures and catches up to our existing MapLibre Android/iOS wrappers, we should look at using our own native core integration for Android and iOS too, to eliminate API differences between the different SDKs.

  • Do this only after Desktop target feature parity #570 is complete.
  • The maplibre-native-bindings module should become a KMP module with Android and Native (iOS) targets in addition to the existing JVM target (for naming, see "desktopMain" -> "jvmMain" #549)
  • For Android, we should be able to re-use most of the maplibre-native-bindings-jni module, except integrating with an Android Surface instead of an AWT Canvas. But rather than publishing the C++ natives as their own artifact, they should be integrated in to the .aar for maplibre-native-bindings.
  • For iOS, we'll need new Kotlin/Native cinterop bindings to MapLibre Native. We can do this through ObjC (for apple platforms) or C (for all native platforms). Compose Multiplatform today only supports Apple platforms for Native, but there's other folks working on Linux and probably Windows, so it's worth trying to write a C ABI.
  • If we get a working C ABI for native, it's worth investigating whether we can use that to streamline or replace the JNI integration. But we have working JNI right now, so I wouldn't abandon that to build the C one first.

Tldr: order of operations is:

  • Get desktop (JVM) to parity with mobile
  • Add Android support to our JNI bindings
  • Add iOS support via (hopefully) C bindings
  • Investigate porting JVM and Android to the same C bindings

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidAffects Android in particular, or relates to Android specific codeblockedThe issue or PR is blocked by another issueiosAffects iOS in particular, or relates to iOS specific code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions