├── TaskReminderApp.apk ├── res ├── drawable-hdpi │ └── icon.png ├── drawable-ldpi │ └── icon.png ├── drawable-mdpi │ └── icon.png ├── menu │ ├── list_menu_item_longpress.xml │ └── list_menu.xml ├── layout │ ├── reminder_row.xml │ ├── reminder_list.xml │ └── reminder_edit.xml ├── xml │ └── task_preferences.xml └── values │ └── strings.xml ├── assets └── fontawesome-webfont.ttf ├── gen └── com │ └── TechSect │ └── TaskReminderApp │ ├── R.java │ ├── Manifest.java │ └── BuildConfig.java ├── local.properties ├── project.properties ├── ant.properties ├── src └── com │ └── TechSect │ └── TaskReminderApp │ ├── TaskPreferences.java │ ├── OnAlarmReceiver.java │ ├── ReminderManager.java │ ├── WakeReminderIntentService.java │ ├── ReminderService.java │ ├── OnBootReceiver.java │ ├── ReminderListActivity.java │ ├── RemindersDbAdapter.java │ └── ReminderEditActivity.java ├── proguard-project.txt ├── LICENSE ├── README.md └── AndroidManifest.xml /TaskReminderApp.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hitenpratap/Task-Reminder-App/HEAD/TaskReminderApp.apk -------------------------------------------------------------------------------- /res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hitenpratap/Task-Reminder-App/HEAD/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hitenpratap/Task-Reminder-App/HEAD/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hitenpratap/Task-Reminder-App/HEAD/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /assets/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hitenpratap/Task-Reminder-App/HEAD/assets/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /gen/com/TechSect/TaskReminderApp/R.java: -------------------------------------------------------------------------------- 1 | /*___Generated_by_IDEA___*/ 2 | 3 | package com.TechSect.TaskReminderApp; 4 | 5 | /* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ 6 | public final class R { 7 | } -------------------------------------------------------------------------------- /gen/com/TechSect/TaskReminderApp/Manifest.java: -------------------------------------------------------------------------------- 1 | /*___Generated_by_IDEA___*/ 2 | 3 | package com.TechSect.TaskReminderApp; 4 | 5 | /* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ 6 | public final class Manifest { 7 | } -------------------------------------------------------------------------------- /gen/com/TechSect/TaskReminderApp/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /*___Generated_by_IDEA___*/ 2 | 3 | package com.TechSect.TaskReminderApp; 4 | 5 | /* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ 6 | public final class BuildConfig { 7 | public final static boolean DEBUG = Boolean.parseBoolean(null); 8 | } -------------------------------------------------------------------------------- /res/menu/list_menu_item_longpress.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /res/layout/reminder_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /local.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must *NOT* be checked into Version Control Systems, 5 | # as it contains information specific to your local configuration. 6 | 7 | # location of the SDK. This is only used by Ant 8 | # For customization when using a Version Control System, please read the 9 | # header note. 10 | sdk.dir=/home/hitenpratap/android-sdk-linux 11 | -------------------------------------------------------------------------------- /res/menu/list_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-14 15 | android.library.reference.1=../../Downloads/Android-Bootstrap-master/AndroidBootstrap 16 | 17 | 18 | -------------------------------------------------------------------------------- /ant.properties: -------------------------------------------------------------------------------- 1 | # This file is used to override default values used by the Ant build system. 2 | # 3 | # This file must be checked into Version Control Systems, as it is 4 | # integral to the build system of your project. 5 | 6 | # This file is only used by the Ant script. 7 | 8 | # You can use this to override default values such as 9 | # 'source.dir' for the location of your java source folder and 10 | # 'out.dir' for the location of your output folder. 11 | 12 | # You can also use it define how the release builds are signed by declaring 13 | # the following properties: 14 | # 'key.store' for the location of your keystore and 15 | # 'key.alias' for the name of the key to use. 16 | # The password will be asked during the build when you use the 'release' target. 17 | 18 | -------------------------------------------------------------------------------- /res/layout/reminder_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 16 | 17 | -------------------------------------------------------------------------------- /src/com/TechSect/TaskReminderApp/TaskPreferences.java: -------------------------------------------------------------------------------- 1 | package com.TechSect.TaskReminderApp; 2 | 3 | import android.os.Bundle; 4 | import android.preference.EditTextPreference; 5 | import android.preference.PreferenceActivity; 6 | import android.text.method.DigitsKeyListener; 7 | 8 | public class TaskPreferences extends PreferenceActivity { 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | addPreferencesFromResource(R.xml.task_preferences); 13 | 14 | // Set the time default to a numeric number only 15 | EditTextPreference timeDefault = (EditTextPreference) findPreference(getString(R.string.pref_default_time_from_now_key)); 16 | timeDefault.getEditText().setKeyListener(DigitsKeyListener.getInstance()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /src/com/TechSect/TaskReminderApp/OnAlarmReceiver.java: -------------------------------------------------------------------------------- 1 | package com.TechSect.TaskReminderApp; 2 | 3 | 4 | import android.content.BroadcastReceiver; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.content.pm.ComponentInfo; 8 | import android.util.Log; 9 | 10 | public class OnAlarmReceiver extends BroadcastReceiver { 11 | 12 | private static final String TAG = ComponentInfo.class.getCanonicalName(); 13 | 14 | 15 | @Override 16 | public void onReceive(Context context, Intent intent) { 17 | Log.d(TAG, "Received wake up from alarm manager."); 18 | 19 | long rowid = intent.getExtras().getLong(RemindersDbAdapter.KEY_ROWID); 20 | 21 | WakeReminderIntentService.acquireStaticLock(context); 22 | 23 | Intent i = new Intent(context, ReminderService.class); 24 | i.putExtra(RemindersDbAdapter.KEY_ROWID, rowid); 25 | context.startService(i); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/com/TechSect/TaskReminderApp/ReminderManager.java: -------------------------------------------------------------------------------- 1 | package com.TechSect.TaskReminderApp; 2 | 3 | import java.util.Calendar; 4 | 5 | import android.app.AlarmManager; 6 | import android.app.PendingIntent; 7 | import android.content.Context; 8 | import android.content.Intent; 9 | 10 | public class ReminderManager { 11 | 12 | private Context mContext; 13 | private AlarmManager mAlarmManager; 14 | 15 | public ReminderManager(Context context) { 16 | mContext = context; 17 | mAlarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE); 18 | } 19 | 20 | public void setReminder(Long taskId, Calendar when) { 21 | 22 | Intent i = new Intent(mContext, OnAlarmReceiver.class); 23 | i.putExtra(RemindersDbAdapter.KEY_ROWID, (long)taskId); 24 | 25 | PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, i, PendingIntent.FLAG_ONE_SHOT); 26 | 27 | mAlarmManager.set(AlarmManager.RTC_WAKEUP, when.getTimeInMillis(), pi); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Hiten Pratap Singh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /src/com/TechSect/TaskReminderApp/WakeReminderIntentService.java: -------------------------------------------------------------------------------- 1 | package com.TechSect.TaskReminderApp; 2 | 3 | import android.app.IntentService; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.os.PowerManager; 7 | 8 | public abstract class WakeReminderIntentService extends IntentService { 9 | abstract void doReminderWork(Intent intent); 10 | 11 | public static final String LOCK_NAME_STATIC="com.dummies.android.taskreminder.Static"; 12 | private static PowerManager.WakeLock lockStatic=null; 13 | 14 | public static void acquireStaticLock(Context context) { 15 | getLock(context).acquire(); 16 | } 17 | 18 | synchronized private static PowerManager.WakeLock getLock(Context context) { 19 | if (lockStatic==null) { 20 | PowerManager mgr=(PowerManager)context.getSystemService(Context.POWER_SERVICE); 21 | lockStatic=mgr.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, 22 | LOCK_NAME_STATIC); 23 | lockStatic.setReferenceCounted(true); 24 | } 25 | return(lockStatic); 26 | } 27 | 28 | public WakeReminderIntentService(String name) { 29 | super(name); 30 | } 31 | 32 | @Override 33 | final protected void onHandleIntent(Intent intent) { 34 | try { 35 | doReminderWork(intent); 36 | } 37 | finally { 38 | getLock(this).release(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /res/xml/task_preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 16 | 17 | 18 | 21 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Task Reminder Application for Android 2 | ========= 3 | 4 | It's a Task reminder android application with many features like reminder about tasks etc. 5 | 6 | 7 | > Actually it's very unique and special for me bacuse it's my first Android application and i used many new things with it like: 8 | 9 | - Twitter Bootstrap Elements like EditText and Button etc. 10 | - Minimal duplicacy like same code for Add/Update task 11 | - and many more.... 12 | 13 | I have full code for this app along with Twitter Bootsrap module in this repo. All you have to do is check it out. 14 | 15 | Version 16 | ---- 17 | 18 | 1.0.0 19 | 20 | Tech 21 | ----------- 22 | 23 | This App uses a number of Tools to work properly: 24 | 25 | * [IntelliJ Idea](http://www.jetbrains.com/idea/download/) - Best Java IDE for Java beased techs 26 | * [ANdroid SDK](https://developer.android.com/sdk/index.html?hl=i) - Android SDK 27 | * [Twitter Bootstrap](http://getbootstrap.com/) - For Android Element like EditText and Button etc 28 | * [Java](https://java.com/en/download/index.jsp) - Java SE 1.7 29 | * [Git](http://git-scm.com/) - Best S/W versioning tool 30 | 31 | Installation 32 | -------------- 33 | * [Task Reminder APK](https://github.com/hitenpratap/Task-Reminder-App/blob/master/TaskReminderApp.apk?raw=true) - Just download it from here and enjoy. 34 | 35 | ``` 36 | Just download the app from repo and install it on your android device. 37 | ``` 38 | 39 | **Open Source Software, Hell Yeah!** 40 | -------------------------------------------------------------------------------- /src/com/TechSect/TaskReminderApp/ReminderService.java: -------------------------------------------------------------------------------- 1 | package com.TechSect.TaskReminderApp; 2 | 3 | import android.app.Notification; 4 | import android.app.NotificationManager; 5 | import android.app.PendingIntent; 6 | import android.content.Intent; 7 | import android.util.Log; 8 | 9 | public class ReminderService extends WakeReminderIntentService { 10 | 11 | public ReminderService() { 12 | super("ReminderService"); 13 | } 14 | 15 | @Override 16 | void doReminderWork(Intent intent) { 17 | Log.d("ReminderService", "Doing work."); 18 | Long rowId = intent.getExtras().getLong(RemindersDbAdapter.KEY_ROWID); 19 | 20 | NotificationManager mgr = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); 21 | 22 | Intent notificationIntent = new Intent(this, ReminderEditActivity.class); 23 | notificationIntent.putExtra(RemindersDbAdapter.KEY_ROWID, rowId); 24 | 25 | PendingIntent pi = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_ONE_SHOT); 26 | 27 | Notification note=new Notification(android.R.drawable.stat_sys_warning, getString(R.string.notify_new_task_message), System.currentTimeMillis()); 28 | note.setLatestEventInfo(this, getString(R.string.notify_new_task_title), getString(R.string.notify_new_task_message), pi); 29 | note.defaults |= Notification.DEFAULT_SOUND; 30 | note.flags |= Notification.FLAG_AUTO_CANCEL; 31 | 32 | // An issue could occur if user ever enters over 2,147,483,647 tasks. (Max int value). 33 | // I highly doubt this will ever happen. But is good to note. 34 | int id = (int)((long)rowId); 35 | mgr.notify(id, note); 36 | 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/com/TechSect/TaskReminderApp/OnBootReceiver.java: -------------------------------------------------------------------------------- 1 | package com.TechSect.TaskReminderApp; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Calendar; 5 | 6 | import android.content.BroadcastReceiver; 7 | import android.content.Context; 8 | import android.content.Intent; 9 | import android.content.pm.ComponentInfo; 10 | import android.database.Cursor; 11 | import android.util.Log; 12 | 13 | public class OnBootReceiver extends BroadcastReceiver { 14 | 15 | private static final String TAG = ComponentInfo.class.getCanonicalName(); 16 | 17 | @Override 18 | public void onReceive(Context context, Intent intent) { 19 | 20 | ReminderManager reminderMgr = new ReminderManager(context); 21 | 22 | RemindersDbAdapter dbHelper = new RemindersDbAdapter(context); 23 | dbHelper.open(); 24 | 25 | Cursor cursor = dbHelper.fetchAllReminders(); 26 | 27 | if(cursor != null) { 28 | cursor.moveToFirst(); 29 | 30 | int rowIdColumnIndex = cursor.getColumnIndex(RemindersDbAdapter.KEY_ROWID); 31 | int dateTimeColumnIndex = cursor.getColumnIndex(RemindersDbAdapter.KEY_DATE_TIME); 32 | 33 | while(cursor.isAfterLast() == false) { 34 | 35 | Log.d(TAG, "Adding alarm from boot."); 36 | Log.d(TAG, "Row Id Column Index - " + rowIdColumnIndex); 37 | Log.d(TAG, "Date Time Column Index - " + dateTimeColumnIndex); 38 | 39 | Long rowId = cursor.getLong(rowIdColumnIndex); 40 | String dateTime = cursor.getString(dateTimeColumnIndex); 41 | 42 | Calendar cal = Calendar.getInstance(); 43 | SimpleDateFormat format = new SimpleDateFormat(ReminderEditActivity.DATE_TIME_FORMAT); 44 | 45 | try { 46 | java.util.Date date = format.parse(dateTime); 47 | cal.setTime(date); 48 | 49 | reminderMgr.setReminder(rowId, cal); 50 | } catch (java.text.ParseException e) { 51 | Log.e("OnBootReceiver", e.getMessage(), e); 52 | } 53 | 54 | cursor.moveToNext(); 55 | } 56 | cursor.close() ; 57 | } 58 | 59 | dbHelper.close(); 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Task Reminder 4 | Task Reminder - Edit 5 | No Reminders Yet 6 | Add Reminder 7 | Delete Reminder 8 | Settings 9 | Title 10 | Body 11 | Save 12 | Edit Reminder 13 | Reminder Date 14 | Reminder Time 15 | 16 | 17 | Task has been saved 18 | 19 | 20 | A task needs to be reviewed! 21 | Task Reminder! 22 | 23 | 24 | task_default_category 25 | Task Title Default 26 | default_reminder_title 27 | Default Reminder Title 28 | The default title for a reminder. 29 | Default title for reminders. 30 | Default Reminder Title 31 | 32 | date_time_default_category 33 | Date Time Defaults 34 | time_from_now_default 35 | Time From Now 36 | The default time from now that a new reminder should be set to. 37 | Sets the default time for a reminder. 38 | Default Reminder Time 39 | 40 | 41 | -------------------------------------------------------------------------------- /res/layout/reminder_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 12 | 15 | 16 | 17 | 18 | 19 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 48 | 51 |