التخطي إلى المحتوى الرئيسي

Making Your First App : Hello World

Making Your First App : Hello World
1. Welcome to Android Studio Screen
First, open Android Studio. You should see this window. Go ahead and click Start a new Android Studio Project. An Android Studio Project typically means the code and files for one Android Application.

Start a new Android Studio Project

2. New Project Screen
Here we see a few options we get to choose.

App Name Application Name is the name of the application we'll see in the App Bar at the top of our app, as well as shown in the All Apps screen on the device. Using the default is fine (examples were made with a happy birthday app, but for our purposes the naming doesn't matter).

Company Domain

Next is company domain. Since we're practicing together right now, use the domain android.example.com, which should be what is automatically shown. If you look below, you'll see that it generates the package name com.example.android.myapplication, which is combination of the reverse of the domain and your app name.

3. Target Android Devices
Next you will see this screen:

Minimum SDK Only select Phone and Tablet since we're not making an app for TV or Wear. For Minimum SDK choose the deliciously named API 15: Android 4.0.3 (IceCreamSandwich). If you're wondering about SDK naming, check out the wikipedia article on Android Version History

4. Add an activity to Mobile
Here we are given a bunch of starting applications we can choose from, depending on what we're trying to make. Go ahead and choose Blank Activity. It's the simplest one that still gives you some default files to start with.

Create New Project

5. Choose option for your new file
Finally we have some names for different files that make up our app. As you'll soon see, an application is defined in picture files, sound files, xml files, java files and more; there are a lot of files that work together to make your application.

We'll talk about this all in the future. For now, take a look at the layout name. You've been working on XML layout files, so this is the name of the file we'll be editing, remember it.

Use the defaults which should be:

Activity Name: MainActivity
Layout Name: activity_main
Title: MainActivity
Menu Resource Name: menu_main
Choose options for your new file Depending on your computer speed it might take a minute to set up your project. Go ahead and get some tea or do a stretch.

Running into Errors?
Don't panic! Lots of students have had issues with downloading Android Studio so you are not alone. To help you can try:

Checking out this Troubleshooting Document.
Asking for help in the forums and on chat. We'll be checking in once in a while to see what problems students are finding and update the first document accordingly. So if you solve a problem, consider posting about your experience. When you're talking about an error, it helps to copy the text of the error. You can also take a screenshot of the error with the CTRL-CMD-Shift on a mac, or the screenshot key on a windows.
Copy your exact error and google it. 9 times out of 10, someone has run into the same problem and posted a solution about it. You can try adding "Android Studio" to the search if just searching for the error doesn't get Android Studio specific help.

تعليقات