Android Open Source - myToDo Notice D A O






From Project

Back to project page myToDo.

License

The source code is released under:

Apache License

If you think the Android project myToDo 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.gutspot.apps.android.mytodo.dao;
//from  www.  j  a va2 s.  c o  m
import java.util.Date;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;

import com.gutspot.apps.android.mytodo.model.Notice;

public class NoticeDAO extends AbstractDAO<Notice> {

    private static final String TABLE_NAME = "notice";

    private static final String COLUMN_TODO_ID = "todo_id";
    private static final String COLUMN_TIME = "time";

    public NoticeDAO(Context context) {
        super(context, TABLE_NAME);
    }

    @Override
    protected ContentValues createValues(Notice entity, ContectValuesState state) {
        ContentValues values = super.createValues(entity, state);

        values.put(COLUMN_TODO_ID, entity.getToDoId());
        values.put(COLUMN_TIME, entity.getTime().getTime());

        return values;
    }

    @Override
    protected Notice parseValuse(Cursor cursor) {
        Notice notice = new Notice(cursor.getLong(cursor.getColumnIndex(COLUMN_ID)),
                cursor.getLong(cursor.getColumnIndex(COLUMN_VERSION)));

        notice.setToDoId(cursor.getLong(cursor.getColumnIndex(COLUMN_TODO_ID)));
        notice.setTime(new Date(cursor.getLong(cursor.getColumnIndex(COLUMN_TIME))));

        return notice;
    }

}




Java Source Code List

com.gutspot.apps.android.mytodo.MainActivity.java
com.gutspot.apps.android.mytodo.MemoActivity.java
com.gutspot.apps.android.mytodo.ToDoActivity.java
com.gutspot.apps.android.mytodo.adapter.MemoAdapter.java
com.gutspot.apps.android.mytodo.adapter.ToDoAdapter.java
com.gutspot.apps.android.mytodo.dao.AbstractDAO.java
com.gutspot.apps.android.mytodo.dao.MemoDAO.java
com.gutspot.apps.android.mytodo.dao.NoticeDAO.java
com.gutspot.apps.android.mytodo.dao.ToDoDAO.java
com.gutspot.apps.android.mytodo.dialog.DateTimeDialog.java
com.gutspot.apps.android.mytodo.dialog.MemoOptionsDialog.java
com.gutspot.apps.android.mytodo.dialog.ToDoOptionsDialog.java
com.gutspot.apps.android.mytodo.model.AbstractEntity.java
com.gutspot.apps.android.mytodo.model.Memo.java
com.gutspot.apps.android.mytodo.model.Notice.java
com.gutspot.apps.android.mytodo.model.ToDo.java
com.gutspot.apps.android.mytodo.utils.AlertUtil.java
com.gutspot.apps.android.mytodo.utils.DBOpenHelper.java
com.gutspot.apps.android.mytodo.utils.DateTimeUtil.java