본문 바로가기
User Guide

프로젝트 또는 App모듈 만들기 Create a Project or App Module (7)

by 각종 잡상식 지식 모음 2016. 6. 1.
반응형

 

프로젝트 또는 App모듈 만들기 Create a Project or App Module

안드로이드 스튜디오의 프로젝트는 분리된 기능 단위로 구성된 코드를 유지하는 1개 이상의 모듈을 포함합니다.
이 페이지는 새로운 프로젝트 시작 방법과 추가 모듈을 추가하는 방법을 보여줍니다.

A project in Android Studio contains one or more modules that keep your code organized into discrete units of functionality. This page shows how to start a new project and add additional modules.

안드로이드 프로젝트 구조 및 모듈 유형에 대한 자세한 내용은 Projects Overview를 읽으십시오.
For more information about the Android project structure and module types, read Projects Overview.

새 프로젝트 시작하기     Start a New Project

안드로이드 스튜디오는 phone, tablet, TV, Wear, Google Glass와 같은 다양한 형태의 팩터들을 위한 안드로이드 app을 쉽게 만들 수 있게 해줍니다.
New Project wizard에서 app을 위한 폼 팩터를 선택하고 시작하는데 필요한 모든 것을 가진 프로젝트 구조를 populates 합니다.

Android Studio makes it easy to create Android apps for various form factors, such as phone, tablet, TV, Wear, and Google Glass. The New Project wizard lets you choose the form factors for your app and populates the project structure with everything you need to get started.

Step 1: Create a New Project

열린 프로젝트가 없으면, Android Studio는 Welcome screen을 보여줍니다.
새로운 프로젝트를 만들려면 Start a New Android Studio project를 클릭하세요.
열린 프로젝트가 있으면, Android Studio는 개발 환경을 보여줍니다.
new project를 열려면, File > New Project.를 클릭하세요.
다음 window에서 app 이름, 패키지 이름, 프로젝트의 위치를 컨피규어할 수 있습니다.
If you didn't have a project opened, Android Studio shows the Welcome screen. To create a new project, click Start a New Android Studio project.
If you had a project opened, Android Studio shows the development environment. To create a new project, click File > New Project.
The next window lets you configure the name of your app, the package name, and the location of your project.

Figure 1. Choose a name for your project.

Enter the values for your project then click Next.

Step 2: Select Form Factors and API Level

The next window lets you select the form factors supported by your app, such as phone, tablet, TV, Wear, and Google Glass. The selected form factors become the app modules within the project. For each form factor, you can also select the API Level for that app. To get more information, click Help me choose.

Figure 2. Select the API Level.

The API Level window shows the distribution of mobile devices running each version of Android, as shown in figure 3. Click on an API level to see a list of features introduced in the corresponding version of Android. This helps you choose the minimum API Level that has all the features that your apps needs, so you can reach as many devices as possible. Then click OK.

Figure 3. Choose form factors for your app.

Then, on the Form Factors Window, click Next.

Step 3: Add an Activity

The next screen lets you select an activity type to add to your app, as shown in figure 4. This screen displays a different set of activities for each of the form factors you selected earlier.

Figure 4. Add an activity to your app.

Choose an activity type then click Next.

Note: If you choose "Add No Activity", click Finish to create the project.

Step 4: Configure Your Activity

The next screen lets you configure the activity to add to your app, as shown in figure 5.

Figure 5. Choose a name for your activity.

Enter the activity name, the layout name, and the activity title. Then click Finish.

Step 5: Develop Your App

안드로이드 스튜디오는 프로젝트의 기본 구조를 생성하고 개발 환경을 엽니다.
app이 2개 이상의 form factor를 지원하는 경우, 안드로이드 스튜디오는 
그림 6과 같이, 그들 각각에 대하여 완전한 소스 파일을 가진 모듈 폴더를 만듭니다.
Android Studio creates the default structure for your project and opens the development environment. If your app supports more than one form factor, Android Studio creates a module folder with complete source files for each of them as shown in figure 6.

Figure 6. The default project structure for a mobile app.

Now you are ready to develop your app. For more information, see the following links:

Add an App Module


Android app modules provide a container for your app's source code, resource files, and app level settings such as the module-level build file and Android manifest file.

To add a new app module to your project, proceed as follows:

  1. Click File > New > New Module.
  2. In the Create New Module window that appears, Android Studio offers the following app modules:
    • Phone & Table Module
    • Android Wear Module
    • Android TV Module
    • Glass Module
    Click the type of app module you want, then click Next.
  3. Enter the following details:
    • Application Name: This name is used as the title of your app launcher icon for the new module.
    • Module Name: This text is used as the name of the folder where your source code and resources files are visible.
    • Package Name: This is the Java namespace for the code in your module and is added as the package attribute in module's Android manifest file.
    • Minimum required SDK: This setting indicates the lowest version of the Android platform that the app module supports. This value sets theminSdkVersion attribute in the build.gradle file, which you can edit later.
    Then click Next.
  4. Depending on which app module you selected, the following page displays a selection of appropriate code templates you can select to use as your main activity. Click an activity template you want to start with then click Next. Or if you don't need an activity, click Add No Activity then click Finishand you're done.
  5. If you chose an activity template, the next page contains several input fields related to the activity template you chose, such as the class name and layout name. Complete the form then click Finish.

Once the Gradle project sync completes, the new module appears in the Project panel on the left. If you don't see the new module folder, make sure it's displaying the Android view.

반응형

댓글