Create an Android project

Source: Internet
Author: User

Create an Android Project previous page next page you should also read
    • Project Overview

This lesson shows you how to use Android Studio to create a new Android project and describe some of the files in the project.

  1. In Android Studio, create a new project:
    • If you do not have a project open, in the Welcome to Android Studio window, click Start a new Android studio project.
    • If you have already opened the project, select File > New Project.
  2. In the New Project screen, enter the following values:

    • application Name: "My first App"
    • Company Domain: "example.com"

    Android Studio populates the package name and project location for you, but you can also edit the content as needed.

  3. Click Next.
  4. On the Target Android Devices screen, leave the default values and click Next.

    The Minimum Required SDK is the lowest Android version your app can support, represented by the API level. To support as many devices as possible, you should set it up to provide your app with the lowest available version of the core feature set. If any of the features you apply can only run on newer versions of Android and are not part of the core feature set, you can enable the feature only if it is running on a version that supports that feature (see Support for different platform versions).

  5. In the Add an activity to Mobile screen, select Empty Activityand click Next.
  6. In the Customize the Activity screen, leave the default values and click Finish.

After some processing, Android Studio opens and displays the "Hello World" app that contains the default file. In the following lessons, you will add functionality to some of these files.

Let's take a moment to review the most important files: first, make sure that you have the Project window open (choose View > Tool Windows > Project) and select from the drop-down list at the top Android view. You can then see the following files:

Apps > Java > Com.example.myfirstapp > Mainactivity.java
After you complete the New Project Wizard, the file appears in Android Studio. It contains the class definition of the Activity you created earlier. When you build and run the app, Activity it starts and loads the display "Hello world!" Layout file.
Apps > Res > Layout > Activity_main.xml
This XML file defines the layout of your Activity. It contains the text "Hello world!" The TextView element.
Apps > Manifests > Androidmanifest.xml
The manifest file describes the basic characteristics of the app and defines each of its components. You will use this file over and over again as you learn more about the course and add more components to your application.
Gradle Scripts > Build.gradle
Android Studio uses Gradle to compile and build your app. Each module of your project has a corresponding build.gradle file, and the entire project also has a corresponding build.gradle file. Usually you only care about the files of the module (in this case, app or the application module) build.gradle . For more information about this file, see Building your project with Gradle.

To run the app, go on to the next lesson.

Android Studio set or modify the Android SDK path

Everything you should know when using Android studio for the first time

Create an Android project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.