09 SQLite
09 SQLite
09 SQLite
LESSON 9
ANDROID SQLITE
TABLE OF CONTENT
•
•
•
•
•
•
WHAT IS SQLITE
•
•
•
•
GETTING STARTED
Class SQLiteDatabase
•
•
•
•
•
•
• execSQL(sql : String) : void
• rawQuery(sql : String), query(sql:String) : Cursor
GETTING STARTED
Class SQLiteOpenHelper
•
•
•
•
•
GETTING STARTED
Class Cursor
•
•
•
•
•
•
•
GETTING STARTED
Data Types
•
•
•
•
•
OPERATION ON DATABASE
Example data
Model Table items
Items id title category price Created date
- id : int 1 Mua ao Mua sam 300 12/03/3022
- title : String 2 Mua xe Mua sam 12000 08/02/2022
- category : String 3 Tien dien t3 Tien dien 1200 05/04/2022
- price: String 4 Tien nha t3 Tien nha 1600 07/04/2022
- date: String
CREATE DATABASE CLASS
•
•
•
•
•
•
•
Query Database (Method 1 – query)