Archive for March, 2012
Just a quick post to link to the latest version.
Just a little update this time.
I noticed a problem with the Capture Route ending routes and starting a new one when the next GPS fix arrived.
This was caused by a bit of code I put in to the onStop() to clean up when the application was killed from the outside. I’ve moved this to the onDestroy() which should still retain the function without disrupting how the application is working. This change brought to you by the Android Activity Lifecycle.
I’ve also added a persistent notification to be displayed while Capture Route is running. This should help prevent people accidentally leaving the GPS capture running and wasting battery life.
Unfortunately because I implemented the notification using a future compatible tool called NotificationCompat.Builder, it has tripled the size of Shortest Walking Route to 161.22kb.
So please, download and install Version 0.0.6 and let me know what problems you find or features you want.
Back to work on filtering out inaccurate results and getting the paths to display information about themselves when they are tapped.
Quite a few updates in this version:
Capture Route now has a Start/Stop Button at the top which will allow you to record routes as long as you like.
I’ve now implemented Display Routes, which can be accessed from SWR’s home screen once you have captured at least one route with Capture Route.
Display Routes will allow you to select the routes you want to see and it will draw them to screen in random colours. Unfortunately the colours are not stored, so every time you change your selections the colours will be randomly changed.
The route selection is done with this alert dialog which is set to always appear in the top right corner of the screen. This is to allow users on larger devices like Android Tablets to see the changes they are making on the map while they are making them.
These choices are persistently stored in Android’s Shared Preferences as characters in a String, which is my way of getting around the fact that Android does not allow arrays to be stored in Shared Preferences.
Please give Version 0.0.5 a go and let me know if you run into any issues.
If you are interested in how this application works please follow the link to GitHub on the right-hand side of the screen. The full source-code is available there. If any part of it is unclear to you, please let me know.
- Capture Route has no way of stopping itself yet, and there is no notification to tell you it is running in the background. If you have it running you will see the icon to tell you that GPS is running.
- I’m not filtering or smoothing the routes when placing them on the map, so you will see some very low-accuracy data and jagged, indirect lines.
- Later on I’m going to be changing this so all routes will have a target and the data you record with this version will have to be discarded, so don’t record anything you want to keep forever!
- I need to work on getting information about the routes to pop-up when you tap on them.
- I’ll also be looking at cleaning up the routes when they are displayed. (I think not displaying the very poor accuracy fixes will be a good starting place).
This version sees the SQLite Database being written to and a value being read from it.
Now the database has all of the GPS fixes written to it.
When CaptureRoute starts a new Route it will read the highest Route Number stored in the database and record the new Route as 1 more than that.
The notification ( called a toast, because it pops up) will let you know the new Route Number.
Also there is now a Progress Spinner on the top bar of Capture Route to let you know that it is still running and I have disabled screen rotation to stop it from restarting. (After I have switched the main content display from a TableView to a ListView I will come back and have a look at getting it to work in landscape mode)
This installer is hosted on dev-host.org because I still can’t figure out how to host files on this website.
I chose dev-host because:
- they don’t throw captcha’s at you
- they aim there service at legitimate file owners
- their ads are relatively unobtrusive
I’ve actually been working on 0.0.5 for some time already, so look forward to:
- Recording GPS Fixes for longer than 60 seconds
- Finally seeing something on a map
- More pretty icons and interface