From the course: Android Development Essential Training: 1 Your First App

Create your first Android app - Android Tutorial

From the course: Android Development Essential Training: 1 Your First App

Start my 1-month free trial

Create your first Android app

- [Instructor] When you first open Android Studio, the very first option is to start a new Android Studio project. When you click on that item, you're presented with several project templates. Project templates are an easy way to get started with your Android application, by having some of the boilerplate code and files created for you. The templates fall into a few high level categories, such as Phone and Tablet, Wear OS, TV, Automotive, and Android Things. If we go back to the Phone and Tablet section, we have a few variations of projects to select from. We have the Basic Activity, which gives us a toolbar and floating action button. The Bottom Navigation Activity, which creates a new activity with bottom navigation. The Empty Activity which is the bare bones. And then we have Fullscreen, Google Maps and more. For now, let's choose the Basic Activity, as this is going to give us a toolbar and a floating action button. Once we click on Next, we get to provide some configuration information for our project, like the name, the package, and the location where we want the file stored. But one of the key things to configure is the Min SDK that you will support. Practically every year Google releases a new version of the Android SDK. And more and more devices are upgraded as a result. However, there are still large pockets of users who are on older OS versions. So, choosing something like API 21 will make sure that you can support a large group of users. Now, Android Studio is going to load up all the resources that we need for our project. So let's click on Finish to get that started. Now, I've set up a virtual device here, which we won't learn how to do until a later chapter. So for now, just watch. We'll hit the green run button and see what we have. Before we get into a bit more details, let's run the app to see what we have. We'll do that by clicking on the green run button. First, we have a toolbar with the name of our application, My Application. It contains an overflow menu with one item, Settings. Clicking on it does nothing. Next, we see some text in the center of the screen. Hello, first fragment, and we have a button. When we click Next, the text disappears and the button changes to Previous. Finally, we have a fab. When we click it, it displays a snack bar message temporarily. Pretty cool for just a few button clicks. Now when we go back to Android Studio, we see a typical Android app structure was created for us. The main activity extends AppCompatActivity, which allows us to have backwards compatibility for older devices. And then inside of the onCreate method, we set up the toolbar and the fab. We've also implemented the methods which allow us to display the overflow menu and take action when something is selected. You see that starting here on line 23, and then line 29. Android Studio project templates are a great way to become more familiar with components and features available to you in the Android SDK. I encourage you to create a few more sample projects using the templates all on your own.

Contents