diff --git a/apk/GPSLogger-2.1.2.apk b/apk/GPSLogger-2.1.2.apk new file mode 100644 index 00000000..6c0fce40 Binary files /dev/null and b/apk/GPSLogger-2.1.2.apk differ diff --git a/apk/GPSLogger-latest.apk b/apk/GPSLogger-latest.apk deleted file mode 100644 index c340673a..00000000 Binary files a/apk/GPSLogger-latest.apk and /dev/null differ diff --git a/apk/GPSLogger-latest.apk b/apk/GPSLogger-latest.apk new file mode 120000 index 00000000..0c6b7c64 --- /dev/null +++ b/apk/GPSLogger-latest.apk @@ -0,0 +1 @@ +/home/Graziano/GrazianoCapelli/GPSLogger/apk/GPSLogger-2.1.2.apk \ No newline at end of file diff --git a/app/app.iml b/app/app.iml index e42a9f26..fb37f4b1 100644 --- a/app/app.iml +++ b/app/app.iml @@ -66,14 +66,6 @@ - - - - - - - - @@ -82,6 +74,14 @@ + + + + + + + + diff --git a/app/build.gradle b/app/build.gradle index 2d272077..c9930560 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "eu.basicairdata.graziano.gpslogger" minSdkVersion 8 targetSdkVersion 23 - versionCode 12 - versionName '2.1.1' + versionCode 13 + versionName '2.1.2' } buildTypes { release { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1afe0476..357f710d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -36,19 +36,22 @@ android:icon="@mipmap/gps_logger" android:label="@string/app_name" android:supportsRtl="true" - android:alwaysRetainTaskState="true" - android:launchMode="singleInstance" android:theme="@style/MyMaterialTheme"> - + - + + 0) - || (GPSApplication.getInstance().getCurrentTrack().getNumberOfPlacemarks() > 0)) { - - AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.StyledDialog)); - builder.setMessage(getResources().getString(R.string.message_exit_confirmation)); - builder.setIcon(android.R.drawable.ic_menu_info_details); - builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - GPSApplication.getInstance().setRecording(false); - EventBus.getDefault().post("NEW_TRACK"); - GPSApplication.getInstance().StopAndUnbindGPSService(); - //super.onBackPressed(); - dialog.dismiss(); - finish(); - } - }); - builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int id) { - dialog.dismiss(); - } - }); - AlertDialog dialog = builder.create(); - dialog.show(); - } else { - GPSApplication.getInstance().StopAndUnbindGPSService(); - //super.onBackPressed(); - finish(); - } + ShutdownApp(); } @Override @@ -226,6 +199,10 @@ public boolean onOptionsItemSelected(MenuItem item) { aboutDialog.show(fm, ""); return true; } + if (id == R.id.action_shutdown) { + ShutdownApp(); + return true; + } return super.onOptionsItemSelected(item); } @@ -309,6 +286,43 @@ private void LoadPreferences() { else getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } + private void ShutdownApp() + { + if ((GPSApplication.getInstance().getCurrentTrack().getNumberOfLocations() > 0) + || (GPSApplication.getInstance().getCurrentTrack().getNumberOfPlacemarks() > 0) + || (GPSApplication.getInstance().getRecording()) + || (GPSApplication.getInstance().getPlacemarkRequest())) { + + AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.StyledDialog)); + builder.setMessage(getResources().getString(R.string.message_exit_confirmation)); + builder.setIcon(android.R.drawable.ic_menu_info_details); + builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + GPSApplication.getInstance().setRecording(false); + GPSApplication.getInstance().setPlacemarkRequest(false); + EventBus.getDefault().post("NEW_TRACK"); + GPSApplication.getInstance().StopAndUnbindGPSService(); + + dialog.dismiss(); + finish(); + } + }); + builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + dialog.dismiss(); + } + }); + AlertDialog dialog = builder.create(); + dialog.show(); + } else { + GPSApplication.getInstance().setRecording(false); + GPSApplication.getInstance().setPlacemarkRequest(false); + GPSApplication.getInstance().StopAndUnbindGPSService(); + + finish(); + } + } + public void CheckPermissions () { List listPermissionsNeeded = new ArrayList<>(); diff --git a/app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java b/app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java index 8104a98c..22abf0d2 100644 --- a/app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java +++ b/app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java @@ -701,7 +701,7 @@ private void LoadPreferences() { Log.w("myApp", "[#] GPSApplication.java - Manual Correction set to " + prefAltitudeCorrection + " m"); prefExportKML = preferences.getBoolean("prefExportKML", true); prefExportGPX = preferences.getBoolean("prefExportGPX", true); - prefKMLAltitudeMode = Integer.valueOf(preferences.getString("prefKMLAltitudeMode", "0")); + prefKMLAltitudeMode = Integer.valueOf(preferences.getString("prefKMLAltitudeMode", "1")); prefShowTrackStatsType = Integer.valueOf(preferences.getString("prefShowTrackStatsType", "0")); prefShowDirections = Integer.valueOf(preferences.getString("prefShowDirections", "0")); diff --git a/app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSService.java b/app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSService.java index fe4de9c0..5cbf5a4f 100644 --- a/app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSService.java +++ b/app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSService.java @@ -53,8 +53,9 @@ private Notification getNotification() { final Intent startIntent = new Intent(getApplicationContext(), GPSActivity.class); startIntent.setAction(Intent.ACTION_MAIN); startIntent.addCategory(Intent.CATEGORY_LAUNCHER); - startIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - PendingIntent contentIntent = PendingIntent.getActivity(this, 1, startIntent, 0); + //startIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); + PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 1, startIntent, 0); builder.setContentIntent(contentIntent); Notification notification = builder.build(); return notification; @@ -79,6 +80,7 @@ public void run() { public void onCreate() { super.onCreate(); singleton = this; + // THREAD FOR DEBUG PURPOSE //if (!t.isAlive()) { // t.start(); //} @@ -102,6 +104,7 @@ public IBinder onBind(Intent intent) { @Override public void onDestroy() { Log.w("myApp", "[#] GPSService.java - DESTROY = onDestroy"); + // THREAD FOR DEBUG PURPOSE //if (t.isAlive()) t.interrupt(); super.onDestroy(); } diff --git a/app/src/main/java/eu/basicairdata/graziano/gpslogger/Track.java b/app/src/main/java/eu/basicairdata/graziano/gpslogger/Track.java index f0362b39..72b73e9a 100644 --- a/app/src/main/java/eu/basicairdata/graziano/gpslogger/Track.java +++ b/app/src/main/java/eu/basicairdata/graziano/gpslogger/Track.java @@ -950,7 +950,7 @@ public int getTrackType() { if ((Altitude_Up != NOT_AVAILABLE) && (Altitude_Down != NOT_AVAILABLE)) if ((Altitude_Down + Altitude_Up > (0.1f * Distance)) && (Distance > 500.0f)) return TRACK_TYPE_MOUNTAIN; - else return TRACK_TYPE_RUN; + else return TRACK_TYPE_WALK; } } if ((Altitude_Up != NOT_AVAILABLE) && (Altitude_Down != NOT_AVAILABLE)) diff --git a/app/src/main/res/menu/main_menu.xml b/app/src/main/res/menu/main_menu.xml index 75aa993a..4964f869 100644 --- a/app/src/main/res/menu/main_menu.xml +++ b/app/src/main/res/menu/main_menu.xml @@ -33,6 +33,11 @@ android:orderInCategory="101" android:title="@string/menu_about" app:showAsAction="never" /> + Double click to finish this track Track saved into the Tracklist About + Shutdown Add Placemark @@ -141,7 +142,6 @@ Offset No offset defined - EXPORTING Export Tracks in KML Google Keyhole Markup Language (v.2.2) @@ -154,6 +154,8 @@ Total time Moving time + + We suggest to switch to Absolute Altitude Mode, to view your tracks in 3D in Google Earth. \n\nYou can switch anytime between Absolute and Projected to ground in the Exporting section of Settings. Download error diff --git a/app/src/main/res/xml/app_preferences.xml b/app/src/main/res/xml/app_preferences.xml index 88623e8f..18edcd4b 100644 --- a/app/src/main/res/xml/app_preferences.xml +++ b/app/src/main/res/xml/app_preferences.xml @@ -130,7 +130,7 @@ android:summary=" " android:entries="@array/KMLAltitudeMode" android:entryValues="@array/KMLAltitudeModeValues" - android:defaultValue="0" /> + android:defaultValue="1" /> diff --git a/sourcecode/GPSLogger-2.1.2 - Source.zip b/sourcecode/GPSLogger-2.1.2 - Source.zip new file mode 100644 index 00000000..a0c5b701 Binary files /dev/null and b/sourcecode/GPSLogger-2.1.2 - Source.zip differ