diff --git a/.travis.yml b/.travis.yml index 36bcf20b..68beafd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ jdk: - openjdk8 env: global: - - ANDROID=28 - - ANDROID_BUILD_TOOLS=28.0.3 + - ANDROID=29 + - ANDROID_BUILD_TOOLS=29.0.0 - GRADLE_OPTS="-Xmx2048m" - secure: sW674wuFZOuoX7jHQHDbX3j8NxL8JxR07cyq+CrrqJ537dU9lxWQmMBRUpOb+p/q7sQ74PUtiKJkmFgKCSJSAKY+nr6GJ8P/q6u5TUKbmUWODSn8znehX2zualfvFwpF4PILok/wUzXBQE62jn4lUua7cMdsHRMNHbLmKqBoVL0meObDDjsaJ/RCbOPuruy3FmgvXPp0+Y4zl1GsklDSyjFzg4LBzjAk9Ryvh1O4zvJBkkyfCgurLKCnOKIPy3v5fPMS9oDfO1aarAVGoZZe416pvTW4hb8cdB6kn9XWYDob4NDFX/sP5k7XIhd/NAIn9LrKFg0sLtATaKLX+BcasF1CgDR/u6+SEeQd5QaRF7Go2Nq5Ltuu4OIFONI2qhEeVDDK6Otf2WSWj9KPno2GHuumBfbg4ypWoJgmZrMXk8JeVV/OP/0jIQz3p/7yfF21X1XBEqYaVHPAMKdEYYkCSa46KfACyOt6LfnkuCHtoTOpFo7sq0omIA2HOtpIx1u3vMBUyAbQqT6cokkKB1b6gNTFwhHc+8ybfLFPljJB8cWshI+V/b06S6fekRmvTNxvDykWNsdlkENBYqc9hMfjcT4hO4K+76SWN62mimQYODvFyfTVMC7WkQ3k/XEnmqUPV5XkbaILbS1d/tA57N148FiJ5/QXtI6Y94imubYyVqU= - secure: AdKSZKA4gMuKXI4X4dQNJqcMv5OmPIHdN8fpy55Y9yoOQPQHZE3Zwc4QDWBh20q298jyEC854tVTPTysdZ7h+2s2FhsprYv1Bt/QNzKIrLpeIMj2quuVGMbdPuk08y55gost94KwVLJv0sIDpRlB/PEQkA7Mg/UDsT9zR8E1Ms5x+ul2C8e1ag0zzNl1wVnT5jY8WCp74uA/XXCcJl/80qT1stUERazCKwbKNo007hi7rdm4HA7YGevORq8e2r67je+WIBZUAwrHT0Zjuo4ibwUii4LdwvjuN3w0Z6e9Wf4x5bBqGgnih0T31uom2yPjNx+U/c2AWI+Nxfy/SEF2U+9bjBEZ3ZhI7F1B9ofXo2mhvvsVDiUrymMBbG2V64C9kAzeUh7xIBTqIrbdtpAEBV9FlLAtF2swVTwtCgZgcVTOt3RKXCi3X3nk3cuH7PAorFa/QGfT4xxVu2011FVAt2Rm7SD0ZWztZTSTz/4Nt/egtGBOJfrCc7oLEygLzDmLqsqCwCROITVQjWLjrtqDyLteaNiSXeNIQMKun3izApbXnHmXB+FV3R3EZocboqk3v5bmPTahnG6Ghc2zknWyyxSx+O9qIfOpHUL8JMJiT82lUQUeibtCn7DCE8wVQ/gYC5i+a+KO/d3NemSzIFlZ8aoUiEPYq18dYlsDXeLXwF0= diff --git a/build.gradle b/build.gradle index de48a2bb..3c9c0f3f 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ allprojects { version = 'master-SNAPSHOT' ext.isReleaseVersion = !version.endsWith("SNAPSHOT") - ext.androidBuildVersionTools = "28.0.3" + ext.androidBuildVersionTools = "29.0.0" ext.gdxVersion = "1.9.9" ext.gwtVersion = "2.8.0" ext.slf4jVersion = "1.7.25" @@ -28,7 +28,7 @@ allprojects { } } -static def androidCompileSdk() { return 28 } +static def androidCompileSdk() { return 29 } // 14 for Support Library, 16 for sqlite-android static def androidMinSdk() { return 16 } diff --git a/docs/Changelog.md b/docs/Changelog.md index 8981a9f4..31829ad3 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -5,6 +5,7 @@ - vtm-desktop-lwjgl module [#714](https://github.com/mapsforge/vtm/pull/714) - vtm-desktop-lwjgl3 module [#717](https://github.com/mapsforge/vtm/pull/717) - Fix marker touch events [#723](https://github.com/mapsforge/vtm/issues/723) +- Android 10 compatibility [#728](https://github.com/mapsforge/vtm/issues/728) - Many other minor improvements and bug fixes - [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.12.0) diff --git a/vtm-android-example/src/org/oscim/android/filepicker/FilePicker.java b/vtm-android-example/src/org/oscim/android/filepicker/FilePicker.java index 3cfd4dfb..982813b6 100755 --- a/vtm-android-example/src/org/oscim/android/filepicker/FilePicker.java +++ b/vtm-android-example/src/org/oscim/android/filepicker/FilePicker.java @@ -1,6 +1,6 @@ /* * Copyright 2010, 2011, 2012 mapsforge.org - * Copyright 2016 devemux86 + * Copyright 2016-2019 devemux86 * * This program is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free Software @@ -22,11 +22,9 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.os.Bundle; -import android.os.Environment; import android.view.View; import android.widget.AdapterView; import android.widget.GridView; - import org.oscim.android.test.R; import java.io.File; @@ -60,7 +58,6 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe private static final String PREFERENCES_FILE = "FilePicker"; private static final String CURRENT_DIRECTORY = "currentDirectory"; - private static final String DEFAULT_DIRECTORY = Environment.getExternalStorageDirectory().getAbsolutePath(); private static final int DIALOG_FILE_INVALID = 0; // private static final int DIALOG_FILE_SELECT = 1; @@ -122,6 +119,7 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe }; } + private String mDefaultDirectory; private File mDirectory; private FilePickerIconAdapter mFilePickerIconAdapter; private File[] mFiles; @@ -182,6 +180,7 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe super.onCreate(savedInstanceState); setContentView(R.layout.activity_file_picker); + mDefaultDirectory = getExternalFilesDir(null).getAbsolutePath(); mFilePickerIconAdapter = new FilePickerIconAdapter(this); GridView gridView = (GridView) findViewById(R.id.filePickerView); gridView.setOnItemClickListener(this); @@ -239,10 +238,9 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe // restore the current directory SharedPreferences preferences = getSharedPreferences(PREFERENCES_FILE, MODE_PRIVATE); - mDirectory = new File(preferences.getString(CURRENT_DIRECTORY, - DEFAULT_DIRECTORY)); + mDirectory = new File(preferences.getString(CURRENT_DIRECTORY, mDefaultDirectory)); if (!mDirectory.exists() || !mDirectory.canRead()) { - mDirectory = new File(DEFAULT_DIRECTORY); + mDirectory = new File(mDefaultDirectory); } browseToCurrentDirectory(); } diff --git a/vtm-android-example/src/org/oscim/android/test/GettingStarted.java b/vtm-android-example/src/org/oscim/android/test/GettingStarted.java index e3a4c067..d39d6a3f 100644 --- a/vtm-android-example/src/org/oscim/android/test/GettingStarted.java +++ b/vtm-android-example/src/org/oscim/android/test/GettingStarted.java @@ -16,8 +16,6 @@ package org.oscim.android.test; import android.app.Activity; import android.os.Bundle; -import android.os.Environment; - import org.oscim.android.MapView; import org.oscim.backend.CanvasAdapter; import org.oscim.layers.tile.buildings.BuildingLayer; @@ -35,7 +33,8 @@ import java.io.File; /** * A very basic Android app example. *
- * You'll need a map with filename berlin.map from download.mapsforge.org in device storage. + * You'll need a map with filename berlin.map from download.mapsforge.org in device storage: + * /sdcard/Android/data/org.oscim.android.test/files/ */ public class GettingStarted extends Activity { @@ -55,7 +54,7 @@ public class GettingStarted extends Activity { // Tile source MapFileTileSource tileSource = new MapFileTileSource(); - String mapPath = new File(Environment.getExternalStorageDirectory(), MAP_FILE).getAbsolutePath(); + String mapPath = new File(getExternalFilesDir(null), MAP_FILE).getAbsolutePath(); if (tileSource.setMapFile(mapPath)) { // Vector layer VectorTileLayer tileLayer = mapView.map().setBaseMap(tileSource); diff --git a/vtm-android-example/src/org/oscim/android/test/MBTilesBitmapTileActivity.java b/vtm-android-example/src/org/oscim/android/test/MBTilesBitmapTileActivity.java index 2e9ed49e..63057626 100644 --- a/vtm-android-example/src/org/oscim/android/test/MBTilesBitmapTileActivity.java +++ b/vtm-android-example/src/org/oscim/android/test/MBTilesBitmapTileActivity.java @@ -18,7 +18,6 @@ package org.oscim.android.test; import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; -import android.os.Environment; import org.oscim.android.tiling.source.mbtiles.MBTilesBitmapTileSource; import org.oscim.core.BoundingBox; import org.oscim.core.MapPosition; @@ -36,7 +35,7 @@ public class MBTilesBitmapTileActivity extends BitmapTileActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - File file = new File(Environment.getExternalStorageDirectory(), "test.mbtiles"); + File file = new File(getExternalFilesDir(null), "test.mbtiles"); if (!file.exists()) { AlertDialog.Builder builder = new AlertDialog.Builder(this) .setTitle(R.string.warning) diff --git a/vtm/src/org/oscim/utils/animation/DragForce.java b/vtm/src/org/oscim/utils/animation/DragForce.java index 93ed4fb7..31d12200 100644 --- a/vtm/src/org/oscim/utils/animation/DragForce.java +++ b/vtm/src/org/oscim/utils/animation/DragForce.java @@ -17,7 +17,7 @@ package org.oscim.utils.animation; /** * See https://developer.android.com/reference/android/support/animation/FlingAnimation.html - * Class android.support.animation.FlingAnimation + * Class androidx.dynamicanimation.animation.FlingAnimation */ public final class DragForce {