Skip to content

RolandMostoha/HuKi-Android

Repository files navigation

HuKi - Hungarian Hiking Map

HuKi is an Android app for hikers, which helps you plan trips and discover the hiking trails of Hungary.

The app is available in Google Play: HuKi - Hungarian Hiking App

Goals

The project was born for two primary reasons:

  1. My personal entertainment - it's my beloved pet project in which I can try out Android stuff outside of my job.
  2. It comes in handy for hikers to have trips in Hungary. No need to download tiles or setup layers manually.

The inspiration of the project was turistautak.openstreetmap.hu, I've been using their webapp since I started hiking.

Screenshots

Screenshot HuKi 1 Screenshot HuKi 2 Screenshot HuKi 3

Graphhopper support

The route planner function is powered and supported by Graphhopper, it uses the cloud version of the Routing API for creating navigation plans.

Huge thanks to the Graphhopper team for the opportunity!

What is it good for

  • Out-of-the-box integration with the Hungarian hiking trails
  • Free-text search for places in OpenStreetMap databases
  • Landscapes, routes-nearby function
  • Current location monitoring with elevation support
  • Route planner
  • Importing and displaying routes from GPX files
  • Dark mode support

What is it NOT good for

  • Custom layers with styles - Locus, OsmAnd are perfect choices for advanced layer customization.
  • Recording hikes - Almost every fitness tracker/watch has its own functionality in this regard.
  • Pre-recorded hike collection - Természetjáró for president.
  • Community based hike sharing - AllTrails, Komoot etc.

How does it work

Tile server optimization

Since the hiking tiles are hosted in an AWS S3 bucket funded by me, I had to make some preliminary optimization to reduce the cost of the service.

  1. The S3 bucket is only accessible by my app via Amazon Amplify
  2. The hiking tiles are synced by TuraReteg.sqlitedb every month
  3. The app uses a local tile range map created by the TuraReteg database to avoid unnecessary requests of empty tiles
  4. 14 days cache mechanism is applied by the OsmDroid tile renderer.
  5. The app also caches the empty tiles (HTTP 404 responses also count as paid S3 requests)

In the future I may have to make additional changes or re-consider the current setup completely based on the server costs.

Architecture

The project is my playground, and I don't like to be overly-attached to a specific architecture, but the currently used stack can be summarized by:

Component Responsibilities Key classes
Activity The project currently contains a single screen without fragments or navigation. HomeActivity
ViewModel It provides the data for the UI via multiple StateFlow streams (MVVM approach). It requests the data from the Interactor and maps domain models to UI models. HomeViewModel
Interactor It converts direct suspendnetwork calls to Flow streams and calls Repository functions. HikingLayerInteractor, LandscapeInteractor
Repository Fetches the data through the network or local repository via suspend functions while mapping network models to domain models. OsmPlacesRepository, FileBasedHikingLayerRepository

Integration & Delivery

The project uses GitHub Actions to ensure code quality and to automatically deploy to Google Play Store.

I'm a big fan of testing so the project is fairly covered with Unit and Instrumentation tests.

The following steps are running on the CI server on master push:

  • Detekt
  • Android lint
  • Unit tests
  • Instrumentation tests on Firebase Test Lab (using two devices with minApi and targetApi)
  • Auto-versioning of the apks
  • Release app signing
  • Publishing to Google Play Store with release notes

Release steps

Contributions

Since the project is still in its early stages, I would be happy to receive ideas, advices or even a code review :)

  • If you've found a bug, please file an issue.
  • If you want to be a contributor, please reach out to me.

External licenses

The app is built upon many OpenStreetMap related services. There is an in-app licences dialog that can be shown by clicking © OpenStreetMap contributors on the map view.

Licence resources

Project License

MIT License

Copyright (c) 2020-2023 Roland Mostoha

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published