From the course: Building an Android App with Jetpack Libraries
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Create a data entity class - Android Tutorial
From the course: Building an Android App with Jetpack Libraries
Create a data entity class
- [Instructor] So far I've been working on how to display my data. But now I need to represent the data internally in memory. And for that I'll need a data class. First I'm going to create a new package where I'll place the class. I'll go to my base package under the Java directory and select new package, and I'll create a new data package. Then I'll right click on that package and I'll create a new Kotlin file. I'll set the name as note entity and I'll set this as a class. I'll add data to the beginning of this declaration. And that means that the class is going to have some properties. Then I'll get rid of these braces, and instead put in a pair of parentheses. And within the parentheses, I'll declare the properties of the class. First, there will be an ID and that will be an integer. Then I'll have a date. And that will be a Java date object. When you select this for importing, make sure you choose date from…
Contents
-
-
-
-
Add a navigation controller to the activity5m 39s
-
(Locked)
Add a RecyclerView to the main fragment5m 30s
-
(Locked)
Create a custom layout for list rows3m 56s
-
(Locked)
Create a data entity class3m 57s
-
(Locked)
Create sample data for testing5m 27s
-
(Locked)
Create a RecyclerView adapter2m 42s
-
(Locked)
Bind data to the RecyclerView4m 58s
-
-
-
-
-
-