sodcalculator

10 Tech How-To

Android Notes & Reminders App: Step-by-Step

Guide 10-29572 · Updated · Step by step

This guide shows you how to build a single Android app that handles both notes and small reminders, so you can keep your ideas and to-dos in one place. You’ll create a simple list-based interface where each note can optionally have a date and time attached, triggering a notification when that moment arrives. No prior Android experience is needed beyond basic Java or Kotlin familiarity.

What You’ll Need

  • Android Studio (latest stable version) installed on your computer
  • A device or emulator running Android 5.0 (API 21) or higher
  • Basic understanding of Java or Kotlin syntax
  • Familiarity with XML layouts and Android activities

Step-by-Step

  1. Create a new project – Open Android Studio, click “New Project”, choose “Empty Activity”, name it (e.g., NotesReminder), select Kotlin or Java, set minimum SDK to API 21, and finish.
  2. Add dependencies – Open build.gradle (module level) and add the following lines inside dependencies: implementation 'androidx.recyclerview:recyclerview:1.3.2' and implementation 'androidx.room:room-runtime:2.6.1' (plus kapt if using Kotlin). Sync the project.
  3. Create the Note entity – Make a new Java/Kotlin class named Note with fields: id (primary key, auto-generate), title, content, reminderTime (as a long timestamp, nullable), and isReminder (boolean). Annotate with @Entity and @PrimaryKey.
  4. Create the DAO – Define an interface NoteDao with @Insert, @Update, @Delete, and @Query("SELECT * FROM notes ORDER BY id DESC") to get all notes.
  5. Set up Room database – Create a class extending RoomDatabase, with a singleton instance and a method to get the DAO. Use Room.databaseBuilder(...) with a name like “notes_db”.
  6. Build the main layout – In activity_main.xml, add a RecyclerView and a FloatingActionButton (FAB) for adding a new note.
  7. Create the note item layout – Make item_note.xml with two TextViews (title and content) and a small icon or text showing reminder status (e.g., a clock emoji).
  8. Implement the RecyclerView adapter – Create a class NoteAdapter extending RecyclerView.Adapter. In onBindViewHolder, set the title/content text and show a reminder icon if the note has one.
  9. Set up the main activity – In MainActivity, initialize the database, get the DAO, set up the RecyclerView with the adapter, and load all notes from the database in a background thread (use AsyncTask or coroutines).
  10. Add a new note screen – Create a second activity AddNoteActivity with EditTexts for title and content, plus a checkbox or switch for “Set reminder” and a DatePicker/TimePicker to choose when.
  11. Save the note – In AddNoteActivity, on save, create a Note object, set the reminderTime if the reminder switch is on, insert it into the database, and finish the activity.
  12. Schedule the notification – Use AlarmManager to schedule a broadcast at the reminder time. Create a BroadcastReceiver that shows a notification when triggered. Pass the note ID and title as extras.
  13. Request notification permission – For Android 13+, add POST_NOTIFICATIONS permission in AndroidManifest.xml and request it at runtime in MainActivity.
  14. Handle note clicks – In the adapter, add a click listener that opens the note in an edit screen (you can reuse AddNoteActivity with the note ID). Update the note on save.
  15. Delete notes – Add a swipe-to-delete or a delete button in the edit screen. Call the DAO’s delete method and refresh the list.
  16. Test thoroughly – Run the app on an emulator or device. Create a note with a reminder set for 2 minutes ahead, press Home, and wait for the notification to appear.

Common Mistakes

  • Forgetting to add the notification permission on Android 13+ – the app crashes or the notification never appears.
  • Using AlarmManager with an inexact alarm by default – set setExact() for precise reminders, but be aware of battery optimizations.
  • Not handling the case where the device reboots – alarms are lost; you need to re-schedule them using BOOT_COMPLETED receiver.
  • Blocking the main thread with database operations – always use background threads.
  • Not setting a unique request code for each alarm – use the note ID as the request code to avoid overwriting.

Tips

  • Use a ViewModel and LiveData to observe the database and update the UI automatically.
  • Store the reminder time as a Unix timestamp (milliseconds) for easy comparison and scheduling.
  • For recurring reminders, you’d need to re-schedule after each trigger – but for small reminders, one-time is fine.
  • Add a search bar to filter notes – it improves usability without much extra code.
  • Use a NotificationChannel for Android 8+ to ensure notifications display properly.

Troubleshooting

  • App crashes on launch – Check the Logcat for errors. Common causes: missing Room dependency, incorrect database version, or missing permission declaration.
  • Notification doesn’t appear – Verify that the alarm is set correctly (add a log). Check if the app is force-stopped or the device is in Doze mode – you may need to use setAndAllowWhileIdle().
  • Notes not saving – Ensure the database write is happening on a background thread and that you’re calling the DAO method correctly.
  • RecyclerView shows blank – Make sure you’ve set the adapter and passed the list of notes. Check that the layout manager is set.
  • Reminder time is off – Timezone issues – store the timestamp in UTC and convert to local time when displaying.

Frequently Asked Questions

  1. Can I use this app for reminders that repeat daily? – Yes, but you’d need to modify the alarm scheduling to use setRepeating() or re-schedule after each trigger. The current guide focuses on one-time reminders.
  2. Do I need a server for this app? – No, everything is stored locally on the device using Room database. No internet connection is required.
  3. Can I export my notes? – Not in this basic version. You’d need to add a share or export feature, which is beyond the scope of this guide.
  4. Will the reminder work if the app is closed? – Yes, as long as the alarm is set and the app isn’t force-stopped. The BroadcastReceiver will still fire and show a notification.
  5. Can I attach photos to notes? – Not in this simple version. You’d need to add image picking and storage, which complicates the database schema.
  6. Is Kotlin or Java better for this? – Both work. Kotlin is more concise and recommended for new projects, but Java is fine if you’re more comfortable with it.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →