Lesson Weekend

Now that we have Android Studio installed, let’s get started by creating a basic app. We are going to create a restaurant app that will display a list of restaurants by location. We will continue to build on this app throughout the course, adding additional features as we learn the tools we need to implement them.

Creating a New Project

With Android Studio open, click Start a new Android Studio project to create a new project.

We’ll fill out the Application Name field with the name of the app, MyRestaurants, exactly how we want it to appear on the device and in the Google Play Store. Note: Application names can only contain letters, numbers, spaces or underscores.

The Company Domain can be anything. You are welcome to use your personal website or epicodus.com as you will see throughout these videos. If you choose to use a different domain, please note that your package name will be different as well. The package name will be used to differentiate our app from others in the Play Store. Note: The package name should never contain capital letters.

Configure your new project

Selecting Android Versions

On the next screen, we need to select the version of Android our app will run on. We will be writing this app to run on a phone, so let’s leave the first box checked. In the adjacent drop down, we need to select the minimum SDK (Software Development Kit) that we would like our app to be able to run on.

Note: API and SDK versions are often used interchangeably. All SDKs have a corresponding API version.

Click on the Help me choose button to figure out which version to select.

API Version Distribution

This graph shows us the distribution of Android versions currently used in the world. Looking at the cumulative distribution, we can see that 94.8% of devices are currently running on Android 4.0 (API 15) or above. By choosing API 15 (Android 4.0 - Ice Cream Sandwich) we can be confident that our app will run smoothly on 94.8% of devices. The API level only really matters when we are using features that have either lost support in newer versions, or when accessing features that are only available in a brand new release. For the purposes of this basic app, we do not need to worry about this.

Adding Pre-Built Activities

On the next screen, we can choose from a variety of pre-built activities. Think of these like templates included in Microsoft Word. When starting a new project, we generally want to start with blank files so let’s select Empty Activity. Note: Do not select _Blank Activity_ as a _Blank Activity_ includes a few additional code snippets that will be a bit confusing at first.

So what is an activity anyway? Activities can be thought of as the different screens that make up an app. On the next page, we will choose a name for our first activity. Similar to using the nameindex.html for a website's main page, it is common practice in Android to name our primary activity MainActivity. Let’s keep the activity name MainActivity. We are finished creating a new project. Click Finish and wait while Android Studio builds our project.


Example GitHub Repo for MyRestaurants

Terminology


  • Software Development Kit (SDK): A set of development tools specific to a particular software package, framework, or platform.

  • Activity: The different screens that make up an App in Android.

Tips


  • Application names can only contain letters, numbers, spaces or underscores.

  • Package names should never contain capital letters.

  • API and SDK versions are often used interchangeably. All SDKs have a corresponding API version.

Example