Browse Source

google play services error message

Fabio Arnold 9 years ago
parent
commit
5a5316d045

+ 3 - 0
res/values/strings.xml

@@ -30,6 +30,7 @@
     <string name="not_rooted">Your device does not have root access. To unlock full functionality of HosTaGe, a rooted device is required.</string>
     <string name="help">Help</string>
     <string name="confirm">Confirm</string>
+	<string name="ok">OK</string>
     <string name="how">How?</string>
     <string name="portbinder">Portbinder</string>
     <string name="portbinder_tutorial">Video Tutorial</string>
@@ -256,4 +257,6 @@
     <string name="pref_sync_countries_desc">Only download attack data of these countries</string>
     <string name="pref_sync_countries">Countries</string>
     <string name="pref_download_server">Download server</string>
+	<string name="google_play_services_unavailable">Error: Google Play Services are unavailable.
+	</string>
 </resources>

+ 13 - 0
src/de/tudarmstadt/informatik/hostage/ui/fragment/ThreatMapFragment.java

@@ -12,9 +12,11 @@ import android.app.AlertDialog;
 import android.app.Fragment;
 import android.app.FragmentManager;
 import android.content.DialogInterface;
+import android.content.SharedPreferences;
 import android.graphics.Color;
 import android.location.Location;
 import android.os.Bundle;
+import android.text.Html;
 import android.view.InflateException;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -353,6 +355,17 @@ public class ThreatMapFragment extends TrackerFragment implements GoogleMap.OnIn
 						sMap = mapFragment.getMap();
 					}
 				}
+			} else {
+				AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.getInstance());
+				builder.setMessage(Html.fromHtml(getString(R.string.google_play_services_unavailable)))
+						.setCancelable(false)
+						.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
+							public void onClick(DialogInterface dialog, int id) {
+								// :D-|< :D-/< :D-\<
+							}
+						});
+				AlertDialog alert = builder.create();
+				alert.show();
 			}
 		} catch (InflateException e) {
 			// map already exists