mirror of
https://github.com/SimpleMobileTools/Simple-App-Launcher.git
synced 2025-02-01 09:56:47 +01:00
create a SQLiteOpenHelper for storing the launchers
This commit is contained in:
parent
cf9d543255
commit
2d72bab77f
@ -0,0 +1,28 @@
|
||||
package com.simplemobiletools.applauncher
|
||||
|
||||
import android.content.Context
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import android.database.sqlite.SQLiteOpenHelper
|
||||
|
||||
class DbHelper(context: Context) : SQLiteOpenHelper(context, "launchers.db", null, 1) {
|
||||
val TABLE = "launchers"
|
||||
val CREATE_DB = "CREATE TABLE $TABLE (" +
|
||||
"$ID integer PRIMARY KEY autoincrement," +
|
||||
"$NAME TEXT," +
|
||||
"$PKG_NAME TEXT" +
|
||||
")"
|
||||
|
||||
companion object {
|
||||
val ID: String = "_id"
|
||||
val NAME: String = "name"
|
||||
val PKG_NAME: String = "pkgName"
|
||||
}
|
||||
|
||||
override fun onCreate(db: SQLiteDatabase) {
|
||||
db.execSQL(CREATE_DB)
|
||||
}
|
||||
|
||||
override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) {
|
||||
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user