The biggest struggle I've had with mapping in PCDB Waypoints is in drawing the grid lines.  The literature here is very skimpy, and in particular it's not easy to work out what pixel co-ordinates to use to draw something on the portion of the map that is currently on display.  But with the help of a few useful posts on Stack Overflow, I've managed to put together a class called  GridOverlay which extends Overlay and works with maps supported by OSMDroid.  OSMDroid is an alternative to the mapping facilities provided by Google Maps, which are limited to use with only maps provided by Google.  (Goodness knows what Google hope to achieve by that limitation.)  OSMDroid facilities aOverlays are usually used to draw markers of various sorts on the Map.  GridOverlay doesn't store any markers, or Points (as PathOverlay does), and doesn't have any onTap methods.  Instead, it contains a few getters and setters, and a draw() method which does all the work.

You can find the java code of GridOverlay here.

The draw() method calculates the grid size, aiming to get a minimum of two latitude lines within the MapView's current display area.  It draws the grid only on the portion of the map on display, and redraws it each time it is called, so applications using this overlay should call their MapView's invalidate() method after every zoom or scroll action.  It puts the grid latitude or longitude on each grid line, with longitudes displayed vertically.  The format in which these are displayed can be varied.  Supported formats are LLD (degrees and fractions, e.g. 52.03365°), LLDM (degrees, minutes and fractions of minutes, e.g. 004°13.255'W) or LLDMS (degrees, minutes, seconds and fractions of seconds, e.g. 52°13' 4.3").

To include grid lines on your MapView (represented here as mMapView), define a GridOverlay and add it the map's overlays, thus:
public void  drawGridLines()
{
        GridOverlay ol = new GridOverlay(
                     Color.GRAY
                      GridOverlay.LLDM,
                      mResourceProxy);

       ol.setStrokeWidth(1.0f);
        mMapView.getOverlays().add(ol);
}

Define a MapListener handler for the MapView, thus:



mMapView.setMapListener(new MapListener()
 {
         @Override
         public boolean  onZoom(ZoomEvent ev) 
          {
                updateMapPosition();
                mMapView.invalidate();

                return false;
         }

        @Override
        public boolean onScroll(ScrollEvent ev) 
        {
                updateMapPosition();
                mMapView.invalidate();

                return false;
        }
 });

(In my implementation, updateMapPosition() records the map's centre point and co-ordinates in the text boxes to the right hand side, as shown in the screen shots in my previous blog.)
 
There's been a somewhat prolonged hiaitus in this blog during the summer, not all caused by some extended sailing trips.  The olympics is partly to blame!  But I've gone back to the PC version of PCDB Waypoints, and finished the rather tedious task of preloading it with all the information I can find about lighthouses, buoys and beacons around the UK and near European coast.  That is now complete.  I can also take that information (from a Microsoft Access database) and load it into an empty PCDB Waypoints app running on my tablet.  Doable, but somewhat slow.  However, it means that I can really load-test the app on an enormous amount of data before releasing it into the wild.
There's a funny glitch in Androis whereby if I run a number of debug sessions of the same app on the same device, I get a number of identical icons in the Apps screen on the tablet, each corresponding to some terminal state of the app at the end of a debug session.  I've got roughly a screenfull.  I uninstalled PCDB Waypoints and reinstalled it to get rid of those, and then found some errors in the database import process which are now fixed.  So now I can get on with completing the functionality of this app and getting it ready to market.
Along the way, I've uploaded a new version of PCDB SuDuku Solver, at a reduced price.  The new version follows the evolving Android conventions for widget appearance which are designed principally to conserve battery power.  Next, I need to upload the same version of PCDB SuDoku Lite...
Also along the way, Samsung successfully upgraded my tablet from Android 3.2 to 4.0.  I've picked up the latest version of the Eclipse IDE and now need to explore the facilities of both new versions.
 
Recent work on PCDB Waypoints has concentrated on getting it to generate KML ("Keyhole Markup Language") files that can be read by Google Earth.  This is now reasonably successful, at least in the PC version.  I've used it to generate files of the various voyages I've been on over the last 60-odd years, some in my own boat, some on troop ships when my father was in the army after the Second World War, and others in cruises that Elaine and I have enjoyed over the last few years.  Getting it to work wasn't particulary easy, as the documentation is a bit difficult to follow, but I can now follow the routes of each of the voyages I've recorded.  I still need to complete the sework on the Icons used to show the type of waypoint; that's easy but tedious.

The Android version of PCDB Waypoints is coming on apace, but doesn't support this feature yet.  However, I can copy KML files generated on the PC onto my tablet, and with the help of a useful app called "KML to Earth", show a voyage on the tablet's version of Google Earth (I'm running version 7.0).  I won't be taking my PC to Northern Ireland, but the Irish routes are now fully planned out and I can display them all on Google Earth.

Now if I could overlay this data on my Android Navionics app...
 
A bit of a hiatus recently, while Elaine and I spent ten days in France, staying with some friends in Alsace and then a few days in Ornans, near to Besancon.  Not brilliant weather, and somewhat spoilt by Elaine developing a nasty cold and cough which kept her in bed for two days.  But we had some great meals, brought back the odd bottle of Cremant d'Alsace, and saw some wonderful scenery.

I noticed on my return that fully 30 people have now downloaded PCDB SuDoku Lite, and 15 have it still installed.  But no-one, to date, has gone the whole hog and bought the much more sophisticated full version.  Stlll, the tablet market is expanding by the day, and more and more people are discovering the benefits of applications designed to run on tablets rathern than mobile phones.

Work on PCDB Waypoints has focused on tidying up the Import Database feature, so that it isn't possible to invoke it by mistake.  And I've started to look at ways of using data from the app to overlay Google Earth.  It would be even more useful it I could overlay my Navionics charts of the UK and Holland, but Navionics don't seem to be very willing to allow this yet.

A slightly related activity is updating all my charts, and reading up on the pilot books, for our trip to Northern Ireland later in the Summer.  Planning for that is now pretty complete and a full crew arranged, including Chief Seadog Monty.