Android Open Source - improv-referee Improv Db Table






From Project

Back to project page improv-referee.

License

The source code is released under:

Copyright (C) <2011> by <Pierre-Henri Trivier> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to de...

If you think the Android project improv-referee 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 fr.pht.improv.db;
/* w w  w.j a v  a2s  .c o m*/
import java.util.Arrays;

import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class ImprovDbTable {
    public static final String TABLE_IMPROV = "improv";
    public static final String COL_ID = "_id";
    public static final String COL_TITLE = "title";
    public static final String COL_TYPE = "type"; // Warning is it acceptable ?
    public static final String COL_DURATION = "duration";
    public static final String COL_PLAYER = "player";
    public static final String COL_CATEGORY = "category";

    private static final String DATABASE_CREATE = "create table "
            + TABLE_IMPROV + "(" + COL_ID
            + " integer primary key autoincrement, " + COL_TITLE
            + " text not null, " + COL_TYPE + " text not null, " + COL_DURATION
            + " integer not null, " + 
            COL_CATEGORY + " text, " + COL_PLAYER + " integer)";
    
    public static void onCreate(SQLiteDatabase database) {
        database.execSQL(DATABASE_CREATE);
    }
    
    public static void onUpgrade(SQLiteDatabase database, int oldVersion,
            int newVersion) {
        Log.w(ImprovDbTable.class.getName(), "Upgrading database from version "
                + oldVersion + " to " + newVersion
                + ", which will destroy all old data");
        database.execSQL("DROP TABLE IF EXISTS " + TABLE_IMPROV);
        onCreate(database);
    }
    
}




Java Source Code List

fr.pht.improv.db.ImprovDbHelper.java
fr.pht.improv.db.ImprovDbTable.java
fr.pht.improv.model.ImprovRenderer.java
fr.pht.improv.model.ImprovType.java
fr.pht.improv.model.Improv.java
fr.pht.improv.reader.ImprovDatabaseReader.java
fr.pht.improv.reader.ImprovLineReader.java
fr.pht.improv.referee.ImprovDetailActivity.java
fr.pht.improv.referee.ImprovListActivity.java
fr.pht.improv.referee.ImprovListFragment.java
fr.pht.improv.referee.ImprovRefereeActivity.java
fr.pht.improv.referee.ProgressListener.java
fr.pht.improv.referee.ProgressTimer.java
fr.pht.improv.referee.contentprovider.ImprovContentProvider.java