Skip to content

Conversation

@cbalster
Copy link
Member

@cbalster cbalster commented Nov 9, 2025

Note: This is a draft and not ready to be merged yet!

Hey everyone,
I found some time to migrate the map sdk from the now defunct osmdroid to maplibre native.
At the same time I bumped the minSdk version to 26 to get rid of a lot of workarounds for older android version barely used anymore and to enable using more modern features.

This PR includes:

  • a LOT of cleanup
  • replacement of osmdroid with maplibre native, including all necessary adaptations (gpx track feature disabled for now)

This includes a switch of the tileserver from the raster based osm server to the new vector based one: https://vector.openstreetmap.org/. The usage policy stays the same (basically proper attribution, contact information in user agent and no intense/commercial use) and I assume we will still be fine in that regard.

That being said there is still some stuff to do:

  • adapt the map style to something more fitting with our use-case (can also be done later)
  • adapt the style to use sprites and fonts from assets folder to reduce load on tileserver (see comment in code)
  • double check our attributions, if we covered everything (maplibre, osm, mapstyle, ...)
  • code handling sources and layers for markers can definitely be improved
  • re-implementation of GPX track feature (to be discussed)

Once that has been done I would release this as Version 3.0.0 while at the same time bumping the VersionCode to 100. This will allow us to still keep the current version with minsdk 16 for as long as it works and also enable us to update it if needed. This works since play store will always serve users the version with the highest versioncode that will run on their specific device.

My suggestion would be to get this done and then afterwards start the migration to kotlin and compose to get the code base up to speed.

@mltbnz @stephanlindauer : I would like to hear you thoughts on this and would also appreciate it if you could check out this branch and test it.

@cbalster cbalster requested a review from mltbnz November 9, 2025 12:14
Restructure and use version catalog as in current best practice examples
@mltbnz
Copy link
Member

mltbnz commented Nov 10, 2025

This looks great.
I checked out the code and ran it in the emulator which works well.

Is there anything from a code perspective that needs specific attention? To be fair: my knowledge of Android is limited and especially Java 😄

But Maplibre seems like a good choice. I was also thinking about adopting it at some point and would be very interested in your experience with it after a while as you pointed out

@stephanlindauer
Copy link
Member

Looks great! Thanks for the initiative! ❤️

@dreua
Copy link

dreua commented Nov 13, 2025

I'd be happy to install and test an apk of this if that would be helpful. Thank you for your work!

@cbalster
Copy link
Member Author

I'd be happy to install and test an apk of this if that would be helpful. Thank you for your work!

That would be great - thank you! I attached the zipped apk here. You might have to uninstall the official version first before install.
app-debug.zip

@dreua
Copy link

dreua commented Nov 20, 2025

The map looks great and it allows zooming with one finger, a feature that I have missed for a long time 👍

The menu doesn't work at all for me, unfortunately. It slides in from the left and slides back out as soon as I tap anywhere on the screen, but neither the "oberserver mode" toggle nor any of the other menu entries can be selected. Pixel 3a with current LineageOS and MicroG. Does this work on other devices? (Mine is a bit of an outlier admittedly, but I've never had such a UI issue before.)

@cbalster
Copy link
Member Author

@dreua Thank you for the feedback. That's interesting. Neither on an actual device nor on any of the emulators do I see that issue. Lineage should not be a problem. MicroG neither, since we do not use any play services. I will do some digging...

@dreua
Copy link

dreua commented Nov 23, 2025

That is really strange, now I can't reproduce it. Maybe it was some ghost touching from my slightly cracked screen which interfered, no idea but that is my best guess for now. Sorry for sending you on a goose chase here.

Something minor I notice now is that the map is blank (white) every time after I switch back to it from a different view inside the app (chat, rules, settings...) and takes a small moment to load. It doesn't happen when I switch to an entirely different app (e.g. Signal, Browser, Launcher...) in this case the map is right back like nothing happened. It is usable, maybe less of an issue on more powerful (modern) devices but it is noticable on my device and maybe an easy fix.

(It does not matter if I switch back with a back gesture or using the menu to go to the map.)

@cbalster
Copy link
Member Author

cbalster commented Nov 23, 2025 via email

@dreua
Copy link

dreua commented Nov 23, 2025

That sounds very good to me, considering that I don't switch views in the app too often usually. And as I said, it is still very usable, happy to trade this short moment for the one finger zoom feature 👍

@dreua
Copy link

dreua commented Nov 23, 2025

Closes: #278

@cbalster cbalster marked this pull request as ready for review November 24, 2025 17:09
@cbalster cbalster requested a review from a team as a code owner November 24, 2025 17:09
@cbalster cbalster merged commit 87a8aa8 into criticalmaps:master Nov 24, 2025
1 check passed
@cbalster cbalster deleted the migrate_to_maplibre branch November 24, 2025 17:10
@SVNKoch
Copy link

SVNKoch commented Dec 31, 2025

That being said there is still some stuff to do:
...

  • re-implementation of GPX track feature (to be discussed)

See #358

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants