블로그 이미지
언제나 늘 푸른 소나무처럼. 자신의 의지로 오롯이 서기
예섬수진

공지사항

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

calendar

1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Ubuntu에서 Android SDK 설치를 하였다.

Eclipse에서 Android Project 생성 시, 바로 아래와 같은 Error가 발생하였다.

조치 방법
- Project > Preference > Job Build Path에서 Android2.1을 최상위로 올려 준다.(TOP)

android]Draw shape

2010. 1. 3. 00:12 | Posted by 예섬수진

1. 출처 : http://bestsiteinthemultiverse.com/2008/11/android-graphics-example/

2. 배운 점

1. 무언가를 그리기 위해서는 View, Canvas, Paint가 필요하다.

- View : 도화지


- Canvas : 실제 그림을 그리거나 작성을 하는 손
- Paint : 펜

2. 도화지에 그림을 그리기 위해서는 View Class의 onDraw( )를 Overiding해야 한다.

Android]UI 자판 Event Handler

2010. 1. 2. 01:01 | Posted by 예섬수진
1. 소스 코드

2. 소스를 통해 배운점
1. 아래 버튼을 눌렀을 때, Keycode 값
 
2. UI 자판 Event Handler
1. Key를 눌렀을 때, onKeyDown( ) 호출
2. Key를 눌렀다가 뗄 때, onKeyUp( ) 호출
3. 같은 키를 오래 눌렀을 때, onKeyDown( )가 여러 번 호출 됨
※ onKeyUp( )는 1번만 호출됨
※ Key Event를 처리하기 위해서는 android.view.KeyEvent를 import 해야 함
 

'컴퓨터 > Android' 카테고리의 다른 글

Android-Linux]The project cannot be built until build path errors are resolved  (0) 2010.05.21
android]Draw shape  (0) 2010.01.03
Android]Button Click Event Handler  (0) 2010.01.02
Android]Hello,Android  (0) 2009.12.29
Install]Android SDK 2.0.1  (0) 2009.12.28

Android]Button Click Event Handler

2010. 1. 2. 00:28 | Posted by 예섬수진
Button Click 시, Button 하단의 TextView 내용 변경하기

1. 소스 보기
1. main.xml

2. TestActivity.java

3. 소스를 통해 배운 점
1. xml에서 작성한 UI는 ID를 통해서 Code 상에서 접근할 수 있다.
1. ID 설정 : <TextView android:id="@+id/tv_time"
2. 접근 방법 :
        setContentView(R.layout.main);
        TextView tv = (TextView)findViewById(R.id.tv_time); 
2. Button Handler
- Button Click Event를 위한 Listener 설정 :
Button btn.setOnClickListener(this);
※ 이렇게 하기 위해서, 해당 클래스는 OnClickListener를 Implements 해야 함

3. Debug 시, Log 찍기
 - Log.W(Tag, Msg) 결과 확인 :
Debug 시, LogCat에서 찍힌 Log를 확인할 수 있다.

4. 실행 결과
1. Update time Button Click  전

2. Button Click 후
- 버튼이 주황색이 되면서, 시간이 변경된
※ 시간이 우리 나라 시간이 아니므로, 변경이 필요함

 

'컴퓨터 > Android' 카테고리의 다른 글

Android-Linux]The project cannot be built until build path errors are resolved  (0) 2010.05.21
android]Draw shape  (0) 2010.01.03
Android]UI 자판 Event Handler  (0) 2010.01.02
Android]Hello,Android  (0) 2009.12.29
Install]Android SDK 2.0.1  (0) 2009.12.28

Android]Hello,Android

2009. 12. 29. 11:35 | Posted by 예섬수진
1. Eclipse에서 Android Project 생성
1. File -> New -> Project -> Android Project
2. Fill in the project details with the following values:
  • Project name: HelloAndroid
  • Application name: Hello, Android
  • Package name: com.example.helloandroid (or your own private namespace)
  • Create Activity: HelloAndroid


2. 기본으로 생성된 Eclipse Source에서 아래와 같이 Code를 수정한다.


3. Ctrl + F11을 눌러, Android Application으로 수행한다.

Install]Android SDK 2.0.1

2009. 12. 28. 23:44 | Posted by 예섬수진

1. Download SDK : http://developer.android.com/sdk/index.html

1. Unzip source
2. Add the full path to the
tools/ directory to the path on Path (under System Variables)
3. Run "SDK Setup.exe" at SDK unzip folder

 

2. Download Eclipse : http://www.eclipse.org/downloads/
  Eclipse Version : Galileo

3. Install ADT Plug-in

1.    Start Eclipse, then select Help > Install New Softare.

2.    In the Available Software dialog, click Add....

3.    In the Add Site dialog that appears, enter a name for the remote site (for example, "Android Plugin") in the "Name" field.

In the "Location" field, enter this URL:

http://dl-ssl.google.com/android/eclipse/

Click OK.

4.    Restart Eclipse

5.    Modify your Eclipse preferences to point to the Android SDK directory

1.    Select Window > Preferences... to open the Preferences panel

2.    Select Android from the left panel.

3.    For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory.

4.    Click Apply, then OK.


4. Update ADT Plug-in

1. Select Help > Check for Updates.


5. Create AVD(Android Virtual Device)
       1. Enter android.bat on command prompt
       2. Create new AVD (version : 2.0.1)

If you use AVD version 2.0.1, then you need to use same version for SDK.

012


Install Guide : http://developer.android.com/sdk/installing.html

이전 1 2 다음