diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BRouterActivity.java b/brouter-routing-app/src/main/java/btools/routingapp/BRouterActivity.java index 2424f88..647a0ff 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BRouterActivity.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BRouterActivity.java @@ -533,14 +533,21 @@ public class BRouterActivity extends Activity implements ActivityCompat.OnReques dirFreeSizes.add( Long.valueOf( size ) ); } - basedirOptions = new String[items.size() + 1]; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + basedirOptions = new String[items.size()]; + } else { + basedirOptions = new String[items.size() + 1]; + } + int bdidx = 0; DecimalFormat df = new DecimalFormat( "###0.00" ); for ( int idx = 0; idx < availableBasedirs.size(); idx++ ) { basedirOptions[bdidx++] = availableBasedirs.get( idx ) + " (" + df.format( dirFreeSizes.get( idx ) / 1024. / 1024. / 1024. ) + " GB free)"; } - basedirOptions[bdidx] = "Enter path manually"; + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + basedirOptions[bdidx] = "Enter path manually"; + } showDialog( DIALOG_SELECTBASEDIR_ID ); } diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java index 2f630a1..82ac3e9 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java @@ -214,7 +214,7 @@ public class BRouterView extends View assertDirectoryExists( "modes directory", modesDir, "modes.zip", version ); assertDirectoryExists( "readmes directory", new File (basedir, "brouter/readmes"), "readmes.zip", version ); - File inputDir = new File (basedir, "/import"); + File inputDir = new File (basedir, "brouter/import"); assertDirectoryExists( "input directory", inputDir, null, version ); // new init is done move old files diff --git a/brouter-routing-app/src/main/java/btools/routingapp/DownloadService.java b/brouter-routing-app/src/main/java/btools/routingapp/DownloadService.java index 1099501..94d9a82 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/DownloadService.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/DownloadService.java @@ -132,7 +132,7 @@ public class DownloadService extends Service implements ProgressListener { public void downloadFiles() { - // first check lookup table and prifles + // first check lookup table and profiles String result = checkScripts(); if ( result != null) { if (DEBUG) Log.d("BR", "error: " + result); @@ -192,9 +192,7 @@ public class DownloadService extends Service implements ProgressListener { { try { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { - TrafficStats.setThreadStatsTag(1); - } + TrafficStats.setThreadStatsTag(1); int slidx = surl.lastIndexOf( "segments4/" ); String name = surl.substring( slidx+10 ); @@ -397,17 +395,13 @@ public class DownloadService extends Service implements ProgressListener { { try { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { - TrafficStats.setThreadStatsTag(1); - } + TrafficStats.setThreadStatsTag(1); + + URL url = new URL(surl); + connection = (HttpURLConnection) url.openConnection(); + connection.setConnectTimeout(5000); + connection.connect(); - if ( connection == null ) - { - URL url = new URL(surl); - connection = (HttpURLConnection) url.openConnection(); - connection.setConnectTimeout(5000); - connection.connect(); - } // expect HTTP 200 OK, so we don't mistakenly save error report // instead of the file if (connection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) { diff --git a/brouter-routing-app/src/main/res/drawable-hdpi/icon.png b/brouter-routing-app/src/main/res/drawable-hdpi/icon.png deleted file mode 100644 index 5d890ca..0000000 Binary files a/brouter-routing-app/src/main/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/brouter-routing-app/src/main/res/drawable-ldpi/icon.png b/brouter-routing-app/src/main/res/drawable-ldpi/icon.png deleted file mode 100644 index 811b686..0000000 Binary files a/brouter-routing-app/src/main/res/drawable-ldpi/icon.png and /dev/null differ diff --git a/brouter-routing-app/src/main/res/drawable-mdpi/icon.png b/brouter-routing-app/src/main/res/drawable-mdpi/icon.png deleted file mode 100644 index 88e31c1..0000000 Binary files a/brouter-routing-app/src/main/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/misc/profiles2/readme.txt b/misc/profiles2/readme.txt index 207b329..b290e07 100644 --- a/misc/profiles2/readme.txt +++ b/misc/profiles2/readme.txt @@ -1,4 +1,10 @@ NOTE: Please copy a profile before you edit it. -The delivered profiles will be overwritten when the lookups.dat changes. \ No newline at end of file +The delivered profiles will be overwritten when the lookups.dat changes. + + +WARNING: + +Since Android Q (29) the storage folder for BRouter is a app specific folder. +It will be removed when BRouter is uninstalled or the data is cleared (system settings/apps).