1 / 35

LifecareScienceLAB Android Seminar 2 nd class

아주대학교. LifecareScienceLAB Android Seminar 2 nd class. Android Software Development 2011/04/13 – p.m. 06:00 – 팔달관 409 호. Review. My First Android Application Hello World 프로젝트 생성 방법 학습 Simulator 실행. My First Android Application. My First Android Application.

jalila
Download Presentation

LifecareScienceLAB Android Seminar 2 nd class

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 아주대학교 LifecareScienceLABAndroid Seminar 2nd class Android Software Development 2011/04/13 – p.m. 06:00 – 팔달관 409호

  2. Review • My First Android Application • Hello World • 프로젝트 생성 방법 학습 • Simulator 실행

  3. My First Android Application

  4. My First Android Application

  5. My First Android Application

  6. Contents List

  7. User Interface • Widget TextView, Button, EditText • Layout ANdroid

  8. User Interface • User Interface of Android Java • View & ViewGroup • View Hierarchy • ViewGroup • ViewGroup • View • View • View • View • View

  9. User Interface View ViewGroup

  10. User Interface • View & ViewGroup Btn Btn • LinearLayout • LinearLayout • LinearLayout Btn Btn • Button • Button • Button • Button

  11. User Interface • Activity • 안드로이드에서의 과제/작업의 단위 • Widget과 Layout을 제어한다. • android.app.Activity Class • 응용프로그램의 각 화면마다 Activity를 정의하고 구현하는 데 많은 시간을 들이게 된다. • Example • 시동/스플래시 화면 • 주 메뉴 화면 • 게임 플레이 화면 • 고득점 화면 • 도음말/프로그램 정보 화면 시동/스플래시Activity 주 메뉴 Activity 고득점 Activity 게임플레이 Activity 도움말/프로그램 정보 Activity

  12. User Interface • VG Splash Activity • VG • VG • VG Main Menu Activity • VG • V • V • V • V • VG • V Function 2. Activity Function 1. Activity • V • V • V • V Layout Hierarchy Activity Hierarchy Control

  13. Widget View • android.widget패키지 • TextView • 화면에 문자를 출력 • Button • 사용자의 선택 입력 • EditText • 문자 입력

  14. Widget • Widget 사용하기 1 • xml 파일에서 정의 후 Activity에서 ID를 찾는다. • [project]->[res]->[layout]->[main.xml]에 TextView추가 • Activity에서 TextView선언 • Activity에서 findViewById메서드로 할당 • 레이아웃(xml)과 소스코드(activity)를 연결

  15. Widget • Widget 사용하기 2 • Activity에서 생성 후 Layout에 표시한다. • Activity에서 TextView생성 • new 메서드 사용 • TextView객체를 ContentView로 생성 • setContentView메서드 사용

  16. Widget • Listener (implementation in Activity) • 객체에서 Event가 발생하였을 때 이를 감지하고 수용하여 실행되는 함수 • Ex.) Touch, KeyPress, SensorDataReceive, … • Properties (setup in xml file) • Widget의 속성 • Ex.) Size, Padding, ImageResource, …

  17. Widget • TextView, Button, EditText를 이용하여 버튼을 누르면 편집한 문자열이 출력되는 예제 main.xml→

  18. Widget ↓ Activity Class

  19. Widget • Properties

  20. Widget • Properties <TextView android:id="@+id/textView1" android:textSize="40dp" android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="center" android:layout_weight="1" android:text="Massage" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:orientation="horizontal" android:layout_weight="0" > <Button android:layout_width="wrap_content" android:layout_gravity="center" android:textSize="20dp" android:id="@+id/button1" android:layout_height="wrap_content" android:layout_weight="0" android:text="Refresh" > <EditText android:id="@+id/editText1" android:textSize="20dp" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Enter Text" android:layout_weight="1" >

  21. Layout 웹 디자이너들이 HTML을 사용하는 것과 비슷하게, 안드로이드 응용프로그램의 사용자 인터페이스 디자이너는 XML을 이용한다. • 종류 • Linear Layout • View들을 차곡차곡 쌓는 배치(가장 많이 사용) • Relative Layout • 부모와 자식, 자식과 자식간의 상대적인 배치 • Frame Layout • 좌상단에 겹쳐서 쌓는 배치 • Table Layout • 표형태로 배치

  22. Software Design Software Development

  23. Design Tool • State Diagram • 프로그램의 상태를 정의한 상태간의 흐름도 • Structure Chart • 기능 중심의 함수 구조도 • Flow Chart • 데이터 흐름 중심의 함수 흐름도 • UML :: Class Diagram • 객체 중심의 클래스 구조도 • UML :: Sequence Diagram • 순차 중심의 객체와 함수의 흐름도

  24. State Diagram Play Pause Playing Stop Play Not Playing, At the beginning Stop Play Pause Pause Stop Paused

  25. Structure Chart sub process 1 process sub process 2 main Input sub process 3 ouput print

  26. Flow Chart New Stage START Button Input Add Random Value to Array LED Output Array Size + 1 i < Array Size? i < Array Size? i <= 0 i <= 0 False False Turn on All LED i++ i++ Array[i] == Input? True True Input Data from Button Output Data in Array[i] to LED Turn on All LED False Clear Array Array Size <= 0 i <= 0 True

  27. Class Diagram Uses▶ Director Builder Main builder makeTitle makeString makeItems close construct HTMLBuilder TextBuilder filename writer buffer makeTitle makeString makeItems close getResult makeTitle makeString makeItems close getResult Uses▲ Uses▲

  28. Sequence Diagram :Client :Server :Device work open print write close

More Related