Back to project page TextSpam.
The source code is released under:
Apache License
If you think the Android project TextSpam listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.andrew749.textspam.Database; //from ww w . j av a2s. c o m import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; /** * Created by andrew on 01/07/13. */ public class DatabaseHelper extends SQLiteOpenHelper { public static final String TABLE_NAME = "conversations"; public static final String COLUMN_ID = "_id"; public static final String COLUMN_MESSAGE = "message"; public static final String COLUMN_RECIPIENTS = "RECIPIENTS"; private static final String DATABASE_CREATE = "create table " + TABLE_NAME + "(" + COLUMN_ID + " integer primary " + "key " + "autoincrement, " + COLUMN_MESSAGE + " text not null, " + COLUMN_RECIPIENTS + " text not null " + ");"; private static final String DATABASE_NAME = "conversations.db"; private static final int DATABASE_VERSION = 1; public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase sqLiteDatabase) { sqLiteDatabase.execSQL(DATABASE_CREATE); } @Override public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i2) { Log.d(DatabaseHelper.class.getName(), "Upgrading database from version " + i + " to " + i2 + ", " + "which will destroy all data"); sqLiteDatabase.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME); onCreate(sqLiteDatabase); } }