Analysis of data storage method using SQLite developed by Android
This paper describes the method of storing data using SQLite in Android development. Share with you for your reference, as follows:
We have mentioned several file operations, such as shared reference and sdcard. In fact, Android also provides another storage method, SQLite. As long as you have studied the database, you can master this. Let's get this together with me.
1. Install a SQLite developer, which is used to open the database generated by Android. The software can be found by random search. Just open the software and click "database" -- > "registered database". It's best to explore by yourself
2. Write a business class into a database and database table, as shown below
When the database and tables are ready, you can do the next step
3. Prepare business categories for addition, deletion, modification and query
Note the usage of getreadabledatabase and getwritabledatabase. Getreadabledatabase is used for simple data query and the latter is used for data modification. In addition, it should be noted that the data type of SQLite has no effect, just for the mutual cooperation of programmers.
4. Write JUnit for Android
Data is generated after execution, and the record with ID 11 has been deleted
More readers interested in Android related content can view the special topics of this site: summary of Android operating SQLite database skills, summary of Android database operating skills, summary of activity operating skills of Android programming, summary of Android file operating skills, summary of SD card operating methods of Android programming development, introduction and advanced tutorial of Android development , summary of Android resource operation skills, summary of Android view skills and summary of Android control usage
I hope this article will help you in Android programming.