Android Open Source - TodoList Todo Service






From Project

Back to project page TodoList.

License

The source code is released under:

Apache License

If you think the Android project TodoList 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 lyc.app;
// ww w .  j a  v  a 2  s  .co m
import android.app.IntentService;
import android.content.Intent;
import android.database.Cursor;
import android.util.Log;

/**
 * Created by ivan on 14-10-23.
 */
public class TodoService extends IntentService {

  private static final String TAG = "TodoService";

  public TodoService() {
    super("TodoService");
  }

  @Override
  public void onCreate() {
    super.onCreate();
  }

  @Override
  protected void onHandleIntent(Intent intent) {
    Cursor
        cursor =
        getContentResolver()
            .query(App.Todo.CONTENT_URI, null,
                   " strftime('%s', " + App.Todo.COLUMN_PLAN_FINISHED_DATE
                   + "/1000, 'unixepoch', 'localtime') - strftime('%s', 'now', 'localtime') < "
                   + 3 * 3600 +
                   " and "
                   + App.Todo.COLUMN_STATUS
                   + " = ?",
                   new String[]{String.valueOf(App.Todo.STATUS_UNFINISHED)},
                   null);
    Log.d(TAG, "count = " + cursor.getCount());
    if (cursor.getCount() > 0) {
      //trigger notifications
      while (cursor.moveToNext()) {
        Log.d(TAG, cursor.getString(cursor.getColumnIndex(App.Todo.COLUMN_TITLE)));
      }
    }
  }
}




Java Source Code List

lyc.app.AddActivity.java
lyc.app.App.java
lyc.app.BootReceiver.java
lyc.app.DateUtils.java
lyc.app.MainActivity.java
lyc.app.TodoService.java
lyc.app.adapter.TodoCursorAdapter.java
lyc.app.fragment.FinishedTodoFragment.java
lyc.app.fragment.UnFinishedTodoFragment.java
lyc.app.provider.TodoProvider.java
lyc.simplesqlite.annotation.Column.java
lyc.simplesqlite.annotation.Table.java
lyc.simplesqlite.exception.AnnotationNotFoundException.java
lyc.simplesqlite.util.MetaData.java
lyc.simplesqlite.util.StringUtils.java