I want to back up SQLite db to my sd card on Oppo A37 I have permissions to write to external in manifest
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
and this line of code
String outFileName = Environment.getExternalStorageDirectory().getPath() +
"/SQLite/" + DBNAME + "_" + ext;
After running db file will show up in several incarnations:
/storage/emulated/0/Sqlite/
/mnt/sdcard/SQLite/
/sdcard/SQLite
/storage/sdcard0/SQLite/
Maybe more, probably many alias for same thing but all in phone internal storage.
I discovered that what I want is "/storage/sdcard1/SQLite/" so I tried with adb
adb -d shell "run-as com.photobangkok.expences cat
/data/data/com.photobangkok.expences/databases/money_DB > /storage/sd
card1/SQLite/money_DB"
It does work but
String outFileName = "/storage/sdcard1/SQLite/" + DBNAME + "_" + ext;
produces an error (Permission Denied) and is frown upon by LINT
Running out of ideas of how to use my sd card! Can someone help me telling me the proper line of code to use ?