Merge pull request #717 from afischerdev/update-android
Update Android Version
This commit is contained in:
commit
e63cc9888f
10 changed files with 59 additions and 36 deletions
|
@ -23,8 +23,8 @@ import btools.util.CompactLongMap;
|
||||||
import btools.util.FrozenLongMap;
|
import btools.util.FrozenLongMap;
|
||||||
|
|
||||||
public final class OsmTrack {
|
public final class OsmTrack {
|
||||||
final public static String version = "1.7.6";
|
final public static String version = "1.7.7";
|
||||||
final public static String versionDate = "20062024";
|
final public static String versionDate = "23072024";
|
||||||
|
|
||||||
// csv-header-line
|
// csv-header-line
|
||||||
private static final String MESSAGES_HEADER = "Longitude\tLatitude\tElevation\tDistance\tCostPerKm\tElevCost\tTurnCost\tNodeCost\tInitialCost\tWayTags\tNodeTags\tTime\tEnergy";
|
private static final String MESSAGES_HEADER = "Longitude\tLatitude\tElevation\tDistance\tCostPerKm\tElevCost\tTurnCost\tNodeCost\tInitialCost\tWayTags\tNodeTags\tTime\tEnergy";
|
||||||
|
|
|
@ -1,26 +1,30 @@
|
||||||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
id 'base'
|
||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
id 'checkstyle'
|
id 'checkstyle'
|
||||||
id 'brouter.version-conventions'
|
id 'brouter.version-conventions'
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 33
|
compileSdk 34
|
||||||
|
|
||||||
|
base {
|
||||||
|
archivesName = "BRouterApp." + project.version
|
||||||
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
namespace 'btools.routingapp'
|
namespace 'btools.routingapp'
|
||||||
applicationId "btools.routingapp"
|
applicationId "btools.routingapp"
|
||||||
|
|
||||||
versionCode 53
|
versionCode 54
|
||||||
versionName project.version
|
versionName project.version
|
||||||
|
|
||||||
resValue('string', 'app_version', defaultConfig.versionName)
|
resValue('string', 'app_version', defaultConfig.versionName)
|
||||||
setProperty("archivesBaseName", "BRouterApp." + defaultConfig.versionName)
|
|
||||||
|
|
||||||
minSdkVersion 14
|
minSdkVersion 21
|
||||||
targetSdkVersion 33
|
targetSdkVersion 34
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
@ -96,22 +100,22 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||||
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
|
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
|
||||||
implementation 'androidx.work:work-runtime:2.8.1'
|
implementation 'androidx.work:work-runtime:2.9.0'
|
||||||
implementation 'com.google.android.material:material:1.8.0'
|
implementation 'com.google.android.material:material:1.12.0'
|
||||||
|
|
||||||
implementation project(':brouter-mapaccess')
|
implementation project(':brouter-mapaccess')
|
||||||
implementation project(':brouter-core')
|
implementation project(':brouter-core')
|
||||||
implementation project(':brouter-expressions')
|
implementation project(':brouter-expressions')
|
||||||
implementation project(':brouter-util')
|
implementation project(':brouter-util')
|
||||||
implementation 'androidx.preference:preference:1.2.0'
|
implementation 'androidx.preference:preference:1.2.1'
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||||
androidTestImplementation 'androidx.work:work-testing:2.8.1'
|
androidTestImplementation 'androidx.work:work-testing:2.9.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
gradle.projectsEvaluated {
|
gradle.projectsEvaluated {
|
||||||
|
@ -159,3 +163,8 @@ task generateReadmesZip(type: Zip) {
|
||||||
}
|
}
|
||||||
destinationDirectory = layout.buildDirectory.dir("assets")
|
destinationDirectory = layout.buildDirectory.dir("assets")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
options.compilerArgs += ['-Xlint:unchecked']
|
||||||
|
options.compilerArgs += ['-Xlint:deprecation']
|
||||||
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package btools.routingapp;
|
package btools.routingapp;
|
||||||
|
|
||||||
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.Matchers.empty;
|
import static org.hamcrest.Matchers.empty;
|
||||||
import static org.hamcrest.Matchers.hasItem;
|
import static org.hamcrest.Matchers.hasItem;
|
||||||
import static org.hamcrest.Matchers.not;
|
import static org.hamcrest.Matchers.not;
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package btools.routingapp;
|
package btools.routingapp;
|
||||||
|
|
||||||
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.core.Is.is;
|
import static org.hamcrest.core.Is.is;
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,8 @@ import btools.router.RoutingHelper;
|
||||||
|
|
||||||
public class BInstallerActivity extends AppCompatActivity {
|
public class BInstallerActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private static final String TAG = "BInstallerActivity";
|
||||||
|
|
||||||
private static final int DIALOG_CONFIRM_DELETE_ID = 1;
|
private static final int DIALOG_CONFIRM_DELETE_ID = 1;
|
||||||
private static final int DIALOG_CONFIRM_NEXTSTEPS_ID = 2;
|
private static final int DIALOG_CONFIRM_NEXTSTEPS_ID = 2;
|
||||||
private static final int DIALOG_CONFIRM_GETDIFFS_ID = 3;
|
private static final int DIALOG_CONFIRM_GETDIFFS_ID = 3;
|
||||||
|
@ -216,7 +218,7 @@ public class BInstallerActivity extends AppCompatActivity {
|
||||||
Object data;
|
Object data;
|
||||||
Toast.makeText(this, R.string.msg_too_much_data, Toast.LENGTH_LONG).show();
|
Toast.makeText(this, R.string.msg_too_much_data, Toast.LENGTH_LONG).show();
|
||||||
|
|
||||||
e.printStackTrace();
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,10 +244,9 @@ public class BInstallerActivity extends AppCompatActivity {
|
||||||
//WorkManager.getInstance(getApplicationContext()).cancelWorkById(downloadWorkRequest.getId());
|
//WorkManager.getInstance(getApplicationContext()).cancelWorkById(downloadWorkRequest.getId());
|
||||||
}
|
}
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
e.printStackTrace();
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Log.d("worker", "canceled " + e.getMessage());
|
Log.d(TAG, "canceled " + e.getMessage());
|
||||||
//e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
workManager
|
workManager
|
||||||
|
@ -516,10 +517,10 @@ public class BInstallerActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
return running;
|
return running;
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
e.printStackTrace();
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
return false;
|
return false;
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,8 @@ import btools.util.CheapRuler;
|
||||||
|
|
||||||
public class BRouterView extends View {
|
public class BRouterView extends View {
|
||||||
|
|
||||||
|
private static final String TAG = "BRouterView";
|
||||||
|
|
||||||
private final int memoryClass;
|
private final int memoryClass;
|
||||||
RoutingEngine cr;
|
RoutingEngine cr;
|
||||||
private int imgw;
|
private int imgw;
|
||||||
|
@ -148,8 +150,8 @@ public class BRouterView extends View {
|
||||||
try {
|
try {
|
||||||
td.mkdirs();
|
td.mkdirs();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d("BRouterView", "Error creating base directory: " + e.getMessage());
|
Log.d(TAG, "Error creating base directory: " + e.getMessage());
|
||||||
e.printStackTrace();
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!td.isDirectory()) {
|
if (!td.isDirectory()) {
|
||||||
|
@ -173,7 +175,7 @@ public class BRouterView extends View {
|
||||||
|
|
||||||
// new init is done move old files
|
// new init is done move old files
|
||||||
if (waitingForMigration) {
|
if (waitingForMigration) {
|
||||||
Log.d("BR", "path " + oldMigrationPath + " " + basedir);
|
Log.d(TAG, "path " + oldMigrationPath + " " + basedir);
|
||||||
Thread t = new Thread(new Runnable() {
|
Thread t = new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -184,7 +186,7 @@ public class BRouterView extends View {
|
||||||
try {
|
try {
|
||||||
t.join(500);
|
t.join(500);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
}
|
}
|
||||||
waitingForMigration = false;
|
waitingForMigration = false;
|
||||||
}
|
}
|
||||||
|
@ -333,9 +335,9 @@ public class BRouterView extends View {
|
||||||
out.close();
|
out.close();
|
||||||
|
|
||||||
} catch (FileNotFoundException fileNotFoundException) {
|
} catch (FileNotFoundException fileNotFoundException) {
|
||||||
Log.e("tag", fileNotFoundException.getMessage());
|
Log.e(TAG, fileNotFoundException.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("tag", e.getMessage());
|
Log.e(TAG, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import android.content.SharedPreferences;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.window.OnBackInvokedCallback;
|
import android.window.OnBackInvokedCallback;
|
||||||
import android.window.OnBackInvokedDispatcher;
|
import android.window.OnBackInvokedDispatcher;
|
||||||
|
|
||||||
|
@ -146,7 +147,7 @@ public class RoutingParameterDialog extends AppCompatActivity {
|
||||||
list.add(p);
|
list.add(p);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (line != null);
|
} while (line != null);
|
||||||
|
@ -240,6 +241,7 @@ public class RoutingParameterDialog extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
@ -262,10 +264,10 @@ public class RoutingParameterDialog extends AppCompatActivity {
|
||||||
|
|
||||||
if (i.hasExtra("PARAMS")) {
|
if (i.hasExtra("PARAMS")) {
|
||||||
List<?> result;
|
List<?> result;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||||
result = (List<?>) i.getExtras().getSerializable("PARAMS", ArrayList.class);
|
|
||||||
} else {
|
|
||||||
result = (List<?>) i.getExtras().getSerializable("PARAMS");
|
result = (List<?>) i.getExtras().getSerializable("PARAMS");
|
||||||
|
} else {
|
||||||
|
result = (List<?>) i.getExtras().getSerializable("PARAMS", ArrayList.class);
|
||||||
}
|
}
|
||||||
if (result instanceof ArrayList) {
|
if (result instanceof ArrayList) {
|
||||||
for (Object o : result) {
|
for (Object o : result) {
|
||||||
|
@ -277,7 +279,7 @@ public class RoutingParameterDialog extends AppCompatActivity {
|
||||||
sparams = i.getExtras().getString("PARAMS_VALUES", "");
|
sparams = i.getExtras().getString("PARAMS_VALUES", "");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
getPreferenceManager().setSharedPreferencesName("prefs_profile_" + profile_hash);
|
getPreferenceManager().setSharedPreferencesName("prefs_profile_" + profile_hash);
|
||||||
|
|
|
@ -2,6 +2,7 @@ package btools.routingapp;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.AssetManager;
|
import android.content.res.AssetManager;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -13,6 +14,9 @@ import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
public class ServerConfig {
|
public class ServerConfig {
|
||||||
|
|
||||||
|
private static final String TAG = "ServerConfig";
|
||||||
|
|
||||||
private static String mServerConfigName = "serverconfig.txt";
|
private static String mServerConfigName = "serverconfig.txt";
|
||||||
|
|
||||||
private String mSegmentUrl = "https://brouter.de/brouter/segments4/";
|
private String mSegmentUrl = "https://brouter.de/brouter/segments4/";
|
||||||
|
@ -52,7 +56,7 @@ public class ServerConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (br != null) br.close();
|
if (br != null) br.close();
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
// app: build.gradle (versionCode only)
|
// app: build.gradle (versionCode only)
|
||||||
// OsmTrack (version and versionDate)
|
// OsmTrack (version and versionDate)
|
||||||
// docs revisions.md (version and versionDate)
|
// docs revisions.md (version and versionDate)
|
||||||
version '1.7.6'
|
version '1.7.7'
|
||||||
|
|
|
@ -2,7 +2,12 @@
|
||||||
|
|
||||||
(ZIP-Archives including APK, readme + profiles)
|
(ZIP-Archives including APK, readme + profiles)
|
||||||
|
|
||||||
### [brouter-1.7.6.zip](../brouter_bin/brouter-1.7.6.zip) (current revision, 20.06.2024)
|
### [brouter-1.7.7.zip](../brouter_bin/brouter-1.7.7.zip) (current revision, 23.07.2024)
|
||||||
|
|
||||||
|
- new Android API 34
|
||||||
|
|
||||||
|
|
||||||
|
### [brouter-1.7.6.zip](../brouter_bin/brouter-1.7.6.zip) (20.06.2024)
|
||||||
|
|
||||||
Android
|
Android
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue