Skip to content

Demo Android Java app that tracks GPS coordinates as a foreground service

Notifications You must be signed in to change notification settings

fullStackOasis/demo-gps-tracking-foreground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android GPS tracker

This is a simple Android app written in Java that lets you track your GPS history. It's a proof of concept that allows you to open an app, start storing GPS coordinates, then minimize the app and use your mobile device for other things (phone calls, texting, and so on). This app won't be shut down because it runs a "foreground service". Quoting the documentation: The "system considers [the app] to be something the user is actively aware of and thus not a candidate for killing when low on memory. (It is still theoretically possible for the service to be killed under extreme memory pressure from the current foreground application, but in practice this should not be a concern.)"

Latitude, longitude pairs are stored and displayed in a list. The list can be as long as you want it to be. In this demo, it's 250 points.

You can click a lat+long pair in the displayed list, when the app is opened, and you'll get taken to a Google Map via "deep linking".

This is just a proof of concept! That means there are some things that aren't done "properly". In particular, data storage isn't handled well. The foreground service is in charge of a queue of GPS coordinates. If that service ends, your data goes poof. The UI is really very simple and could use additional work; it might be wise to replace this with a RecyclerView. But for now, the app is working fine for me.

Caveat

The app will break when you first add it to Android Studio, because it needs a png file. You can add your own png, and that should fix the issue.

Screenshot

GPS tracker app

Video of the App

And here's a link to a YouTube video that shows the working app.

About

Demo Android Java app that tracks GPS coordinates as a foreground service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages