Posts Tagged ‘walking’

Discussion: How to add Target Selection for Capture Route Activity

June 27th, 2012    Posted in Discussion

Lots of college stuff was going on, so I wasn’t able to work on Shortest Walking Route for a while.

Now thankfully things have died down.

My first concern is tackling Target Selection for Capture Route Activity:

When the user chooses “Capture Route” on the Home Screen, they should be asked where they are going. When they get to that location Location Service should automatically turn off and play a sound to let the user know.

I’ve thought up a few ways to do the transition and drawn them out, please have a look and comment or message me to let me know what you think of them:

Idea 1: When the user clicks on “Capture Route” it opens Target Selection Activity (an activity with a big map, like Display Routes), which shows the user a Selection List (like the one currently in Display Routes Activity). If the user chooses to create a new target, then the  Selection List dissapears and they choose a location in the view underneath.

Upside: as the use taps on different potential selections I can have the map behind the Selection List zoom to the location they are choosing, this should make it easier to be sure that the right location is being chosen.

Idea 2:  When the user clicks on “Capture Route” it opens a Selection List dialog over the Home screen, in this dialog the user can choose one of the saved targets ore choose to create a new target.

If the user chooses an existing target they go on to Capture Route, if they choose to create a new target they are brought instead to map where they can choose a location to be a target.

Upside: If the user is frequently choosing the same targets then this will skip the Target Selection screen which will make the process of starting a Route Capture quicker.

Idea 3: keep the relationship between Home and Capture Route Activity the same, show the Selection List in Capture Route Activity and pass the user out to Target creation if they they opt to add a new Target.


Please let me know what you think of these ideas, and if you have any other ideas I should be considering.


Comments Off

Version 0.0.11

April 30th, 2012    Posted in Version Update


1. BUGFIX: Fixed bug where Capture Route would stop when it temporarily lost control of the GPS.

2. BUGFIX: FixOpenHelper should no-longer accidentally leave any cursors open.

3. FEATURE: Display Route now shows far fewer GPS fixes in order to reduce jagged lines caused by inaccuracy.

4. FEATURE: Display Route now calculates distance travelled and average speed and displays them.

5. FEATURE: Display Route now spreads it’s RouteItemizedOverlay by distance instead of by number of fixes, this should even them out better.

Download Version 0.0.11


1. Although it was meant to be persistent when the LocationService lost control of the gps system (for example when another application used the GPS while it was running) then it would be automatically restarted but it would not know which route it was recording to. I worked-around this by storing the current route in SharedPreferences and pulling it out again if the service was restarted.

2. I was seeing some warnings about cursors being left open, these were not causing errors because I was closing the Open Helper that created them. I changed how some of my functions in FixOpenHelper were written to stop this by using  DatabaseUtils and closing unneeded cursors.

3. I wanted to start measuring distance and the best way I could think of was to measure the distances between the points and add them up. Before I could do that I had to get rid of points which were scattered all over the place, if I measured those the distance would seem much greater than it was. My solution to this was to edit DisplayRoutesActivity to reject any point that was less than 3 times it’s accuracy away from another point. This straightened the points out nicely.

4. The distance is now measured while the route is being processed to the screen, this is why the full length is only displayed on the final point. The average speed is calculated in FixOpenHelper by using an SQLite function to average all the speed values recorded for the route, because of this it is unlikely that the average speed will match up with the distance and time displayed.

5. Because I now have a measurement of distance I was able to change how my itemspreader (which spreads the clickable dots along the routes) works, previously it placed an Overlay Item every 25 accepted fixes, now it instead places a point whenever it is more than 300m from the last point.

 What’s Next:

  • I’ve been thinking about how I’m going to implement target selection, and the way I see it I’ll need two new tables, I need a table of routes, which will store meta information about the routes, and a table of targets which will store the target locations.
  • Implement a thread to calculate the length of a route after it is recorded.
  • Create a custom dialog for the clickable Overlay Items so I can better separate qualities of the whole route, from qualities of the point selected. I tried to separate these by putting the former into the title of the dialog, but it has a limit to the amount it can contain.
Comments Off

Version 0.0.10 Raphael ‘Satellite’ Savina Edition

April 13th, 2012    Posted in Version Update

A few days ago I was talking to my good friend Raphael Savina and he made a feature request:

Raphael wanted to be able to view his Routes against a satellite image instead of a map.

I had already discovered that you could easily turn satellite images on and off with this code:


So I made a deal with Raphael: if he would draw me a satellite I would write the code and get the version up ASAP.

Raphael promptly supplied me with a lovely drawing of a satellite and I made the necessary changes to DisplayRouteActivity and displayroutes.xml to turn the icon in the titlebar of Display Routes into a functional button.

And the result is Version 0.0.10 of Shortest Walking Route.


I’ve edited all of my icons to better fit into the Menu Icon Guidelines, which has resulted in the application icon going from being slightly bigger than it should be to slightly smaller.

What’s Next:

  • Adding a Target function so you can tell Shortest Walking Route where you are going and have it terminate the gps capture when you get there.
  • Tuning down the number of GPS fixes captured to more efficiently represent a route.
  • Finding more useful information about routes to display
Comments Off

Version 0.0.9

April 8th, 2012    Posted in Version Update

With Version 0.0.9 I have finally implemented a ListView to display new gps fixes as they are captured. This took quite some doing and there a lot of changes because of this.

Now instead of the CaptureRouteActivity taking care of location services they are managed by a custom service called LocationService. When LocationService receives an update it does not directly update the ListView but instead stores the fix in the database and calls:

contentResolver.notifyChange(baseUri, null);

This (through FixProvider) notifies CaptureRouteFragment that an update is available to route which is being displayed in the ListView, CaptureRouteFragment then updates as soon as it can.

Because of these changes Capture Route should now be much more stable and reliable. Also you can now use Capture Route in landscape mode.

On the Display Routes side not much has changed, I have removed the giant burritos from my April Fools gag and fixed a bug where when removing routes the last route would stay visible after you had removed it. (but only until you touched the screen)

This occurred because the command:


Was not being called to let the MapView know that it had changes it needed to display. I have remedied this.

Version 0.0.9 is available for download, and I would greatly appreciate any feedback.

What’s Next:

  • Adding a Target function so you can tell Shortest Walking Route where you are going and have it terminate the gps capture when you get there.
  • Tuning down the number of GPS fixes captured to more efficiently represent a route.
  • Finding more useful information about routes to display
Comments Off