Android Open Source - Now_Manager Contracts






From Project

Back to project page Now_Manager.

License

The source code is released under:

Apache License

If you think the Android project Now_Manager 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.collinguarino.nowmanager.provider;
//from   ww w .  j  a v a2s. c o  m
import android.content.ContentValues;
import android.net.Uri;
import android.provider.BaseColumns;

public class Contracts {

    public static class TimeCards implements BaseColumns {

        public static final String TABLE_NAME = "timeCards";
        public static final Uri CONTENT_URI = Uri.parse("content://" + NowManagerProvider.AUTHORITY + "/" + TABLE_NAME);

        public static final String C_EVENT_NAME_INPUT = "eventNameInput";
        public static final String C_TIMESTAMP        = "timestamp";
        public static final String C_IS_TALLY         = "isTally"; // deprecated
        public static final String C_IS_THIRD_PARTY   = "isThirdParty"; // deprecated
        public static final String C_IS_LOCATION      = "isLocation";
        public static final String C_FILE_PATH        = "filePath";
        public static final String C_IS_IMAGE         = "isImage";
        public static final String C_IS_VOICE         = "isVoice";
        public static final String C_ADDRESS          = "address";

        public static final int I_ID               = 0;
        public static final int I_EVENT_NAME_INPUT = 1;
        public static final int I_TIMESTAMP        = 2;
        public static final int I_IS_TALLY         = 3; // deprecated
        public static final int I_IS_THIRD_PARTY   = 4; // deprecated
        public static final int I_IS_LOCATION      = 5;
        public static final int I_FILE_PATH        = 6;
        public static final int I_IS_IMAGE         = 7;
        public static final int I_IS_VOICE         = 8;
        public static final int I_ADDRESS          = 9;

        // A string that defines the SQL statement for creating a table
        static final String SQL_CREATE_MAIN = "CREATE TABLE " +
                "timeCards " +                       // Table's name
                "(" +                           // The columns in the table
                _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                C_EVENT_NAME_INPUT + " TEXT, " +
                C_TIMESTAMP + " DATETIME DEFAULT CURRENT_TIMESTAMP, " +
                C_IS_TALLY + " INTEGER DEFAULT 0, " + C_IS_THIRD_PARTY +
                " INTEGER DEFAULT 0, " + C_IS_LOCATION + " INTEGER DEFAULT 0, " +
                C_IS_IMAGE + " INTEGER DEFAULT 0, " + C_FILE_PATH + " TEXT, " +
                C_IS_VOICE + " INTEGER DEFAULT 0, " + C_ADDRESS + " TEXT" + ")";

        // Contacts rows will retrieve all rows
        public static final String[] SELECT_ALL_PROJECTION = new String[]{
                _ID,
                C_EVENT_NAME_INPUT,
                C_TIMESTAMP,
                C_IS_TALLY,
                C_IS_THIRD_PARTY,
                C_IS_LOCATION,
                C_FILE_PATH,
                C_IS_IMAGE,
                C_IS_VOICE,
                C_ADDRESS
        };

        /**
         * Helper method to get a content values object for creating a new time card.
         *
         * @return Non-null object
         */
        public static ContentValues getInsertValues(final String eventNameInput, final boolean isLocation, final boolean isImage,
                                                    final String filePath, final boolean isVoice, final String address) {
            final ContentValues values = new ContentValues();

            values.put(C_EVENT_NAME_INPUT, eventNameInput);
            values.put(C_TIMESTAMP, System.currentTimeMillis());
            values.put(C_IS_LOCATION, isLocation);
            values.put(C_FILE_PATH, filePath);
            values.put(C_IS_IMAGE, isImage);
            values.put(C_IS_VOICE, isVoice);
            values.put(C_ADDRESS, address);

            // deprecated
            values.put(C_IS_THIRD_PARTY, false);
            values.put(C_IS_TALLY, false);

            return values;
        }
    }
}




Java Source Code List

com.collinguarino.nowmanager.AsyncGPSLog.java
com.collinguarino.nowmanager.EditTextBackEvent.java
com.collinguarino.nowmanager.EditTextMovement.java
com.collinguarino.nowmanager.SwipeDismissListViewTouchListener.java
com.collinguarino.nowmanager.TimeCardAdapter.java
com.collinguarino.nowmanager.TimeCardObject.java
com.collinguarino.nowmanager.floating.AddFloatingActionButton.java
com.collinguarino.nowmanager.floating.FloatingActionButton.java
com.collinguarino.nowmanager.floating.FloatingActionsMenu.java
com.collinguarino.nowmanager.provider.Contracts.java
com.collinguarino.nowmanager.provider.MainDatabaseHelper.java
com.collinguarino.nowmanager.provider.NowManagerProvider.java
com.collinguarino.nowmanager.ui.ActivityMain.java
com.collinguarino.nowmanager.ui.ActivitySettings.java
com.collinguarino.nowmanager.ui.Dialogs.java