ipdan4ik

[lb7] SQLiteHelper.kt

Apr 16th, 2021
786
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.example.lb7
  2.  
  3. import android.content.Context
  4. import android.database.sqlite.SQLiteDatabase
  5. import android.database.sqlite.SQLiteOpenHelper
  6.  
  7. class SQLiteHelper(context: Context?) :
  8.     SQLiteOpenHelper(context, "items.db", null, 1) {
  9.     override fun onCreate(db: SQLiteDatabase?) {
  10.         db?.execSQL("CREATE TABLE IF NOT EXISTS items (" +
  11.                 "id INTEGER PRIMARY KEY AUTOINCREMENT, " +
  12.                 "title TEXT, " +
  13.                 "latitude DECIMAL, " +
  14.                 "longitude DECIMAL)");
  15.     }
  16.  
  17.     override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) {
  18.         TODO("Not yet implemented")
  19.     }
  20. //
  21. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×