When the Android development process involves the operation of the database, we usually need to export the app's database file (i.e., *.db file) to verify that the database additions and deletions are correct.
Because the real machine does not have access to the protected data storage area without root, you can choose to export the data files on the emulator for simplicity. This article is used to verify
A contentprovider example is a successful database insert operation, the development tool is Eclipse ADT (Android API 18), the detailed steps are as follows:
(1) Start with a new simulator, as shown in the procedure (red-frame operation options and simulator configuration information):
(2) Start the program and insert 5 records:
At this point, under the Ddms window, under the File Explore window, under/data/data/android.api.version18.contentprovider/databases files, you can
See our project database file Xuexiao, this is the data file we want to export and check.
(3) Export the database file Xuexiao.db file to the Desktop file:
(4) Open with Sqlitebrowser (or other similar software), if the stored database file is an unformatted file, then the *.db file is changed, and the data is opened as follows:
Data inserted successfully!
Export and view of data files in Android database