Skip to content

Maplibre-Core on android#4418

Draft
Murmele wants to merge 3 commits into
maplibre:mainfrom
Murmele:android
Draft

Maplibre-Core on android#4418
Murmele wants to merge 3 commits into
maplibre:mainfrom
Murmele:android

Conversation

@Murmele

@Murmele Murmele commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

This is an initial work to get maplibre-core working on android using maplibre-native-rs.

The idea is to have custom interfaces so the Rust Functionality for Http and so on can be used instead of using the android java code. This code is far from finish, just a prototype yet but I wanna hear your opinion about.

@louwers

@github-actions github-actions Bot added build Related to build, configuration or CI/CD android core Changes that affect the C++ core of MapLibre Native github_actions Pull requests that update GitHub Actions code labels Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results ⚡

Benchmark                                                          Time             CPU      Time Old      Time New       CPU Old       CPU New
-----------------------------------------------------------------------------------------------------------------------------------------------
OVERALL_GEOMEAN                                                 +0.0093         +0.0096             0             0             0             0

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-4418-compared-to-main.txt

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Bloaty Results 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-4418-compared-to-main.txt

Compared to d387090 (legacy)

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +55% +63.3Mi  +472% +28.2Mi    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-4418-compared-to-legacy.txt

@github-actions

Copy link
Copy Markdown
Contributor

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-4418-compared-to-main.txt

@louwers louwers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Have you seen https://maplibre.org/maplibre-native/docs/book/rust.html?

You could probably make a Rust implementation of HTTPFileSource on this side.

Comment thread vendor/harfbuzz.cmake
set_target_properties(mbgl-harfbuzz PROPERTIES CXX_VISIBILITY_PRESET default VISIBILITY_INLINES_HIDDEN OFF)
else()
add_library(mbgl-harfbuzz STATIC
${CMAKE_CURRENT_LIST_DIR}/harfbuzz/src/harfbuzz.cc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe you can look into HarfRust. ;-)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

But then we have to write the ffi to C++ again :). If maplibre-native is open to implement parts in Rust I am open for it :)

Comment thread CMakePresets.json
"cacheVariables": {
"MLN_WITH_WEBGPU": "ON",
"MLN_WEBGPU_IMPL_WGPU": "ON",
"MLN_WEBGPU_IMPL_FFI": "ON"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just noticed this, but a default should be set with a description in CMakeLists.txt.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You are right I forgott to do it in my previous PR. Thanks I will add


JavaVM* theJVM;

#if MLN_WEBGPU_IMPL_FFI

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I need to set the jvm from externally to be able to use maplibre-native with the ndk

@Murmele

Murmele commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

Have you seen https://maplibre.org/maplibre-native/docs/book/rust.html?

You could probably make a Rust implementation of HTTPFileSource on this side.

The problem then is still that the http rust library is then statically linked once on the maplibre-native side and once on the rust application side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

android build Related to build, configuration or CI/CD core Changes that affect the C++ core of MapLibre Native github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants