More Related Content
Similar to 안드로이드 세미나 (20)
More from Chul Ju Hong (8)
안드로이드 세미나
- 11. 분석
Hello, World!
public class Hello {
public static void main(String[] args) {
System.out.println(Hello, World!);
}
}
3
- 19. 자료형
boolean b = true;
char c = 'A';
int i = 1;
float f = 1.0f;
double d = 1.0;
String s = Hello, World!;
4
- 21. 사용
if(/*condition*/) {}
else if(/*condition*/) {}
else {}
for(int i=0; i3; i++) {} enhanced for*
switch(/*condition*/){
case true:
break;
case false:
break;
default:
}
while(/*condition*/) {}
do{}while(/*condition*/);
5
- 23. 만들기
int[] a = new int[3];
new
- 39. 생성자
class Dog { Class
private String name; Member
개의
- 40. 특징
private int age;
Variable
public void bark() Member
개의
- 41. 행동
{
System.out.println(bark!); Function
}
public void attack()
{
System.out.println(attack!);
}
}
8
- 44. 키워보자
Dog d;
d.attack();
FAIL
9
- 47. 키워보자
Dog d = new Dog();
d.attack();
GOOD
10
- 49. 생성자
class Dog {
...
public Dog(){
생성자
}
...
public void attack(){
System.out.println(attack!);
}
}
11
- 52. 초기화하기
Dog[] a = new Dog[3];
new
- 56. 않는다
for(int i=0; ia.length; i++)
{
a[i] = new Dog();
}
12
- 65. 갖추기
Eclipse 다운받기
JDK 다운받기
Android SDK 다운받기
긴
- 86. 어플리케이션
소스 구조
Source Files
Don’t Touch
Android jar
binary, apk.. Assets (Big Resources)
Layout, String,...
App Info
Eclipse config
16
- 88. 시작하기
Print Hello, World!
Click! -
17
- 90. 시작하기
Print Hello, World!
그
- 96. 시작하기
Print Hello, World!
세미나 끝?
19
- 98. 시작하기
Print Hello, World!
AndroidTutorialActivity.java
R.layout.main?
20
- 100. 시작하기
Print Hello, World!
R.java
main은 어디에?
21
- 102. 시작하기
Print Hello, World!
R.java
e
s
res/drawable
res/layout
res/string
main은 어디에?
22
- 104. 시작하기
Print Hello, World!
res/drawable
res/layout
main은 여기에!
23
- 106. 시작하기
Print Hello, World!
?xml version=1.0 encoding=utf-8?
Layout LinearLayout xmlns:android=http://schemas.android.com/apk/
res/android
android:layout_width=fill_parent
android:layout_height=fill_parent
android:orientation=vertical
Text TextView
android:layout_width=fill_parent
android:layout_height=wrap_content
android:text=@string/hello /
/LinearLayout
xml 문서도 배워야 하나?
24
- 108. 시작하기
Print Hello, World!
main.xml
LinearLayout
TextView
main.xml의
- 113. 시작하기
Print Hello, World!
main.xml
layout_width, height
LinearLayout {
orientation
layout_width, height
TextView {
text
각
- 119. 시작하기
Print Hello, World!
TextView
android:layout_width=fill_parent
android:layout_height=wrap_content
android:text=@string/hello string
- 123. 참조
android:id=@+id/hello / id
- 135. 시작하기
Print Hello, World!
?xml version=1.0 encoding=utf-8?
resources
string name=helloHello World, AndroidTutorialActivity!/string
string name=app_nameAndroidTutorial/string
/resources
Resources
- 145. 설정
AndroidManifest
?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android
package=poolc.org
android:versionCode=1
android:versionName=1.0
uses-sdk android:minSdkVersion=8 /
application
android:icon=@drawable/ic_launcher
android:label=@string/app_name
activity
android:label=@string/app_name
android:name=.AndroidTutorialActivity
intent-filter
action android:name=android.intent.action.MAIN /
category android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity
/application
/manifest
29
- 148. 설정
AndroidManifest
?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android
package=poolc.org
android:versionCode=1
android:versionName=1.0
uses-sdk android:minSdkVersion=8 /
application
android:icon=@drawable/ic_launcher
android:label=@string/app_name
activity
android:label=@string/app_name
android:name=.AndroidTutorialActivity
intent-filter
action android:name=android.intent.action.MAIN /
category android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity
/application
/manifest
30
- 149. NEXT SEMINAR?
Maybe 4/6?
• Analysis ComplexLayout.xml
• Activity? Intent? Context?
• Resources - Source Code
• Simple Calculator
• Debugging, LogCat, Log, Toast
31
- 150. SIMPLE HOMEWORK
(1)
• Add 4 TextView elements.
• Each TextView has different color, size, text, style, id
(2)
올 ㅋ 올
32