Eclipse ADT Plugin Eclipse HelpInstall New Software Eclipse

  • Slides: 32
Download presentation

Eclipse용 ADT Plug-in 설치 • Eclipse 실행 후 Help/Install New Software 실 행

Eclipse용 ADT Plug-in 설치 • Eclipse 실행 후 Help/Install New Software 실 행

Eclipse용 ADT Plug-in 설치 • http: //dl-ssl. google. com/android/eclipse/

Eclipse용 ADT Plug-in 설치 • http: //dl-ssl. google. com/android/eclipse/

Eclipse용 ADT Plug-in 설치

Eclipse용 ADT Plug-in 설치

AVD 생성 • Eclipse 실행 후 – Windows -> AVD Manager 실행

AVD 생성 • Eclipse 실행 후 – Windows -> AVD Manager 실행

프로젝트 실행 • Android Application 선택

프로젝트 실행 • Android Application 선택

Layout 변경

Layout 변경

Activity 추가

Activity 추가

Import 추가 • • import android. app. Activity; android. os. Bundle; android. view. *;

Import 추가 • • import android. app. Activity; android. os. Bundle; android. view. *; android. widget. *;

기본 프로그램 틀 package myapp. test; import android. app. Activity; android. os. Bundle; android.

기본 프로그램 틀 package myapp. test; import android. app. Activity; android. os. Bundle; android. view. *; android. widget. *; public class my. Activity 1 extends Activity { @Override protected void on. Create(Bundle saved. Instance. State) { // TODO Auto-generated method stub super. on. Create(saved. Instance. State); set. Content. View(R. layout. main); } }

버튼 이벤트 처리 코드 Button btn 1 = (Button)find. View. By. Id(R. id. button);

버튼 이벤트 처리 코드 Button btn 1 = (Button)find. View. By. Id(R. id. button); final Edit. Text edit 1 = (Edit. Text)find. View. By. Id(R. id. edit. Text); final Edit. Text edit 2 = (Edit. Text)find. View. By. Id(R. id. edit. Text 2);

버튼 이벤트 처리 코드 Button btn 1 = (Button)find. View. By. Id(R. id. button);

버튼 이벤트 처리 코드 Button btn 1 = (Button)find. View. By. Id(R. id. button); final Edit. Text edit 1 = (Edit. Text)find. View. By. Id(R. id. edit. Text); final Edit. Text edit 2 = (Edit. Text)find. View. By. Id(R. id. edit. Text 2); btn 1. set. On. Click. Listener(new View. On. Click. Listener() { public void on. Click(View v) { try { String txt 1 = edit 1. get. Text(). to. String(); edit 2. set. Text(txt 1); } catch (Exception e) { } } }); // TODO Auto-generated catch block System. out. println(e. to. String());

Key_Down 이벤트 Edit. Text edit 1 = (Edit. Text)find. By. Id(R. id. Edit. Text

Key_Down 이벤트 Edit. Text edit 1 = (Edit. Text)find. By. Id(R. id. Edit. Text 1); edit 1. set. On. Key. Listener(new View. On. Key. Listener(){ public boolean on. Key(View v, int Key. Code, Key. Event event){ if ( (key. Code == Key. Event. KEYCODE_SPACE) && (event. get. Action() == Key. Event. ACTION_DOWN)) { } } }