본문 바로가기
앱 개발하기

안드로이드 프로젝트 만들기

by 노화방지 Anti-aging Hairstyle 2015. 12. 14.
반응형

Creating an Android Project   안드로이드 프로젝트 만들기

 

현재 버전: 안드로이드 스튜디오 1.5 빌드 141_2422023

 

Previous   Next

 

This lesson teaches you to   단원에서는 다음을 가르칩니다

²  Create a Project with Android Studio                      안드로이드 스튜디오로 프로젝트 만들기

²  Create a Project with Command Line Tools             명령줄 도구로 프로젝트 만들기

You should also read   아래 내용도 읽어야 합니다

·        Managing Projects   프로젝트 관리하기

An Android project contains all the files that comprise the source code for your Android app.
안드로이드 프로젝트에는 안드로이드 앱의 소스 코드를 구성하는 모든 파일이 포함되어 있습니다.

This lesson shows how to create a new project either using Android Studio or using the SDK tools from a command line.
단원 안드로이드 스튜디오 또는 명령줄의 SDK 도구를 사용하여, 신규 프로젝트를 만드는 방법을 가르칩니다.

Note: You should already have the Android SDK installed, and if you're using Android Studio, you should also have Android Studio installed. If you don't have these, follow the guide to Installing the Android SDK before you start this lesson.
참고: 미리 안드로이드 SDK 설치해야 하며, 안드로이드 스튜디오를 사용할 경우 안드로이드 스튜디오를 설치해야 합니다. SDK 없는 경우, 단원을 시작하기 전에 안드로이드 SDK 설치 안내를 따르십시오.

Create a Project with Android Studio   안드로이드 스튜디오로 프로젝트 만들기

1.       In Android Studio, create a new project: 안드로이드 스튜디오에서, 프로젝트를 만듭니다:

o   If you don't have a project opened, in the Welcome screen, click New Project.
열린 프로젝트가 없으면, Welcome 스크린에서 New Project ( 프로젝트) 클릭하십시오.

o   If you have a project opened, from the File menu, select New Project.
열린 프로젝트가 있으면 File 메뉴에서 New Project 선택하십시오.


2.   Under Configure your new project, fill in the fields as shown in figure 1 and click Next.
Configure your new project
밑에서, 그림1 있는 대로 필드를 채우고Next 클릭하십시오.

It will probably be easier to follow these lessons if you use the same values as shown.
보이는 것과 동일한 값을 사용하면 이들 단원을 따라 하기가 보다 쉬울 것입니다.

o   Application Name is the app name that appears to users. For this project, use "My Application."
Application Name
사용자가 보게되는 app 이름입니다. 프로젝트에서는 "My Application"입니다.
*
대문자로 시작되어야

o   Company domain provides a qualifier that will be appended to the package name; Android Studio will remember this qualifier for each new project you create.
Company domain (
회사 도메인) 패키지 이름에 추가될 한정자입니다. 각각의 프로젝트 별로 생성되는 한정자를 안드로이드 스튜디오가 기억합니다.

o   Package name is the fully qualified name for the project (following the same rules as those for naming packages in the Java programming language). Your package name must be unique across all packages installed on the Android system. You can Edit this value independently from the application name or the company domain.
Package name(
패키지 이름) (자바 프로그래밍 언어의 패키지 명명과 동일한 규칙에 따른) 프로젝트 별로 완전히 한정된 이름입니다. 패키지 이름은 안드로이드 시스템에 설치된 모든 패키지에서 유일해야 합니다. 애플리케이션 이름이나 회사 도메인과 독립적으로 패키지 이름 값을 Edit(편집) 있습니다.

o   Project location is the directory on your system that holds the project files.
Project location (
프로젝트위치) 프로젝트 파일이 보관된 시스템 상의 디렉터리입니다.

3.   Under Select the form factors your app will run on, check the box for Phone and Tablet.
Select the form factors your app will run on
아래에서, Phone and Tablet 대한 상자를 체크하십시오.

4.   For Minimum SDK, select API 15: Android 4.0.3 (IceCreamSandwich).
Minimum SDK
, API 15: Android 4.0.3 (IceCreamSandwich) 선택하십시오.

The Minimum Required SDK is the earliest version of Android that your app supports, indicated using the API level. To support as many devices as possible, you should set this to the lowest version available that allows your app to provide its core feature set. If any feature of your app is possible only on newer versions of Android and it's not critical to the app's core feature set, you can enable the feature only when running on the versions that support it (as discussed in Supporting Different Platform Versions).
최소 필수 SDK API level 표시되는 앱이 지원하는 안드로이드의 버전입니다. 가능한 많은 장치를 지원하기 위해, 앱이 핵심 기능 집합을 제공할 있도록, 사용 가능한 가장 낮은 버전으로 설정해야 합니다. 어떤 기능이 최신 버전의 안드로이드에서만 가능하고 기능이 앱의 핵심 기능 집합에 중요하지 않은 경우, (Supporting Different Platform Versions에서 논의된 대로) 그것을 지원하는 버전에서 실행될 경우에만 기능을 사용하게 있습니다.

5.       Leave all of the other options (TV, Wear, and Glass) unchecked and click Next.
다른 옵션(TV, 안경) 모두 체크하지 말고 Next 클릭하십시오.

Activities

An activity is one of the distinguishing features of the Android framework. Activities provide the user with access to your app, and there may be many activities. An application will usually have a main activity for when the user launches the application, another activity for when she selects some content to view, for example, and other activities for when she performs other tasks within the app. See Activities for more information.
액티비티는 안드로이드 프레임워크의 특징 하나입니다. 액티비티는 사용자에게 앱에 대한 접근을 제공하며, 액티비티는 많이 있습니다. 사용자가 애플리케이션을 출시할 , 애플리케이션은 일반적으로 메인 액티비티를 갖게 되며, 예를 들어, 보기 위하여 다른 콘텐츠를 선택할 때에 대한 다른 액티비티, 그리고 내에서 다른 작업을 수행할 때에 대한 다른 액티비티를 갖게 됩니다. 자세한 내용은 Activities 참조하십시오.

 

6.       Under Add an activity to Mobile, select Blank Activity and click Next.
 Add an activity to Mobile
에서Blank Activity 선택하고 Next 클릭하십시오.

7.       Under Customize the Acivity, change the Activity Name to MyActivity. The Layout Name changes to activity_my, and the Title to MyActivity. The Menu Resource Name is menu_my.
Customize the Acivity
에서, Activity Name MyActivity 바꾸십시오. Layout Name activity_my, Title  MyActivity 바뀝니다. Menu Resource Name  menu_my입니다.

8.       Click the Finish button to create the project.   프로젝트 생성을 위하여 Finish 버튼을 클릭하십시오.

Your Android project is now a basic "Hello World" app that contains some default files. Take a moment to review the most important of these:
이제 안드로이드 프로젝트는 가지 기본 파일이 포함된 기본 "Hello World" 앱이 되었습니다. 잠깐 가장 중요한 이들을 검토하십시오:

app/src/main/res/layout/content_my.xml

This is the XML layout file for the activity you added when you created the project with Android Studio. Following the New Project workflow, Android Studio presents this file with both a text view and a preview of the screen UI. The file includes some default settings and a TextView element that displays the message, "Hello world!"
파일은 안드로이드 스튜디오로 프로젝트를 만들 추가한 액티비티의 XML layout 파일입니다. 안드로이드 스튜디오는, 프로젝트 워크플로우를 따라, 텍스트 (text view) screen UI 미리보기(preview) 가진 파일 제공합니다. 파일에는 가지 기본 설정 그리고 "Hello world!" 메시지를 표시하는 TextView 엘리먼트가 포함 되어 있습니다.

* 이것은 안드로이드 스튜디오 1.4 이후에는 맞지 않아서, 빌드에 따라 Content_my.xml에 표시됩니다. 


app/src/main/java/com.example.home.dopzaapplication_01/MyActivity.java

A tab for this file appears in Android Studio when the New Project workflow finishes. When you select the file you see the class definition for the activity you created. When you build and run the app, the Activity class starts the activity and loads the layout file that says "Hello World!"
프로젝트 워크플로우가 완료되면 안드로이드 스튜디오에 파일 탭이 나타납니다. 파일을 선택하면 만들어진 activity 대한 class 정의 있습니다. app 빌드하고 실행하면, Activity 클래스 활동을 시작하여 "Hello World!"라는 레이아웃 파일을 로드합니다.

app/src/main/AndroidManifest.xml

The manifest file describes the fundamental characteristics of the app and defines each of its components. You'll revisit this file as you follow these lessons and add more components to your app.
manifest file app 기본 특성을 설명하고 구성요소 각각을 정의합니다. 단원 따라 하면서 파일을 다시 보게 되고 app 많은 구성요소를 추가하게 것입니다.

app/build.gradle

Android Studio uses Gradle to compile and build your app. There is a build.gradle file for each module of your project, as well as a build.gradle file for the entire project. Usually, you're only interested in the build.gradle file for the module, in this case the app or application module. This is where your app's build dependencies are set, including the defaultConfig settings:
안드로이드 스튜디오는 Gradle 사용하여 app 컴파일하고 빌드합니다. 프로젝트의 모듈에 대한 build.gradle 파일이 있고, 전체 프로젝트에 대한 build.gradle 파일이 있습니다. 일반적으로 또는 애플리케이션 모듈에 대한 build.gradle  파일에만 관심이 있습니다. defaultConfig 설정을 포함한, 앱의 빌드 종속성이 여기서 설정됩니다.

compiledSdkVersion is the platform version against which you will compile your app. By default, this is set to the latest version of Android available in your SDK. (It should be Android 4.1 or greater; if you don't have such a version available, you must install one using the SDK Manager.) You can still build your app to support older versions, but setting this to the latest version allows you to enable new features and optimize your app for a great user experience on the latest devices.
compiledSdkVersion
app 컴파일할 플랫폼 버전입니다. 기본적으로 이것은 SDK에서 사용가능한 안드로이드의 최신 버전으로 설정됩니다(안드로이드 4.1 이상이어야 ; SDK 관리자를 사용하여 이러한 버전을 사용할 없는 경우 설치해야 ). 여전히 이전 버전을 지원하도록 앱을 구축할 있지만 최신 버전으로 설정하면 새로운 기능을 사용하고 최신 장치에는 좋은 사용자 경험에 대한 응용 프로그램을 최적화.

applicationId is the fully qualified package name for your application that you specified during the New Project workflow.
applicationId
일부는 새로운 프로젝트 워크플로우 동안 지정한 응용 프로그램에 대한 한정된 패키지 이름 입니다.

minSdkVersion is the Minimum SDK version you specified during the New Project workflow. This is the earliest version of the Android SDK that your app supports.
minSdkVersion
새로운 프로젝트 워크플로우 동안 지정한 최소 SDK 버전입니다. 지원하는 안드로이드 SDK 초기 버전입니다.

targetSdkVersion indicates the highest version of Android with which you have tested your application. As new versions of Android become available, you should test your app on the new version and update this value to match the latest API level and thereby take advantage of new platform features. For more information, read Supporting Different Platform Versions.
targetSdkVersion
테스트한 애플리케이션으로 안드로이드의 최고 버전을 나타냅니다. 안드로이드의 새로운 버전을 사용할 있게 되면, 버전에서 테스트 하고 최신 API 레벨 일치 그로 인하여 새로운 플랫폼 기능을 활용 하려면 값을 업데이트 해야 합니다. 자세한 내용은, 다른 플랫폼 버전 지원.

See Building Your Project with Gradle for more information about Gradle.

Note also the /res subdirectories that contain the resources for your application:

drawable<density>/

Directories for drawable objects (such as bitmaps) that are designed for various densities, such as medium-density (mdpi) and high-density (hdpi) screens. Other drawable directories contain assets designed for other screen densities. Here you'll find the ic_launcher.png that appears when you run the default app.
중간 해상도(mdpi) 해상도(hdpi) 화면과 같은 다양한 해상도 용으로 설계된, drawable (bitmaps 같은) 대한 디렉터리. 다른 drawable 디렉토리에는 다른 화면 해상 용으로 설계된 자산이 포함되어 있습니다. 기본 앱을 실행할 표시되는 ic_launcher.png 있습니다.

layout/

Directory for files that define your app's user interface like activity_my.xml, discussed above, which describes a basic layout for the MyActivity class.
위에서 논의된 activity_my.xml 같은 앱의 사용자 인터페이스를 정의하는 파일에 대한 디렉터리로, MyActivity클래스 대한 기본 레이아웃을 설명합니다.

menu/

Directory for files that define your app's menu items.
app 메뉴 아이템을 정의하는 파일들에 대한 디렉토리

values/

Directory for other XML files that contain a collection of resources, such as string and color definitions. The strings.xml file defines the "Hello world!" string that displays when you run the default app.
스트링 정의와 같은 리소스의 모음이 포함된 다른 XML 파일에 대한 디렉토리. Strings.xml 파일은 기본 앱을 가동할 나타나는 “Hello world!” 정의합니다.

To run the app, continue to the next lesson.

Create a Project with Command Line Tools


If you're not using the Android Studio IDE, you can instead create your project using the SDK tools from a command line:

1.       Change directories into the Android SDK’s sdk/ path.

2.       Execute:

tools/android list targets

This prints a list of the available Android platforms that you’ve downloaded for your SDK. Find the platform against which you want to compile your app. Make a note of the target ID. We recommend that you select the highest version possible. You can still build your app to support older versions, but setting the build target to the latest version allows you to optimize your app for the latest devices.
이것은 당신이 당신의 SDK 위해 다운로드 가능한 안드로이드 플랫폼의 목록을 인쇄합니다. 당신이 당신의 응용 프로그램을 컴파일 할에 대한 플랫폼을 찾을 있습니다.대상 ID 기록해 둡니다. 우리는 당신이 가능한 가장 높은 버전을 선택하는 것이 좋습니다. 당신은 여전히 이전 버전을 지원하도록 응용 프로그램을 구축하지만, 최신 버전으로 빌드 타겟을 설정하면 최신 장치 앱을 최적화 있습니다.

If you don't see any targets listed, you need to install some using the Android SDK Manager tool. See Adding SDK Packages.

3.       Execute:

4.       android create project --target <target-id> --name MyFirstApp \

5.       --path <path-to-workspace>/MyFirstApp --activity MyActivity \

6.       --package com.example.myfirstapp

Replace <target-id> with an ID from the list of targets (from the previous step) and replace <path-to-workspace> with the location in which you want to save your Android projects.

Tip: Add the platform-tools/ as well as the tools/ directory to your PATH environment variable.

Your Android project is now a basic "Hello World" app that contains some default files. To run the app, continue to the next lesson.

Next: Running Your Application 

 

반응형

댓글