You can create new Android apps from the Android Studio Welcome screen. Learn how to choose an app template and about the other choices you have to make at the beginning of a new software project.
- [Man] To create a new android app, you'll create a project in Android Studio. From the welcome screen, click on the first option, and now you're asked to select your beginning template. The template will determine what your screen looks like. Each screen in an android app, designed for phones and tablets, is called an activity. An activity is simply something that the application will do, and on a phone and tablet, it has a visual component. There are a number of templates available, from the simplest, like the basic and empty activities, all the way down to the much more complex activities.
For this demonstration, I'm going to choose the basic activity. It has a simple bit of text in the center of the screen and a widget, called a floating action button, in the lower, right corner. I'll choose that template and click next. On this screen, you're asked for the application name, and it could be anything you like. I'll call my app My First App. The package name is a universally unique ID. Each app in the Google Play store, or other app stores, has to have this global, unique ID.
It's a simple sting, but typically, it's set up with reverse domain notation. So the first part of the string is your organization, using reverse domain notation just like with a java package, and then after that, some string that identifies the application itself, usually in all lowercase. I'm going to keep this example of com.example.myfirstapp, and I'll use that unique package name throughout this course. Next you select the location of the project.
The default location is in a directory called AndroidStudioProjects, under your home directory, but it can be anywhere on your hard disk. It is recommended that you choose a directory location that doesn't have any spaces in the names. Next choose your programming language, and you can select either Java or Kotlin. I'm going to choose Kotlin and use that language throughout the course. The minimum API level determines which devices your app will be able to run on. This screen will default to API 15, but as of late 2018, Google recommends a minimum of API 16, because earlier version of the operating system will no longer support certain features.
There are two options down here at the bottom. The first one can be ignored; it's about instant apps, not something we're going to deal with. And the second says, "Use AndroidX artifacts." I'll explain what AndroidX artifacts are later on in the course so, for now, just leave that unchecked and click finish. And that will create your application. The first time you create an application, you might see that it takes a while for the application to be built. That's because Android Studio has to download certain components that are identified in your application's configuration.
You might also see prompts to update the Kotlin plugin if you're using Kotlin. And if you see that prompt, I recommend installing it, but I'm going to show you something about that in a later video, so leave it alone for the moment. Watch this area down here in the lower center of the screen. As long as there are messages being displayed, that means that the application building process is still going on. When you don't see any other messages and if you look up here and you see this run button is active, that means your application is ready to work with.
Now I can't do anything with the application yet because I don't have a device to test it on. So that's all I'm going to demonstrate in this video, and then after I've created or plugged in a device, I'll show you how to run the application from Android Studio.
- Installing Android Studio
- Creating your first Android Studio project
- Managing configuration files, including Gradle scripts
- Defining screens with activities
- Implementing designs in XML layouts