The sample apps for this course are based around a fictional business named Nadia's Garden Restaurant. The beginning app only has some color settings for material design themes, and a bit of code to display text on the app's only screen. As the course moves along you'll add functionality to the app to learn how to use persistent data in Android apps.
- [Instructor] In the exercise files, I've included a copy of the starting app. This is a basic Android studio project, and as with all the exercise files you can open it from the Android Studio welcome screen. I'll select open an existing android studio project, I'll navigate to my desktop and then to the exercise files, and I'll choose the starting app project, and I'll open it. Whenever you open each project, you'll start at a pretty much empty screen, and I suggest always starting by pressing the shift key twice, and looking for the main activity class.
Then open the project window, and then click on the scroll from source icon, and that will open the directory's structure to the open file. The main activity class has a very simple XML layout, it has just a single text view control wrapped in relative layout. It has an ID of out, and in the main activity, there's a reference to that text view, which is being initialized in the on create method. And then in the on create method I'm simply displaying the text, ready to code. I'll run the application in my virtual device.
And I see the text ready to code. And that's it. It's a very clean, simple starting application. There are a couple of things to be aware of about the app. First, I'm using the same unique ID throughout the course for every application, so you're not creating a whole bunch of different applications on a device. The app ID is always com.example.android.data. I always start with com.example in these exercise files, that's because it's a prohibited domain in the Google Play store.
That is, if you were to try to wrap up this application and simply submit it to Google Play, it would be rejected. If you want to create your own application based on the code that I'm showing you, you're welcome to do so, but you'll need to use your own application ID. Also, there are just a couple of strings to find in the strings.XML file. The app name, and the ready to code message. I'll be adding a lot more of these during the course. And I'll also show you the color settings. I'll go to the values directory under resources, to colors.XML, and here's where I'm controlling all of the material designed colors.
I'm setting them using these IDs, and then I'm using many of them here in the styles.XML file. It's a very simple starting app, but as we go through the demonstrations in the course, I'll use this app to show you how to manage and display data in your Android applications.
- Modeling data in POJO classes
- Customizing a ListView item display
- Displaying data in a RecyclerView
- Creating a custom array adapter
- Managing shared preferences with Java
- Creating and importing JSON data files
- Accessing SQLite from the command line
- Retrieving data with SQLite queries