Coder Social home page Coder Social logo

huki-android's Introduction

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 and currently in open beta stage: HuKi Beta

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.

huki-android's People

Contributors

rolandmostoha avatar

Stargazers

qiufeng avatar Gergely Gombos avatar FreeMolder avatar  avatar János P. avatar ImreSamu avatar György Lantos avatar

Watchers

James Cloos avatar  avatar

huki-android's Issues

'Hiking trails in map' does not update on map move

When you open the Hiking trails in map panel and move the map to another region, this panel is kept open but does not update, hence the information is not in sync with the visible map area. Either the panel should be closed upon map move or the content should be updated.

Sample screen with the error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.