package com.example.gesture.database; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class CreateDatabase extends SQLiteOpenHelper { static String name = "StoreManagement.db"; static int dbVersion = 4; public CreateDatabase(Context context) { super(context, name, null, dbVersion); } @Override public void onCreate(SQLiteDatabase db) { // 创建t_sampleCollection数据表 String create_t_sampleCollection_table_sql = "CREATE TABLE t_sampleCollection (id INTEGER PRIMARY KEY AUTOINCREMENT,belongId int(10) NOT NULL,acc1 float NOT NULL,acc2 float NOT NULL,acc3 float NOT NULL,gyro1 float NOT NULL,gyro2 float NOT NULL,gyro3 float NOT NULL);"; db.execSQL(create_t_sampleCollection_table_sql); // 创建t_model数据表 String create_t_model_table_sql = "CREATE TABLE t_model (id INTEGER PRIMARY KEY AUTOINCREMENT,acc1 float NOT NULL,acc2 float NOT NULL,acc3 float NOT NULL,gyro1 float NOT NULL,gyro2 float NOT NULL,gyro3 float NOT NULL);"; db.execSQL(create_t_model_table_sql); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } }