aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/UsefulAppsActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/UsefulAppsActivity.java')
-rw-r--r--main/src/cgeo/geocaching/UsefulAppsActivity.java79
1 files changed, 79 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/UsefulAppsActivity.java b/main/src/cgeo/geocaching/UsefulAppsActivity.java
new file mode 100644
index 0000000..6a08d56
--- /dev/null
+++ b/main/src/cgeo/geocaching/UsefulAppsActivity.java
@@ -0,0 +1,79 @@
+package cgeo.geocaching;
+
+import cgeo.geocaching.activity.AbstractActivity;
+
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.view.View;
+
+import java.util.Locale;
+
+public class UsefulAppsActivity extends AbstractActivity {
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // init
+ setTheme();
+ setContentView(R.layout.helpers);
+ setTitle(res.getString(R.string.helpers));
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+
+ }
+
+ private void installFromMarket(String marketId) {
+ try {
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + marketId)));
+ } catch (Exception e) {
+ // market not available in standard emulator
+ }
+
+ finish();
+ }
+
+ /**
+ * @param view
+ * unused here but needed since this method is referenced from XML layout
+ */
+ public void installManual(View view) {
+ final Locale loc = Locale.getDefault();
+ final String language = loc.getLanguage();
+
+ if ("de".equalsIgnoreCase(language)) {
+ installFromMarket("gnu.android.app.cgeomanual.de");
+ }
+ else {
+ installFromMarket("gnu.android.app.cgeomanual.en");
+ }
+ }
+
+ /**
+ * @param view
+ * unused here but needed since this method is referenced from XML layout
+ */
+ public void installLocus(View view) {
+ installFromMarket("menion.android.locus");
+ }
+
+ /**
+ * @param view
+ * unused here but needed since this method is referenced from XML layout
+ */
+ public void installGpsStatus(View view) {
+ installFromMarket("com.eclipsim.gpsstatus2");
+ }
+
+ /**
+ * @param view
+ * unused here but needed since this method is referenced from XML layout
+ */
+ public void installBluetoothGps(View view) {
+ installFromMarket("googoo.android.btgps");
+ }
+}