Android Open Source - donatello-y-raphael Db Helper






From Project

Back to project page donatello-y-raphael.

License

The source code is released under:

MIT License

If you think the Android project donatello-y-raphael 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 com.example.ATracePath;
//from w  w  w . j ava 2  s.  c o  m
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by ranrath on 22/09/14.
 */
public class DbHelper extends SQLiteOpenHelper {

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

    public static final String TableProgress = "progress";
    public static final String[] TableProgressColumns = { "_id", "puzzleID", "packID", "challengeID", "finished" };

    private static final String sqlCreateTableStudent =
            "CREATE TABLE progress(" +
                    " _id INTEGER PRIMARY KEY AUTOINCREMENT," +
                    " puzzleID INTEGER NOT NULL," +
                    " packID INTEGER NOT NULL," +
                    " challengeID INTEGER NOT NULL," +
                    " finished BOOLEAN" +
                    ");";

    private static final String sqlDropTableStudents =
            "DROP TABLE IF EXISTS progress;";

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

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

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




Java Source Code List

com.example.ATracePath.Board.java
com.example.ATracePath.Cellpath.java
com.example.ATracePath.Challenge.java
com.example.ATracePath.Coordinate.java
com.example.ATracePath.DbHelper.java
com.example.ATracePath.Global.java
com.example.ATracePath.LevelsActivity.java
com.example.ATracePath.MainActivity.java
com.example.ATracePath.MapsActivity.java
com.example.ATracePath.Pack.java
com.example.ATracePath.PlayActivity.java
com.example.ATracePath.ProgressAdapter.java
com.example.ATracePath.Puzzle.java
com.example.ATracePath.SettingsActivity.java