Close

Updating App's GPS Location Usage

A project log for Ariadne Headband

Arduino-based heaband that uses haptic feedback to navigate blind people. Controlled via Bluetooth using Android app.

Vojtech PavlovskyVojtech Pavlovsky 09/18/2018 at 19:180 Comments

Hello fellow hackers! We want to say that we are extremely happy that we can be part of Hackaday Prize 2018. It warms our hearts knowing that people are interested in our project and are even willing to like us or follow us. With many new bought hardware upgrades on way to us, I decided to begin new work on our open-sourced Android app in the meanwhile.

Until now, Ariadne Headband app would query user’s location only when he opened map and tried to select destination. This was suitable for early stages of development, because we did not need to keep GPS active. You would simply select destination, wait until the app would find your location and press Start navigating. App would send the azimuth to the headband and you could go.

However, this approach is not very good when you move. While selected destination is static, your location will change. This means that azimuth can change too. So it was time to implement location tracking to keep the azimuth updated wherever you go. This change will also move us closer to the real-time navigation that will also need to track your position while you move.

I added Location Service file that keeps an eye on your location. Right now, the Location Service is started right on app startup. This is because getting your accurate GPS location can take a unpleasant while. From my testing it can vary between 5 seconds to even 2 minutes and it heavily depends where you are (building or under clear sky) and also when you last used location on your phone. While Android has a feature to use last known location that can shorten up this time for first pinpointing, it will reset each time you turn GPS off and on.

From the technical perspective, we are using FusedLocationProviderClient library. That is official Google’s Android library that should be used over Android’s native GPS location library. Instead of choosing which way you want to get your location (GPS vs Network) you will choose between different levels of accuracy. FLPC will then combine multiple location sources and try to get best available location while optimizing battery usage. For our purposes we use HIGH ACCURACY mode so most of the time, app will use mainly GPS. Precision depends on your phone but is somewhere around few meters.

It is also worth noting that we use Foreground service to track user’s location. This is special type of Android class that will keep running even when you switch app or lock your phone. So you can start navigation and put phone into pocket and will still keep your location updated. Foreground service requires to show a system notification so user know some process is running on background, because it will probably consume battery life. You can see the fancy notification on screenshot below.

We are using only phone GPS module because we think that they are on par with dedicated ones you can buy. It will also lower the price of Ariadne Headband because most of the people already own a smartphone.

I have a lot more improvements planned for our app. New school has just started for me and Tomas so we try to work hard in our free time to make project Ariadne Headband even better. Even though having less time for this project than before, we are now determined more than ever to make Headband fully working and operational. We hope that our project might once help those who are not so fortunate as we are. Or everyone who could possible find a good use of Ariadne Headband.

Discussions