Starting the Simple Database project
Create a new project in Android Studio. Call it Age Database
, use the Navigation Drawer Activity template, and leave all the Activity and layout names at their defaults. Before we do anything else, it is well worth running the app on an emulator to see how much has been auto-generated as part of this template, as can be seen in the following screenshot:
At first glance, it is just a plain old layout with a TextView
. But swipe from the left edge, or press the menu button, and the Navigation Drawer reveals itself:
Now we can modify the options and insert a Fragment
(with layout) for each option. To understand how it works, let's examine the auto-generated code.