Detailed explanation of SQLite technology examples in Android

Android and IOS databases are implemented with SQLite

1、 Introduction to SQLite database:

Lightweight: SQLite database is a lightweight database, which is suitable for curd with a small amount of data;

File essence: SQLite database supports most SQL syntax and allows the use of SQL statements to operate the database. Its essence is a file without installation and startup.

Data read / write: opening SQLite database is just a file read / write stream.

2、 Simple database statement knowledge

An embedded relational database SQLite is integrated on Android platform. SQLite3 supports null, integer, real (floating point number), text (string text) and blob (binary object) data types. In fact, SQLite3 also accepts varchar (n), char (n), decimal (P, s) and other data types, but will be converted to five corresponding data types during operation or saving

The biggest feature of SQLite is that you can save various types of data into any field, regardless of the data type declared by the field.

Today, I will use a simple column to illustrate the implementation of SQLite.

Example code:

This is the basic data program.

XML

relative_ main

relative_ list_ item

dialog_ delete

This is a simple demo. I won't elaborate on the details of the database here. For those who are already familiar with the database, you can check the instructions on the Android official website,

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>