Android Open Source - RUflow Db Helper






From Project

Back to project page RUflow.

License

The source code is released under:

GNU General Public License

If you think the Android project RUflow listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package is.ru.app;
/*from   ww  w.ja  v a 2s.  c o m*/
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by rur on 23.9.2014.
 */
public class DbHelper extends SQLiteOpenHelper {

    public static final String DB_NAME = "FLOW_DB";
    public static final int DB_VERSION = 1;

    public static final String TableFlow = "flow";
    public static final String[] TableFlowCols = { "_id", "boardId", "type", "bestTime", "finished" };

    private static final String sqlCreateTableFlow =
            "CREATE TABLE flow(" +
                    " _id INTEGER PRIMARY KEY AUTOINCREMENT," +
                    " boardId INTEGER NOT NULL," +
                    " type TEXT NOT NULL," +
                    " bestTime DATETIME," +
                    " finished BOOLEAN DEFAULT FALSE " +
                    ");";

    private static final String sqlDropTableFlow =
            "DROP TABLE IF EXISTS flow;";

    public DbHelper( Context context ) {
        super( context, DB_NAME, null, DB_VERSION );
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL( sqlCreateTableFlow );
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL( sqlDropTableFlow );
        onCreate( db );
    }

    public void recreate(SQLiteDatabase db){
        db.execSQL( sqlDropTableFlow );
        onCreate( db );
    }
}




Java Source Code List

is.ru.app.Board.java
is.ru.app.Cellpath.java
is.ru.app.ColorListActivity.java
is.ru.app.Coordinate.java
is.ru.app.DbHelper.java
is.ru.app.FlowDbAdapter.java
is.ru.app.Global.java
is.ru.app.MainActivity.java
is.ru.app.MapPack.java
is.ru.app.Pack.java
is.ru.app.PlayActivity.java
is.ru.app.PuzzleSelectActivity.java
is.ru.app.Puzzle.java
is.ru.app.SelectActivity.java
is.ru.app.SuperPath.java