Starting the Age Database project
Create a new project in Android Studio. Call it Age Database
, use the Navigation Drawer Activity template, and leave all the other settings as we have throughout the book. 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
instance (with a layout) for each option. To understand how it works, let's examine the auto-generated code.