"Android Studio Discovery Road Series": Android Studio project creation

Source: Internet
Author: User

Guo Xiaoxing
Weibo: Guo Xiaoxing's Sina Weibo
Email:[email protected]
Blog: http://blog.csdn.net/allenwells
Github:https://github.com/allenwell

Let's start by explaining the two concepts involved in creating an Android studio project.

    • Project: Working space
    • Module: Specific projects

Correspondence relationship

In Eclipse, we can simultaneously edit multiple project at the same time, these project in the same workspace. In Android Studio, we can simultaneously edit several module of Android studio, which are in the same project.

    • Project Eclipse is the same as the module for Android studio
    • Eclipse's Workspace is equivalent to the Android studio project

The project referred to in this article refers to the creation of a project in Module,android studio of Android Studio, first of all to create projects. But when you create the project, Project automatically creates it,

An Android studio project creation process

Let's take a step-by-step to create a new project.

(1) Configure Your new project

As shown in the following:

    • Application name: The names of the applications. It is the app name that the app displays on the device, and also the name of the Android Studio project.
    • Company domain: Corporate domain name. Affects the following package name. The default is the computer host name, and of course you can set the package name separately.
    • Package Name: the application bundle name. Each app has a separate package name, and if two apps have the same package name, Android will think they're the same app. As a result, it is necessary to ensure that different apps have different package names.
    • The local directory where Project Localtion:project resides.
(2) Select the form factors your app would run on

As shown in the following:

Here you can type the Module in your Project and the minimum supported version.

    • Phone and tablet: Indicates that the Module is a phone and tablet project.
    • TV: Indicates that the Module is an Android TV project.
    • Wear: Indicates that the Module is a wearable device (such as a watch) project.
    • Glass: Indicates that Module is a Google Glass project (do not know what Google Glass is, please search by yourself).

You can select multiple types at the same time, and the difference is that the project creates one or more Module based on the type you choose.

The Minimum SDK represents the minimum Android version supported by the Module. Different versions can be selected depending on the user. You can click on the Help me choose to see the current version of Android distribution. Now in this era, if your project supports the 2.2 version almost all Android devices are supported.

(3) Add an activity to Mobile

As shown in the following:

This page is the type that lets us choose whether to create activity and create activity. You can choose not to create activity (Add no activity).

If you choose to automatically create Activity,android studio, it will automatically generate some code for you. The generated code is different depending on the activity type. Sometimes you can learn a lot from these automatically generated code, such as Fullscreen Activity.

(4) Customize the Activity

As shown in the following:

    • Activity Name: The class name of the activity that was created automatically.
    • Layout Name: The configuration file name of the activity that was created automatically.
    • Title: The name of the activity that was created automatically.
    • Menu Resource Name: The menu file name of the activity that was created automatically.

After 4 steps, our project is created, it contains a default module, and we can create a new module with the File->new module.

When you create a module, there are 4 options, each of which has the following meanings:

    • Android Library: Create a module for Android library
    • Import Existing Project: Importing another project as a module, the imported project can be an Eclipse ADT project, or it can be a Gradle project (Gradle is just a project builder, which is also available in eclipse).
    • Import jar or AAR package: Imports a jar or AAR file as a module.
    • Java Library: Create a Java module that is used primarily to write Java toolkits.
Two Android Studio project structure

Android Studio supports displaying project hierarchies in three different ways.

    • Project: Hierarchy is responsible, but shows the actual file directory structure
    • Package: Shows all packages structure, including code and related resources.
    • Android: The official recommended way to display only files related to the project.

These three modes are as shown in each of the following:

Project

Package

Android

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

"Android Studio Discovery Road Series": Android Studio project creation

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.