Add Database helper, can save marker in stop table and read it
This commit is contained in:
22
app/src/main/java/com/example/busroute/Database/Stop.kt
Normal file
22
app/src/main/java/com/example/busroute/Database/Stop.kt
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.example.busroute.Database
|
||||
|
||||
import android.provider.BaseColumns
|
||||
|
||||
object StopContract {
|
||||
// Table contents are grouped together in an anonymous object.
|
||||
object StopEntry : BaseColumns {
|
||||
const val TABLE_NAME = "stop"
|
||||
const val LATITUDE = "latitude"
|
||||
const val LONGITUDE = "longitude"
|
||||
const val ORDER = "'order'"
|
||||
}
|
||||
|
||||
const val SQL_CREATE_ENTRIES =
|
||||
"CREATE TABLE ${StopEntry.TABLE_NAME} (" +
|
||||
"${BaseColumns._ID} INTEGER PRIMARY KEY," +
|
||||
"${StopEntry.LATITUDE} DOUBLE, "+
|
||||
"${StopEntry.LONGITUDE} DOUBLE, "+
|
||||
"${StopEntry.ORDER} INTEGER)"
|
||||
|
||||
const val SQL_DELETE_ENTRIES = "DROP TABLE IF EXISTS ${StopEntry.TABLE_NAME}"
|
||||
}
|
||||
Reference in New Issue
Block a user