Add Database helper, can save marker in stop table and read it

This commit is contained in:
TiclemFR
2024-07-01 15:01:18 +02:00
parent 998378e9ea
commit 367be18e85
7 changed files with 153 additions and 27 deletions

View 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}"
}