Coding the Note class

This is the fundamental data structure of the app. It is a class that we will write ourselves from scratch and has all the member variables we need to represent one user note. In Chapter 13, Handling and Displaying Arrays of Data, you will learn some new Java to understand how we can let the user have dozens, hundreds, or thousands of notes.

Create a new class by right-clicking on the folder with the name of your package, the one that contains the MainActivity.java file. Select Java class under New and name it Note. Click on OK to create the class.

Add the highlighted code to the new Note class:

public class Note {

    private String mTitle;
    private String mDescription;
    private boolean mIdea;
    private boolean mTodo;
 private ...

Get Android Programming for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.