i want to create an app for learning.IT contains an image and four possible answers out of which one of them is true...i have created 3 tables image table with word,image and word id which is primary key complexity table with word id and complexity of that word cluster table with word id and cluster number
now how can i populate the image table with images from the system and access the image on the image view
public class Database extends SQLiteOpenHelper
{
private static final int DATABASE_VERSION = 2;
private static final String DATABASE_NAME = "kid.db";
public Database(Context context)
{
super(context,DATABASE_NAME,null,DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase)
{
final String SQL_CREATE_IMAGE_TABLE = "create table image(word_ID integer primary key,word text not null,img blob);";
final String SQL_CREATE_COMPLEXITY_TABLE = "create table compexity(WORD_ID integer primary key,complexity integer not null);";
final String SQL_CREATE_CLUSTER_TABLE = "create table cluster(WORD_ID integer primary key,cluster integer not null);";
sqLiteDatabase.execSQL(SQL_CREATE_IMAGE_TABLE);
sqLiteDatabase.execSQL(SQL_CREATE_COMPLEXITY_TABLE);
sqLiteDatabase.execSQL(SQL_CREATE_CLUSTER_TABLE);
}
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion)
{
}
}
Aucun commentaire:
Enregistrer un commentaire