这是我的代码,我的数据库没有显示在文件资源管理器中。我犯错了吗?有人可以解决吗?
我很抱歉,因为我只是 android 的初学者
package com.testmysqlite.database;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
public class MySqliteOpenHelper extends SQLiteOpenHelper {
private static String dbName = "TestDatabase.db";
private static String tableName = "User";
private static String columnId = "Id";
private static String columnName = "Name";
private String sql = "create table "+tableName+"("+columnId+" integer,"+columnName+" text)";
private SQLiteDatabase sqliteDatabase = null;
public MySqliteOpenHelper(Context context) {
super(context, dbName, null, 1);
sqliteDatabase = getWritableDatabase();
// TODO Auto-generated constructor stub
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(sql);// TODO Auto-generated method stub
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// TODO Auto-generated method stub
}
}