I have a strange problem where my SQL database doesn't remove itself when I uninstall the app
I'm not creating the database in any external storage directories, and the database is confirmed to be in its default location: /data/data/http://ift.tt/1TsKU30
After I uninstall the app, I expect all the data in that location to be wiped, but when I run the app again from android studio the new install can still see all of the old data
I have tried using adb to manually delete the .db
file from the databases directory, but when I run the app again the old data can still be seen
I have also tried going into the app settings and clearing the data and cache, but that doesn't seem to help
The only places in my code where I'm doing anything "strange" with regards to the database is I'm copying the database file to a new location on button click:
String pathToExternalStorage = Environment.getExternalStorageDirectory().toString();
File exportDir = new File(pathToExternalStorage, "/SensorData");
File subjectDataDir = new File(exportDir, "/subjects");
File data = Environment.getDataDirectory();
String currentDBPath = "//data//http://ift.tt/1pVVDad" + DBHelper.DATABASE_NAME;
File currentDB = new File(data, currentDBPath);
File destDB = new File(exportDir, DBHelper.DATABASE_NAME);
FileChannel src = new FileInputStream(currentDB).getChannel();
FileChannel dst = new FileOutputStream(destDB).getChannel();
dst.transferFrom(src, 0, src.size());
src.close();
dst.close();
And then running mediascanner on the newly created file so I can get instant MTP access to it
I doubt that either of these processes could cause this to happen though?
My immediate question is how do I manually remove the database from the phone without root access?
The bigger question is what could be causing the uninstall process to not remove the database files? And how does a newly installed version of the app (after an uninstall) still see the old database information?
I'm not sure how to begin figuring this out...
Aucun commentaire:
Enregistrer un commentaire