Big data processing and simultaneous reading and writing method for Android SQLite operation
This paper describes the big data processing and simultaneous reading and writing methods of Android SQLite operation. Share with you for your reference, as follows:
1. Batch write
Using the transaction mode, cache the data first, and then write the data in batch, which greatly improves the speed
288, direct inset into takes 7 seconds
8640 entries, batch writing takes 5-7 seconds
2. Simultaneous reading and writing
SQLite allows 1 read, multiple write,
Getreadabledatabase is read (the bottom layer is to open the write format first and then convert it to read-only mode. If the system memory is insufficient, the open mode is read-only mode)
Curve cur, cur, and cur are only pointers before they operate on it (such as movetofirst()). They do not operate on the database.
Getwritabledatabase is write
The opening modes of the two operation databases are mutually exclusive, and the bottom layer has been locked
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 operating JSON format data 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 operation methods for Android programming development, introduction and advanced tutorial for 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.