Android Open Source - SecNote Secure Database Helper






From Project

Back to project page SecNote.

License

The source code is released under:

Apache License

If you think the Android project SecNote 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.baraccasoftware.securenotes.object;
/*from ww w.  j  a  v a 2s  .  com*/
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class SecureDatabaseHelper extends SQLiteOpenHelper {

  private static final String DB_NAME = "notes.db";
  private static final int DB_VERSION = 1;
  //notes table
  public static final String NOTES_TABLE_NAME = "notes";
  public static final String ID_NOTE = "id";
  public static final String TITLE_NOTE = "title";
  public static final String TEXT_NOTE = "note_text";
  public static final String DATA_NOTE = "note_date";
  public static final String IMG_NOTE = "image";
  
  //create note table
  private static final String TABLE_NOTE_CREATE= "create table  " +
      NOTES_TABLE_NAME+" ("+ID_NOTE + " integer primary key , " +
          TITLE_NOTE+" text not null, "+ TEXT_NOTE + " text not null, " +
          DATA_NOTE+" text not null, "+ IMG_NOTE + " blob );";
  
  
  
  
  public SecureDatabaseHelper(Context context) {
    super(context, DB_NAME, null, DB_VERSION);    
  }

  

  @Override
  public void onCreate(SQLiteDatabase database) {
    Log.d("TableCreations",TABLE_NOTE_CREATE);
    database.execSQL(TABLE_NOTE_CREATE);
  }

  @Override
  public void onUpgrade(SQLiteDatabase database, int old_version, int new_version) {
    Log.w(SecureDatabaseHelper.class.getName(),
            "Upgrading database from version " + old_version + " to "
                + new_version + ", which will destroy all old data");
        database.execSQL("DROP TABLE IF EXISTS " + NOTES_TABLE_NAME);
        onCreate(database);

  }

}




Java Source Code List

com.baraccasoftware.securenotes.app.ExportDialogFragment.java
com.baraccasoftware.securenotes.app.ImportDialogFragment.java
com.baraccasoftware.securenotes.app.InfoActivity.java
com.baraccasoftware.securenotes.app.InfoFragment.java
com.baraccasoftware.securenotes.app.LockedAppFragment.java
com.baraccasoftware.securenotes.app.LogInFragment.java
com.baraccasoftware.securenotes.app.MainActivity.java
com.baraccasoftware.securenotes.app.NoteDetailActivity.java
com.baraccasoftware.securenotes.app.NoteDetailFragment.java
com.baraccasoftware.securenotes.app.NoteListActivity.java
com.baraccasoftware.securenotes.app.NoteListFragment.java
com.baraccasoftware.securenotes.app.RegisterFragment.java
com.baraccasoftware.securenotes.app.SetPasswordFragment.java
com.baraccasoftware.securenotes.app.SettingsActivity.java
com.baraccasoftware.securenotes.app.SettingsFragment.java
com.baraccasoftware.securenotes.exception.LoadBitmapException.java
com.baraccasoftware.securenotes.object.ActivityUtilityInterface.java
com.baraccasoftware.securenotes.object.BitmapUtility.java
com.baraccasoftware.securenotes.object.Crypto.java
com.baraccasoftware.securenotes.object.DAO.java
com.baraccasoftware.securenotes.object.Encryptor.java
com.baraccasoftware.securenotes.object.ImageLoader.java
com.baraccasoftware.securenotes.object.NoteUtility.java
com.baraccasoftware.securenotes.object.Note.java
com.baraccasoftware.securenotes.object.PBKDF2Encryptor.java
com.baraccasoftware.securenotes.object.PasswordPreference.java
com.baraccasoftware.securenotes.object.SecureDatabaseHelper.java
com.baraccasoftware.securenotes.widget.NoteAdapter.java
com.baraccasoftware.securenotes.widget.SlidingDrawer.java
com.baraccasoftware.securenotes.widget.SwipeDismissListViewTouchListener.java
com.baraccasoftware.securenotes.widget.UndoBarController.java