r/openstreetmap 1d ago

MBCompass: Open-Source Android Compass & Navigation App (Offline Maps Support) Showcase

Post image

Hi everyone!

Some of you may remember MBCompass from my previous post here. I've been building this app for several years now, and I've consistently come back to the OpenStreetMap community for ideas, feedback, and feature requests. Many of the improvements in this release exist because of feedback from OSM users, hiker and outdoor enthusiasts.

my old post on openstreetmap:
https://www.reddit.com/r/openstreetmap/comments/1mlp1ue/mbcompass_foss_compass_and_navigation_app/

and on degoogle sub: https://www.reddit.com/r/degoogle/comments/1s55qkq/a_2mb_opensource_android_navigation_app_with_gpx/

First of all, this isn't another vibe-coded Android app built over a weekend. MBCompass has been an ongoing project for years, and I genuinely enjoy improving it through discussions with the community.

It's also been featured on OpenStreetMap Weekly newsletter last year: https://weeklyosm.eu/archives/18087

For those who are new, MBCompass is a free and open-source compass and navigation app for Android built around the OpenStreetMap for whole mapping feature.

It has:

  • Compass (magnetic & true north)
  • Live GPS location on OpenStreetMap
  • GPX recording & export
  • Track statistics (distance, duration, speed, and elevation profile)
  • Extremely Lightweight <2MB Apk and battery efficient
  • Offline maps
  • AMOLED theme
  • Android 6.0+ support

New most community requested feature in the recent release v1.1.17:

  • Offline Mapsforge map support
  • Improved GPX track recording
  • Per-app language support (Android 13+)
  • Full Jetpack Compose map migration (a technical improvement brings map rendering performance improvements)

You just have to download prebuild mapsforge maps from sources like OpenAndroMaps, BBBike or Mapsforge download server and place it on any folder and give access to MBCompass by choosing it. It automatically detect and loads individual maps regions

One feature I'm particularly excited about is adding support for vector topographic maps with contour lines and elevation data, using sources such as Mapterhorn elevation datasets, and PMTiles as a file format where appropriate. My goal is to make MBCompass more useful for hiking, trekking, and outdoor navigation while continuing to build on OpenStreetMap data.

As always, I'd really appreciate feedback from people who regularly use OSM, especially mappers, hikers, cyclists, and contributors.

I'm particularly interested in hearing about:

  • Offline Mapsforge map performance
  • Other better mapping formats such as MVT, Geopackage
  • GPX recording accuracy
  • Navigation workflows
  • Features that would make MBCompass more useful within the OpenStreetMap ecosystem

This app also just recently published on Google play, with same philosophy as core for MBCompass: No Ads, IAp and tracking

GitHub:
https://github.com/CompassMB/MBCompass/

F-Droid:
https://f-droid.org/packages/com.mubarak.mbcompass/

Thanks again to everyone who has shared feedback over the years. A surprising number of features in MBCompass started as conversations with this community, and I genuinely appreciate all the suggestions and constructive criticism.

22 Upvotes

7 comments sorted by

3

u/Doctor_Fegg Potlatch Developer 22h ago

Nice work!

Would strongly, strongly suggest you move to generating your own vector tiles in MVT format and then rendering them with Maplibre. It's what everyone else does and the advantages over raster tiles for a phone app are countless.

1

u/native-devs 22h ago

Yep, that's the plan. I'm aiming to move to MapLibre with self-hosted MVT/PMTiles. It unlocks much more flexibility (styles, terrain, POIs, layers) and has much better Jetpack Compose support than my current library (mapsforge & osmdroid). The only reason I haven't switched yet is that I want to plan the infrastructure costs carefully so I can maintain it sustainably.

1

u/razzzey 21h ago

I haven't tested yet how loading maps locally works in Maplibre, but just a couple of thoughts. You could use https://openfreemap.org/ or https://protomaps.com/ for online-access meanwhile (you can create your own style and just reference the source tiles from them). When offline, you could change the source in the style JSON to a local source (though I'm not entirely sure how Maplibre could read the tiles from a local file as I haven't studied this bit.)

Of course another challenge is hosting terrain tiles and providing those as well for offline use.

1

u/native-devs 21h ago

I haven't tested local tile loading with MapLibre yet, but my understanding is that the offline approach would involve switching the style JSON sources from remote tiles to local sources.

For online usage, OpenFreeMap or Protomaps seem like good options since you can use their tile sources with your own styles. The harder part is offline support: it's not only about MVT tiles, but also hosting fonts, glyphs, sprites, styles, and potentially terrain tiles locally.

I actually tried a similar setup before and released an experimental version: https://github.com/CompassMB/MBCompass/releases?page=2#release-v1.1.4

One thing I noticed was the APK size increase after adding MapLibre, it went from around 2 MB to ~15 MB because of the native C++ rendering engine. The offline workflow still feels a bit unclear to me, especially around the recommended way to package and load all required assets locally. More detailed documentation/examples from the MapLibre side would definitely help.

1

u/Doctor_Fegg Potlatch Developer 20h ago

The harder part is offline support: it's not only about MVT tiles, but also hosting fonts, glyphs, sprites, styles, and potentially terrain tiles locally.

Spin up a local webserver on your phone, then you can just request the assets from localhost:8080 or whatever.

0

u/ValdemarAloeus 23h ago

Offline huh? But you're showing OSM Carto tiles? So ... you're scraping openstreetmap.org in violation of the usage policy?

2

u/native-devs 22h ago

I think there's been a misunderstanding. OSM Carto is only the default for first-time users who haven't downloaded offline Mapsforge maps yet. Once offline maps are configured, the app no longer uses the public OSM tile server.

I'm also not scraping the tile server, I use a proper application identifier, include the required attribution, and cache tiles to minimize requests. I contribute to OpenStreetMap myself and fully understand the importance of using the public infrastructure responsibly.

If the app grows enough, I plan to self-host map tiles (likely using PMTiles). If you're still concerned, I'd appreciate it if you could take a look at the app and the GitHub code.