2

I am testing my app on my nexus 5x. I thought, but am not sure, when I opened DDMS in android studio I could look at and remove files in the private files section. Now my phone is updated to Nougat and I can no longer see any files on the device, be it in the private section or in the public one.

Furthermore I made some changes to the database and thought removing the old app would remove the old database. After installing and running the new version I am getting an error reporting the database is missing a table. Apparently my old database is not deleted by uninstalling the app, as this table is added in the new version on creating the database. Already tried removing data and then removing the app.

Any idea how to delete the old database or how to access the private files section? Not directly an programming question so if there is a better place to post the question I apologize.

KvdLingen
  • 1,230
  • 2
  • 14
  • 22
  • `I thought (...) I could look at and remove files in the private files section` Not unless your phone was rooted, no. – njzk2 Oct 11 '16 at 19:52
  • Thought so much. It explains why I can on my rooted als Galaxy S, but not on my nexus 5X. I also would like to pull the database for inspection. Also not possible without root, I guess. – KvdLingen Oct 11 '16 at 19:53

2 Answers2

1

to answer my own question. I found this

And finally... calling adb uninstall [yourpackagename] ........ totally uninstalls the app.

A same command is available from inside android studio. Under the Run menu there is the command Clean and Rerun. This cleans out the database on the testdevice, so no need to update the database version during development.

Community
  • 1
  • 1
KvdLingen
  • 1,230
  • 2
  • 14
  • 22
0

Firstly .. You should not remove database before impl migration to newer DB scheme version. Safest way is to increment DB version . so it does not matter whether you have old or not.

Secondly .. Take a look on this how to remove shared preference while application uninstall in android. You may face the same issue that backup stored old db and restores again after installing newer version.

Simply try to set this into manifest at least for debug:

<application ...
        android:allowBackup="false">
...
</application>

It will prevent to restore any thing back from cloud.

Thats why I mentioned its better to track version of DB than just updating content.

I hope that may help you,'.

Community
  • 1
  • 1
Maher Abuthraa
  • 17,493
  • 11
  • 81
  • 103
  • Thanks for your answer, but I hold off accepting it right now. I know about incrementing the version but would like to keep that after the app is published on the play store. For the moment I am experimenting with different datastructures, there by examining the effect of using a database on performance. I will investigate your other suggestions – KvdLingen Oct 11 '16 at 19:31