Skip to content

Commit

Permalink
Update to v2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Graziano Capelli authored and Graziano Capelli committed Dec 11, 2016
1 parent f6e5974 commit 4640392
Show file tree
Hide file tree
Showing 54 changed files with 107 additions and 51 deletions.
Binary file added apk/GPSLogger-2.1.2.apk
Binary file not shown.
Binary file removed apk/GPSLogger-latest.apk
Binary file not shown.
1 change: 1 addition & 0 deletions apk/GPSLogger-latest.apk
16 changes: 8 additions & 8 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
Expand All @@ -82,6 +74,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
15 changes: 9 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<activity android:name=".GPSActivity">
<activity android:name=".GPSActivity"
android:label="@string/app_name"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN"
android:launchMode="singleInstance"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SettingsActivity"
android:launchMode="singleInstance"
android:label="@string/menu_settings"
android:launchMode="singleTask"
android:configChanges="orientation|screenSize">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".GPSActivity" />
</activity>
<service
android:name=".GPSService"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AlertDialog;
import android.support.v7.preference.EditTextPreference;
import android.support.v7.preference.ListPreference;
import android.support.v7.preference.PreferenceFragmentCompat;
import android.support.v7.preference.PreferenceManager;
import android.support.v7.preference.SwitchPreferenceCompat;
import android.support.v7.view.ContextThemeWrapper;
import android.util.Log;
import android.widget.Toast;

Expand Down Expand Up @@ -62,7 +64,7 @@ public class FragmentSettings extends PreferenceFragmentCompat {
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setRetainInstance(true);

addPreferencesFromResource(R.xml.app_preferences);

File tsd = new File(Environment.getExternalStorageDirectory() + "/GPSLogger");
Expand Down Expand Up @@ -354,6 +356,33 @@ protected void onPostExecute(String result) {
Downloaded = true;
Toast.makeText(context, getString(R.string.toast_download_completed), Toast.LENGTH_SHORT).show();
PrefEGM96SetToTrue();

// Ask to switch to Absolute Altitude Mode if not already active.
ListPreference pKMLAltitudeMode = (ListPreference) findPreference("prefKMLAltitudeMode");
if (!(pKMLAltitudeMode.getValue().equals("0"))) {
AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(getContext(), R.style.StyledDialog));
builder.setMessage(getResources().getString(R.string.pref_message_switch_to_absolute_altitude_mode));
builder.setIcon(android.R.drawable.ic_menu_info_details);
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getContext());
SharedPreferences.Editor editor1 = settings.edit();
editor1.putString("prefKMLAltitudeMode", "0");
editor1.commit();
ListPreference pKMLAltitudeMode = (ListPreference) findPreference("prefKMLAltitudeMode");
pKMLAltitudeMode.setValue("0");
pKMLAltitudeMode.setSummary(R.string.pref_KML_altitude_mode_absolute);
}
});
builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog dialog = builder.create();
dialog.show();
}

} else {
Toast.makeText(context, getString(R.string.toast_download_failed), Toast.LENGTH_SHORT).show();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,34 +145,7 @@ public void onPause() {
@Override
public void onBackPressed() {
//moveTaskToBack(true);
if ((GPSApplication.getInstance().getCurrentTrack().getNumberOfLocations() > 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
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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<String> listPermissionsNeeded = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -79,6 +80,7 @@ public void run() {
public void onCreate() {
super.onCreate();
singleton = this;
// THREAD FOR DEBUG PURPOSE
//if (!t.isAlive()) {
// t.start();
//}
Expand All @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/menu/main_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
android:orderInCategory="101"
android:title="@string/menu_about"
app:showAsAction="never" />
<item
android:id="@+id/action_shutdown"
android:orderInCategory="102"
android:title="@string/menu_shutdown"
app:showAsAction="never" />

<item
android:id="@+id/action_track_finished"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-hdpi/ic_save_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-mdpi/ic_save_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/mipmap-xhdpi/ic_save_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<string name="toast_track_finished_click_again">Double click to finish this track</string>
<string name="toast_track_saved_into_tracklist">Track saved into the Tracklist</string>
<string name="menu_about">About</string>
<string name="menu_shutdown">Shutdown</string>

<!-- Placemark Creation dialog -->
<string name="dlg_add_placemark">Add Placemark</string>
Expand Down Expand Up @@ -141,7 +142,6 @@
<string name="pref_AltitudeCorrection_summary_offset">Offset</string>
<string name="pref_AltitudeCorrection_summary_not_defined">No offset defined</string>


<string name="pref_category_exporting">EXPORTING</string>
<string name="pref_export_KML">Export Tracks in KML</string>
<string name="pref_export_KML_summary">Google Keyhole Markup Language (v.2.2)</string>
Expand All @@ -154,6 +154,8 @@
<string name="pref_track_stats_totaltime">Total time</string>
<string name="pref_track_stats_movingtime">Moving time</string>

<!-- Preferences messages -->
<string name="pref_message_switch_to_absolute_altitude_mode">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.</string>

<!-- Preferences toasts -->
<string name="toast_download_error">Download error</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/app_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
android:summary=" "
android:entries="@array/KMLAltitudeMode"
android:entryValues="@array/KMLAltitudeModeValues"
android:defaultValue="0" />
android:defaultValue="1" />

</android.support.v7.preference.PreferenceCategory>

Expand Down
Binary file added sourcecode/GPSLogger-2.1.2 - Source.zip
Binary file not shown.

0 comments on commit 4640392

Please sign in to comment.