1 Hello World 1 Hello World 1 File

  • Slides: 33
Download presentation

1. Hello World 앱 작성하기

1. Hello World 앱 작성하기

1. Hello World 앱 작성하기 (1) File > New > Android Project (2) 프로젝트

1. Hello World 앱 작성하기 (1) File > New > Android Project (2) 프로젝트 생성 #1

1. Hello World 앱 작성하기 (5) Create Activity (6) New Blank Activity

1. Hello World 앱 작성하기 (5) Create Activity (6) New Blank Activity

1. Hello World 앱 작성하기

1. Hello World 앱 작성하기

2. 안드로이드 프로젝트 구성 안드로이드의 빌드 프로세스 javac Class appt Class dx Class. dex

2. 안드로이드 프로젝트 구성 안드로이드의 빌드 프로세스 javac Class appt Class dx Class. dex apkbu ilder APK

3. 애뮬레이터 사용법 1) Window - Android Virtual Device Manager를 클릭

3. 애뮬레이터 사용법 1) Window - Android Virtual Device Manager를 클릭

4. 버전과 screen size

4. 버전과 screen size

4. Screen Size http: //developer. android. com/about/dashboards/index. html Total ldpi Small 9. 2% Normal

4. Screen Size http: //developer. android. com/about/dashboards/index. html Total ldpi Small 9. 2% Normal 0. 1% 15. 1% Large 0. 6% 3. 6% Xlarge Total mdpi tvdpi xhdpi xxhdpi Total 9. 2% 1. 2% 4. 4% 9. 9% hdpi 23. 1% 1. 2% 33. 4% 22. 2% 8. 8% 0. 5% 6. 4% 0. 3% 0. 1% 4. 8% 34. 2% 22. 8% 8. 8% 79. 6%

4. Screen Size http: //developer. android. com/guide/practices/screens_support. html Low density (120), ldpi Medium density

4. Screen Size http: //developer. android. com/guide/practices/screens_support. html Low density (120), ldpi Medium density (160), mdpi Smallscreen QVGA (240 x 320) Normalscreen WQVGA 400 (240 x 400) WQVGA 432 (240 x 432) HVGA (320 x 480) Largescreen WVGA 800** (480 x 800) WVGA 854** (480 x 854) WVGA 800* (480 x 800) WVGA 854* (480 x 854) 600 x 1024 Extra Largescreen 1024 x 600 WXGA (1280 x 800)† 1024 x 768 1280 x 768 High density (240), hdpi Extra high density (320), xhdpi 480 x 640 WVGA 800 (480 x 800) WVGA 854 (480 x 854) 600 x 1024 640 x 960 1536 x 1152 1920 x 1200 2048 x 1536 2560 x 1600

5. View와 View. Group

5. View와 View. Group

5. View와 View. Group

5. View와 View. Group

5. View와 View. Group

5. View와 View. Group

5. View와 View. Group – View의 속성 1) 아이디 - 뷰 객체는 한 개의

5. View와 View. Group – View의 속성 1) 아이디 - 뷰 객체는 한 개의 정수형의 아이디(android: id)만 가짐 - 이 아이디는 xml레이아웃파일에 정의 <Button android: id="@+id/button 1" android: layout_width= "wrap_content" android: layout_height= "wrap_content" android: layout_align. Parent. Left= "true" android: layout_align. Parent. Top= "true" android: layout_margin. Left= "31 dp" android: layout_margin. Top= "48 dp" android: text="Button" /> - @기호의 의미는 ID를 리소스에 정의하거나 참조한다는 뜻 - @ 기회를 빠뜨리지 않도록 주의하자! - +기호는 신규로 ID를 정의한다는 의미 Button mb 1 = (Button) find. View. By. Id(R. id. button 1); 2) Position ① 크기(size) : 뷰의 폭(width) 과 높이(Height) ② padding : 뷰와 뷰안의 콘텐트 사이 간격을 지정하는 값 ③ margin : 뷰그룹의 속성, 부모뷰와 자식뷰간의 거리 android: padding. Bottom="2 dp" android: padding. Left= "2 dp" android: padding. Right= "2 dp" android: padding. Top="2 dp“ 소스코드 : set. Padding(int, , int);

5. View와 View. Group – 기본위젯 <Relative. Layout xmlns: android="http: //schemas. android. com/apk/res/android" xmlns:

5. View와 View. Group – 기본위젯 <Relative. Layout xmlns: android="http: //schemas. android. com/apk/res/android" xmlns: tools="http: //schemas. android. com/tools" android: layout_width="match_parent" android: layout_height="match_parent" android: padding. Bottom="@dimen/activity_vertical_margin" android: padding. Left="@dimen/activity_horizontal_margin" android: padding. Right="@dimen/activity_horizontal_margin" android: padding. Top="@dimen/activity_vertical_margin" tools: context=". Test. Activity" > <Button android: id="@+id/button 1" android: layout_width="wrap_content" android: layout_height="wrap_content" android: layout_align. Parent. Left="true" android: layout_align. Parent. Top="true" android: layout_margin. Left="31 dp" android: layout_margin. Top="48 dp" android: padding. Bottom="2 dp" android: padding. Left="2 dp" android: padding. Right="2 dp" android: padding. Top="2 dp" android: text="확인" /> <Check. Box android: id="@+id/check. Box 1" android: layout_width="wrap_content" android: layout_height="wrap_content" android: layout_align. Left="@+id/button 1" android: layout_below="@+id/button 1" android: layout_margin. Top="24 dp" android: text="아이폰" /> <Check. Box android: id="@+id/check. Box 2" android: layout_width="wrap_content" android: layout_height="wrap_content" android: layout_align. Left="@+id/check. Box 1" android: layout_below="@+id/check. Box 1" android: text="안드로이드" /> <Check. Box android: id="@+id/check. Box 3" android: layout_width="wrap_content" android: layout_height="wrap_content" android: layout_align. Left="@+id/check. Box 2" android: layout_below="@+id/check. Box 2" android: text="베가" /> <Radio. Group android: id="@+id/radio. Group 1" android: layout_width="wrap_content" android: layout_height="wrap_content" android: layout_align. Left="@+id/check. Box 3" android: layout_below="@+id/check. Box 3" android: layout_margin. Top="1 dp" > <Radio. Button android: id="@+id/radio. Button 1" android: layout_width="wrap_content" android: layout_height="wrap_content" android: layout_margin. Top="1 dp" android: text="직원" /> <Radio. Button android: id="@+id/radio. Button 2" android: layout_width="wrap_content" android: layout_height="wrap_content" android: layout_align. Left="@+id/radio. Button 1" android: layout_below="@+id/radio. Button 1" android: text="협력직원" /> </Radio. Group> <Toggle. Button android: id="@+id/toggle. Button 1" android: layout_width="wrap_content" android: layout_height="wrap_content" android: layout_align. Right="@+id/check. Box 1" android: layout_below="@+id/radio. Group 1" android: layout_margin. Top="17 dp" android: text="Toggle. Button" android: text. Off="커짐" android: text. On="켜짐" /> </Relative. Layout>