Android Open Source - MyJournal Journal Contract






From Project

Back to project page MyJournal.

License

The source code is released under:

GNU General Public License

If you think the Android project MyJournal 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.shane87.myjournal;
//from  www.jav a  2  s . co  m
import android.provider.BaseColumns;

public final class JournalContract {
  
  public JournalContract(){}
  
  public static abstract class JournalDb implements BaseColumns {
    //Database definitions, i.e. table name and column names
    private static final String TABLE_NAME = "myjournal";
    private static final String COLUMN_NAME_ENTRY_ID = "entryid";
    private static final String COLUMN_NAME_TITLE = "title";
    private static final String COLUMN_NAME_DATE = "date";
    private static final String COLUMN_NAME_TIME = "time";
    private static final String COLUMN_NAME_ENTRY = "entry";
    
    //Database actions
    private static final String TEXT_TYPE = " TEXT";
    private static final String INT_TYPE = " INTEGER";
    private static final String COMMA_SEP = ",";
    private static final String SQL_CREATE_ENTRIES = 
        "CREATE TABLE " + TABLE_NAME + " (" + _ID +
        " INTEGER PRIMARY KEY," + COLUMN_NAME_ENTRY_ID +
        INT_TYPE + COMMA_SEP + COLUMN_NAME_TITLE +
        TEXT_TYPE + COMMA_SEP + COLUMN_NAME_DATE +
        TEXT_TYPE + COMMA_SEP + COLUMN_NAME_TIME +
        TEXT_TYPE + COMMA_SEP + COLUMN_NAME_ENTRY +
        TEXT_TYPE + ");";
    
    public static String getTableName()
    {
      return TABLE_NAME;
    }
    
    public static String getColumnNameUniqueId()
    {
      return _ID;
    }
    
    public static String getColumnNameEntryId()
    {
      return COLUMN_NAME_ENTRY_ID;
    }
    
    public static String getColumnNameTitle()
    {
      return COLUMN_NAME_TITLE;
    }
    
    public static String getColumnNameDate()
    {
      return COLUMN_NAME_DATE;
    }
    
    public static String getColumnNameTime()
    {
      return COLUMN_NAME_TIME;
    }
    
    public static String getColumnNameEntry()
    {
      return COLUMN_NAME_ENTRY;
    }
    
    public static String getSqlCreateEntries()
    {
      return SQL_CREATE_ENTRIES;
    }
  }

}




Java Source Code List

com.shane87.myjournal.EditEntryActivity.java
com.shane87.myjournal.JournalAdapter.java
com.shane87.myjournal.JournalContract.java
com.shane87.myjournal.JournalDbHelper.java
com.shane87.myjournal.JournalEntry.java
com.shane87.myjournal.Journal.java
com.shane87.myjournal.MainActivity.java