aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/res/values/ids.xml1
-rw-r--r--main/res/values/preference_keys.xml1
-rw-r--r--main/res/values/strings.xml1
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java3
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/PebbleApp.java44
5 files changed, 49 insertions, 1 deletions
diff --git a/main/res/values/ids.xml b/main/res/values/ids.xml
index 4e02973..8539275 100644
--- a/main/res/values/ids.xml
+++ b/main/res/values/ids.xml
@@ -23,5 +23,6 @@
<item name="cache_app_download_static_maps" type="id"/>
<item name="cache_app_show_static_maps" type="id"/>
<item name="cache_app_locus" type="id"/>
+ <item name="cache_app_pebble" type="id"/>
</resources> \ No newline at end of file
diff --git a/main/res/values/preference_keys.xml b/main/res/values/preference_keys.xml
index e11f5c1..0e4675d 100644
--- a/main/res/values/preference_keys.xml
+++ b/main/res/values/preference_keys.xml
@@ -120,6 +120,7 @@
<string name="pref_navigation_menu_cache_beacon">navigationCacheBeacon</string>
<string name="pref_navigation_menu_gcc">navigationGcc</string>
<string name="pref_navigation_menu_where_you_go">navigationWhereYouGo</string>
+ <string name="pref_navigation_menu_pebble">navigationPebble</string>
<string name="pref_ocpl_tokensecret">ocpl_tokensecret</string>
<string name="pref_ocpl_tokenpublic">ocpl_tokenpublic</string>
<string name="pref_temp_ocpl_token_secret">ocpl-temp-token-secret</string>
diff --git a/main/res/values/strings.xml b/main/res/values/strings.xml
index d05e52e..385bec3 100644
--- a/main/res/values/strings.xml
+++ b/main/res/values/strings.xml
@@ -691,6 +691,7 @@
<string name="cache_menu_oruxmaps">OruxMaps</string>
<string name="cache_menu_cachebeacon">Cache Beacon</string>
<string name="cache_menu_navigon">Navigon</string>
+ <string name="cache_menu_pebble">Pebble</string>
<string name="cache_status">Status</string>
<string name="cache_status_offline_log">Saved Log</string>
<string name="cache_status_found">Found</string>
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
index aae3c43..bf0e776 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
@@ -71,7 +71,8 @@ public final class NavigationAppFactory extends AbstractAppFactory {
CACHE_BEACON(new CacheBeaconApp(), 14, R.string.pref_navigation_menu_cache_beacon),
GCC(new GccApp(), 15, R.string.pref_navigation_menu_gcc),
- WHERE_YOU_GO(new WhereYouGoApp(), 16, R.string.pref_navigation_menu_where_you_go);
+ WHERE_YOU_GO(new WhereYouGoApp(), 16, R.string.pref_navigation_menu_where_you_go),
+ PEBBLE(new PebbleApp(), 17, R.string.pref_navigation_menu_pebble);
NavigationAppsEnum(final App app, final int id, final int preferenceKey) {
this.app = app;
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/PebbleApp.java b/main/src/cgeo/geocaching/apps/cache/navi/PebbleApp.java
new file mode 100644
index 0000000..8ba3bef
--- /dev/null
+++ b/main/src/cgeo/geocaching/apps/cache/navi/PebbleApp.java
@@ -0,0 +1,44 @@
+package cgeo.geocaching.apps.cache.navi;
+
+import cgeo.geocaching.Geocache;
+import cgeo.geocaching.R;
+import cgeo.geocaching.geopoint.Geopoint;
+
+import android.app.Activity;
+import android.content.Intent;
+
+/**
+ * Application for communication with the Pebble watch.
+ *
+ */
+class PebbleApp extends AbstractPointNavigationApp {
+
+ private static final String INTENT = "com.webmajstr.pebble_gc.NAVIGATE_TO";
+ private static final String PACKAGE_NAME = "com.webmajstr.pebble_gc";
+
+ PebbleApp() {
+ super(getString(R.string.cache_menu_pebble), R.id.cache_app_pebble, INTENT, PACKAGE_NAME);
+ }
+
+ @Override
+ public void navigate(Activity activity, Geopoint point) {
+ final Intent pebbleIntent = new Intent(INTENT);
+ pebbleIntent.putExtra("latitude", point.getLatitude());
+ pebbleIntent.putExtra("longitude", point.getLongitude());
+ activity.startActivity(pebbleIntent);
+ }
+
+ @Override
+ public void navigate(Activity activity, Geocache cache) {
+ final Intent pebbleIntent = new Intent(INTENT);
+ pebbleIntent.putExtra("latitude", cache.getCoords().getLatitude());
+ pebbleIntent.putExtra("longitude", cache.getCoords().getLongitude());
+ pebbleIntent.putExtra("difficulty", cache.getDifficulty());
+ pebbleIntent.putExtra("terrain", cache.getTerrain());
+ pebbleIntent.putExtra("name", cache.getName());
+ pebbleIntent.putExtra("code", cache.getGeocode());
+ pebbleIntent.putExtra("size", cache.getSize().getL10n());
+ activity.startActivity(pebbleIntent);
+ }
+
+} \ No newline at end of file