<NME> CompassApp.java
<BEF> ADDFILE
<MSG> Merge pull request #925 from RoadRunner-/master

Implementation for #868: Select default navigation  tool
<DFF> @@ -0,0 +1,47 @@
+package cgeo.geocaching.apps.cache.navi;
+
+import cgeo.geocaching.R;
+import cgeo.geocaching.SearchResult;
+import cgeo.geocaching.cgCache;
+import cgeo.geocaching.cgGeo;
+import cgeo.geocaching.cgWaypoint;
+import cgeo.geocaching.cgeonavigate;
+import cgeo.geocaching.geopoint.Geopoint;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.res.Resources;
+
+class CompassApp extends AbstractNavigationApp {
+
+    CompassApp(final Resources res) {
+        super(res.getString(R.string.compass_title), null);
+    }
+
+    @Override
+    public boolean isInstalled(Context context) {
+        return true;
+    }
+
+    @Override
+    public boolean invoke(cgGeo geo, Activity activity, Resources res,
+            cgCache cache,
+            final SearchResult search, cgWaypoint waypoint, final Geopoint coords) {
+
+        if (cache != null && cache.getGeocode() != null) {
+            cgeonavigate.startActivity(activity, cache.getGeocode(), cache.getName(), cache.getCoords(), null);
+            return true;
+        }
+        if (waypoint != null && waypoint.getCoords() != null) {
+            cgeonavigate.startActivity(activity, waypoint.getPrefix().trim() + "/" + waypoint.getLookup().trim(), waypoint.getName(), waypoint.getCoords(), null);
+            return true;
+        }
+        if (coords != null) {
+            cgeonavigate.startActivity(activity, res.getString(R.string.navigation_direct_navigation), res.getString(R.string.navigation_target), coords, null);
+            return true;
+        }
+        // search is not handled here
+        return false;
+    }
+
+}
\ No newline at end of file

Merge pull request #925 from RoadRunner-/master