If I understand correctly, when working with DB, I have to do as follows
DaoMaster.OpenHelper helper = new DaoMaster.OpenHelper(this, "test-db", null) {
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
};
SQLiteDatabase db = helper.getWritableDatabase();
DaoMaster daoMaster = new DaoMaster(db);
daoSession = daoMaste
I'm trying to upgrade my database from version 1 to version 2.
I'm using Green Dao and I'm trying to do the following:
My database name is db_21 and it sits in the /data/ folder.
I want to delete the content of the DB when the user is loging out.
I want to know one thing in android sqlite.
I created my database in sdcard.
I have created a class to manage a SQLite database.
I'm making a dictionary which can remember user's words, but i want to limit the Word List about 100 words. How can i limit this Word List? I tried to find some info to do that but it seem to hard. please help me!
I am confused about how to do this..
For database I use:
public class SqlHandler {
public static final String DATABASE_NAME = "MY_DATABASE";
public static final int DATABASE_VERSION = 1;
Context context;
SQLiteDatabase sqlDatabase;
SqlDbHelper dbHelper;
public SqlHandler(Context context) {
dbHelper = new SqlDbHelper(c
This is my Code For the DbHelper Class:
package com.example.emp_management;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class DatabaseHelper extends
How come whenever I clear my app data, my previously working SQLite database doesn't work anymore?
here is my code for my database:
package tsu.ccs.capstone;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHe