Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcoded database path #37

Open
DragoonAethis opened this issue Nov 17, 2016 · 0 comments
Open

Hardcoded database path #37

DragoonAethis opened this issue Nov 17, 2016 · 0 comments

Comments

@DragoonAethis
Copy link
Contributor

DragoonAethis commented Nov 17, 2016

Here: https://github.com/autyzm-pg/friendly-plans-link/blob/master/backupper-core/src/main/java/pl/gda/pg/eti/autyzm/backupper/core/Config.java

  • Some Android versions prevent accessing storage via /storage/sdcard0 (most devices have that linked, but eg under Android 6.0 sdcard0 is replaced with a file system UUID. See this: https://android.stackexchange.com/questions/14105/how-can-i-determine-storage-directory-from-adb - adb shell echo $EXTERNAL_STORAGE provides the real path, regardless of the Android version running on the device.
  • Newer Android versions (4.4+) use SQLite with journals. If a database write wasn't completed, the "main" database file is partially written to, but the journal contains the data necessary to complete the transaction (even if it's just a simple insert) and make the database usable. Therefore backing up just the main database file (without commments2.db-journal) may occasionally back up a broken database - checking if the journal exists (and backing it up if that's the case) is required.
  • Android apps should use the private application storage to store databases (think /data/data/org.application.etc/databases or /path/to/primary/storage/Android/data/org.application.etc/databases). The second method is preferred if a database file should be shared between apps and accessible R/W via ADB.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants