1 / 12

To be an Android Expert

앱창작터. To be an Android Expert. 안드로이드 여대생 기초 과정. Application Fundamentals. 문양세 , 최미정 강원대학교 IT 대학 컴퓨터학부. 안드로이드 애플리케이션 빌드. Library. Java (classes). . apk (android package). aapk. identifiers. Resource & Configuration. aapk : android application package tool.

nona
Télécharger la présentation

To be an Android Expert

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. 앱창작터 To be an Android Expert • 안드로이드여대생 기초 과정 Application Fundamentals 문양세, 최미정 강원대학교 IT대학 컴퓨터학부

  2. 안드로이드 애플리케이션 빌드 Library Java (classes) .apk (android package) aapk identifiers Resource & Configuration aapk: android application package tool

  3. 애플리케이션 vs. 컴포넌트 (1/2) 컴포넌트? • 중요 특징: 한애플리케이션이 다른 애플리케이션의 컴포넌트를 사용할 수 있다. • 내 app에서 다른 app에서 만든 scroller를 사용할 수 있다. • 다른 app의 코드를 통합/링크하지 않고, 필요할 때 해당 영역(piece)을 간단히 구동시킨다. • 다른 애플리케이션의 컴포넌트를 인스턴스화 한다. • 일반적인 시스템과 달리, 안드로이드에서는 애플리케이션이 하나의 시작점(entry point)을 가지지 않는다. • 대신 시스템이 필요로 할 때마다, 컴포넌트들이 인스턴스화 되어실행된다.

  4. 애플리케이션 vs. 컴포넌트 (2/2) Component에 대한 정보, configuration 등을 담고 있음 Android application components 그림: from kandroid.org

  5. Activity • 우리가 볼 수 있는 visual interface를가진다. 예를 들어, • 사용자에게 선택 기능을 제공하는 메뉴 아이템 리스트 • 사진과 함께 캡션을 보여주는 기능 • 텍스트 메시징 애플리케이션의 경우 • 첫 번째, 컨택(전화번호부) 리스트를 보여주는 액티비티 • 두 번째, 메시지를 작성하는 액티비티 • 세 번째, 받은 편지함의 메시지를 보여주는 액티비티 • 사용자 액티비티는Activity의 sub-class로 만들어진다.

  6. Activity Lifecycle (1/2) • 액티비티의 세 가지 상태 • 활성화(active) or 실행 중(running) 상태 • 해당 액티비티가 사용자 액션에 대한 포커스를 가지고 있을 때이다. • 좀 더 쉽게 말해서,foreground 화면에 나타나 있을 때이다. • 멈춤(paused) 상태 • 포커스는 보유하지 않았으나, 여전히 사용자에게 보이는 상태이다. • 다른 액티비티에 의해 가려져 부분적으로만 보이는 상태로서, 해당 액티비티는 살아있는 상태이다. • 정지(stop) 상태 • 다른 액티비티에 의해 완전히 가려진 상태이다. • 여전히 액티비티의 정보는 유지되나, 메모리 부족 시 종료될 가능성이 높은 상태이다.

  7. Activity Lifecycle (2/2) entirelifetime foregroundlifetime visiblelifetime

  8. Service • Visual interface를가지지 않는다. • (눈에 보이지 않은 채) 백그라운드에서 수행된다. • 예: music player, network download • 실행 중인 서비스에 접속(connect)이 가능하다. • 음악 재생 과정에서, 되감기, 정지 등이 수행됨 • Service는 main thread에서 수행될수 있으나, 다른 컴포넌트의 user interface에 영향을 주지 않도록별도의 thread로 작동시킨다.

  9. Broadcast Receiver • (아무것도 하지 않으나) broadcast announcement를 수신하고 응답한다. • 배터리 부족, 언어 설정 바뀜 등의 시스템 공지를 수신/처리함 • 대표적인 예가 SMS 수신임 • Visual interface를 가지지 않으나, 정보 수신 시, • 이를 처리하는 activity를 시작하거나, • NotificationManager를 사용하여사용자에게 이를 알릴 수 있다.

  10. Content Provider ContactsProvider • 애플리케이션 간에 공유 가능한 데이터 집합을 만든다. • 예: 전화번호부, photo gallery • SQLite 혹은 file을 사용할 수 있으며, 자신이 관리하는 데이터의 공유를 위해 표준 method 집합을 구현한다.

  11. AndroidManifest.xml • 안드로이드는 애플리케이션 컴포넌트를 시작하기 전에, 컴포넌트 존재를 인식해야 한다. • 컴포넌트들이 Manifest.xml 파일에 선언된다. • AndroidManifest.xml은 XML 파일로서, 컴포넌트 선언, 퍼미션 등의 configuration 정보를 가진다.

More Related