after android runtime update,tip java.lang.RuntimeException: Unable to open the database file
You need to enable runtime permissions for access to external storage at Android API 23. If you are compiling/deploying to API 22 or below this is not required. See the following help documentation:
I don't know if this helps but I am noticing in Android M (6.0) when pointed at SD Card that some environmental variables no longer work even with permissions setup correctly. For example I had to change the following...(there are probably other ways to do this also).
System.getenv("SECONDARY_STORAGE")
to a little more convoluted method to get SD Card path...
if (Build.VERSION.SDK_INT >= 23) {
for (File file : mContext.getExternalFilesDirs(null)) {
if (file.getPath().contains("emulate")) {
}else{
File fileParent = file.getParentFile();
appSDPath = fileParent.getPath() + "/Reference_Data";
appSDPathApplication = fileParent.getPath();
}
}
}else{
appSDPath = System.getenv("SECONDARY_STORAGE") + "/Android/data/com.company.app/Reference_Data";
}
Did the above suggestions help? Are you still having issues?
Hi dgtery dgt,
Make sure you enable the permission in your AndroidManifest.xml, you probably not give the WRITE & READ permission.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
Install and set up—ArcGIS Runtime SDK for Android | ArcGIS for Developers
Hope this can help.