Android Open Source - TextSpam Database Helper






From Project

Back to project page TextSpam.

License

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.

Java Source Code

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);
    }
}




Java Source Code List

com.andrew749.textspam.Custom.java
com.andrew749.textspam.MainActivity.java
com.andrew749.textspam.MessageReciever.java
com.andrew749.textspam.Messager.java
com.andrew749.textspam.SwipeDismissListViewTouchListener.java
com.andrew749.textspam.Adapters.AutoCompleteCursorAdapter.java
com.andrew749.textspam.Adapters.ContactListAdapter.java
com.andrew749.textspam.Database.ConversationModel.java
com.andrew749.textspam.Database.DataSource.java
com.andrew749.textspam.Database.DatabaseHelper.java
com.andrew749.textspam.Fragments.Conversations.java
com.andrew749.textspam.Fragments.QuickMessageFragment.java
com.andrew749.textspam.Fragments.TutorialActivity.java
com.inscription.ChangeLogDialog.java
com.inscription.WhatsNewDialog.java