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 sample data for testing

Create sample data for testing - Android Tutorial

From the course: Building an Android App with Jetpack Libraries

Start my 1-month free trial

Create sample data for testing

- [Instructor] I'm almost ready to display data but I need some data to display. I'm not ready to create my database yet, so I'll create a class that provides sample data. I'll place this in my data package, and I'll name the new class SampleDataProvider, and I'll create it as a class. I'll create a companion object block, and this is like creating static values in a Java class, and I'll create a few properties. The first one will be named sampleText1, and it'll have a simple value of, a simple note. Then I'll duplicate that a couple of times, I'll set this one to sampleText2 and this one to sampleText3. For the second one I'll add in a line feed with a backslash in, and this one will be a note with a line feed, and this will let me test simple multi-line notes, and then for the third one I'm going to want a much longer value, so I'm going to add in two pairs of triple double quotes like that, and when I separate…

Contents