Skip to content

Commit

Permalink
Update to v2.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
GrazianoCapelli committed Oct 21, 2020
2 parents ba36a49 + 75f35e7 commit 84f4862
Show file tree
Hide file tree
Showing 20 changed files with 206 additions and 236 deletions.
Binary file added apk/GPSLogger-2.2.8.apk
Binary file not shown.
Binary file modified apk/GPSLogger-latest.apk
Binary file not shown.
135 changes: 0 additions & 135 deletions app/app.iml

This file was deleted.

15 changes: 12 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ android {
applicationId "eu.basicairdata.graziano.gpslogger"
minSdkVersion 14
targetSdkVersion 28
versionCode 31
versionName '2.2.7'
versionCode 32
versionName '2.2.8'

javaCompileOptions {
annotationProcessorOptions {
arguments = [ eventBusIndex : 'eu.basicairdata.graziano.gpslogger.EventBusIndex' ]
}
}
}
buildTypes {
debug {
Expand All @@ -57,10 +63,13 @@ dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:preference-v7:28.0.0'
implementation 'com.android.support:preference-v14:28.0.0'
implementation 'com.github.bumptech.glide:glide:3.8.0'

def eventbus_version = '3.1.1'
implementation "org.greenrobot:eventbus:$eventbus_version"
annotationProcessor "org.greenrobot:eventbus-annotation-processor:$eventbus_version"
}
6 changes: 6 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@
public static int e(...);
}

-keepattributes *Annotation*
-keepclassmembers class * {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }

-dontobfuscate
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,15 @@ public void addLocationToTrack(LocationExtended location, Track track) {

trkvalues.put(KEY_TRACK_VALIDMAP, track.getValidMap());

db.beginTransaction();
db.insert(TABLE_LOCATIONS, null, locvalues); // Insert the new Location
db.update(TABLE_TRACKS, trkvalues, KEY_ID + " = ?",
new String[] { String.valueOf(track.getId()) }); // Update the corresponding Track
db.setTransactionSuccessful();
db.endTransaction();
try {
db.beginTransaction();
db.insert(TABLE_LOCATIONS, null, locvalues); // Insert the new Location
db.update(TABLE_TRACKS, trkvalues, KEY_ID + " = ?",
new String[] { String.valueOf(track.getId()) }); // Update the corresponding Track
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}

//Log.w("myApp", "[#] DatabaseHandler.java - addLocation: Location " + track.getNumberOfLocations() + " added into track " + track.getID());
}
Expand Down Expand Up @@ -416,12 +419,15 @@ public void addPlacemarkToTrack(LocationExtended placemark, Track track) {

trkvalues.put(KEY_TRACK_VALIDMAP, track.getValidMap());

db.beginTransaction();
db.insert(TABLE_PLACEMARKS, null, locvalues); // Insert the new Location
db.update(TABLE_TRACKS, trkvalues, KEY_ID + " = ?",
new String[] { String.valueOf(track.getId()) }); // Update the corresponding Track
db.setTransactionSuccessful();
db.endTransaction();
try {
db.beginTransaction();
db.insert(TABLE_PLACEMARKS, null, locvalues); // Insert the new Location
db.update(TABLE_TRACKS, trkvalues, KEY_ID + " = ?",
new String[] { String.valueOf(track.getId()) }); // Update the corresponding Track
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}

//Log.w("myApp", "[#] DatabaseHandler.java - addLocation: Location " + track.getNumberOfLocations() + " added into track " + track.getID());
}
Expand Down Expand Up @@ -684,15 +690,18 @@ public long getLastLocationID(long TrackID) {
// The method deletes also Placemarks and Locations associated to the specified track
public void DeleteTrack(long TrackID) {
SQLiteDatabase db = this.getWritableDatabase();
db.beginTransaction();
db.delete(TABLE_PLACEMARKS, KEY_TRACK_ID + " = ?",
new String[] { String.valueOf(TrackID) }); // Delete track's Placemarks
db.delete(TABLE_LOCATIONS, KEY_TRACK_ID + " = ?",
new String[] { String.valueOf(TrackID) }); // Delete track's Locations
db.delete(TABLE_TRACKS, KEY_ID + " = ?",
new String[] { String.valueOf(TrackID) }); // Delete track
db.setTransactionSuccessful();
db.endTransaction();
try {
db.beginTransaction();
db.delete(TABLE_PLACEMARKS, KEY_TRACK_ID + " = ?",
new String[] { String.valueOf(TrackID) }); // Delete track's Placemarks
db.delete(TABLE_LOCATIONS, KEY_TRACK_ID + " = ?",
new String[] { String.valueOf(TrackID) }); // Delete track's Locations
db.delete(TABLE_TRACKS, KEY_ID + " = ?",
new String[] { String.valueOf(TrackID) }); // Delete track
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}

//Log.w("myApp", "[#] DatabaseHandler.java - addLocation: Location " + track.getNumberOfLocations() + " added into track " + track.getID());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@

public class ExternalViewerChecker {

private Context context;
private boolean isAppInfoListMade = false;
private final Context context;

public ArrayList<AppInfo> appInfoList = new ArrayList<>();
private ArrayList<AppInfo> appInfoList = new ArrayList<>();

static private class CustomComparator implements Comparator<AppInfo> {
@Override
Expand All @@ -43,7 +42,12 @@ public int compare(AppInfo o1, AppInfo o2) {
}
}

private CustomComparator Comparator = new CustomComparator();

public ArrayList<AppInfo> getAppInfoList() {
return appInfoList;
}

private final CustomComparator Comparator = new CustomComparator();


public ExternalViewerChecker(Context context) {
Expand All @@ -61,16 +65,10 @@ public boolean isEmpty() {
}


public AppInfo getAppInfo (int index) {
if (index < size()) return appInfoList.get(index);
else return null;
}


public void makeAppInfoList() {
final PackageManager pm = context.getPackageManager();

appInfoList.clear();
appInfoList = new ArrayList<>();

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Expand Down Expand Up @@ -112,6 +110,7 @@ public void makeAppInfoList() {
if (a.Label.equals(ainfo.Label) && a.PackageName.equals(ainfo.PackageName)) {
found = true;
//a.KML = true;
break;
}
}
if (!found) {
Expand All @@ -136,7 +135,5 @@ public void makeAppInfoList() {
}
}
}

isAppInfoListMade = true;
}
}
Loading

0 comments on commit 84f4862

Please sign in to comment.