Top Banner
Sample Soft Keyboard source analysis
28

Sample Soft Keyboard source analysis

Feb 08, 2016

Download

Documents

Gibson Gibson

Sample Soft Keyboard source analysis. 안드로이드 서비스 분류. 프레임워크의 시스템 서비스. Core flatform service & hardware service. 부팅시 안드로이드 시스템 서비스 생성 과정. Linux kernel. Java layer. 애플리케이션 서비스 객체에 구현된 onCreate () 를 호출. 스레드간에 메시지를 전달. 액티비티 및 서비스의 생성 및 스케줄링을 담당. DVM 을 초기화하고 구동. 언어 및 입력. Manifest. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sample Soft Keyboard  source  analysis

Sample Soft Keyboard source analysis

Page 2: Sample Soft Keyboard  source  analysis

안드로이드 서비스 분류

Android service

System service

Java system service

Core platform service

Hardware ser-vice

Native system service

Application ser-vice

Local service

Remote service

Page 3: Sample Soft Keyboard  source  analysis

프레임워크의 시스템 서비스

Core flatform service & hard-

ware service

Page 4: Sample Soft Keyboard  source  analysis

부팅시 안드로이드 시스템 서비스 생성 과정

init zygote System server

Java sys-tem ser-

vice

Linux ker-nel Java layer

Page 5: Sample Soft Keyboard  source  analysis

액티비티 및 서비스의 생성 및 스케줄링을

담당

스레드간에 메시지를 전달

DVM 을 초기화하고 구동

애플리케이션 서비스 객체에 구현된 on-Create() 를 호출

Page 6: Sample Soft Keyboard  source  analysis

언어 및 입력

Page 7: Sample Soft Keyboard  source  analysis

Manifest

안드로이드 홈페이지에 나온 내용 .퍼미션을 주어서 시스템에 키보드 등록 .

Page 8: Sample Soft Keyboard  source  analysis

1. 첫 번째 세팅 화면ImePreferences 객체에서 이 화면을 구성 .

Page 9: Sample Soft Keyboard  source  analysis

1. 첫 번째 세팅 화면12 3

4 5

1 또는 메니페스트의 lable 에서 변경

5String.xml 의 내용 .locale label 받아옴

3

2 PreferenceActivity 의 onCraete 에서 리스트뷰 생성

Value = Select input languages

Page 10: Sample Soft Keyboard  source  analysis

2. 두 번째 세팅 화면InputMethodSettingsImpl 의 init() 함수의 setOnPreferenceClickListener() 에서화면을 구성 .

Page 11: Sample Soft Keyboard  source  analysis

2. 두 번째 세팅 화면

Page 12: Sample Soft Keyboard  source  analysis

2. 두 번째 세팅 화면

Page 13: Sample Soft Keyboard  source  analysis

2. 두 번째 세팅 화면

이 화면을 띄우는 함수

Page 14: Sample Soft Keyboard  source  analysis

3. 기본 키보드 세팅

Page 15: Sample Soft Keyboard  source  analysis

3. 기본 키보드 세팅 (SoftKeyboard.java)

getSystemService() 로 inputmethod service

호출

InputMethodService에서 onInitializeInter-

face() 호출하여 UI 초기화

Page 16: Sample Soft Keyboard  source  analysis

3. 기본 키보드 세팅 (LatinKeyboard.java)

onInitializeinterface()-> latinkeyboard 생성 -> 부모클래스인 keyboard클래스에서 createkeyfromxml 호출

키보드의 배열과 리소스 메소드

Page 17: Sample Soft Keyboard  source  analysis

3. 기본 키보드 세팅 (LatinKeyboard.java)

Createkeyfromxml 에서 호출함키보드의 배열과 리소스 설정

Page 18: Sample Soft Keyboard  source  analysis

3. 기본 키보드 세팅 (LatinKeyboard.java)

키보드 레이아웃의 환경 설정

Page 19: Sample Soft Keyboard  source  analysis

4. 키보드 생성

Page 20: Sample Soft Keyboard  source  analysis

4. 키보드 생성

Page 21: Sample Soft Keyboard  source  analysis

4. 키보드 생성

Page 22: Sample Soft Keyboard  source  analysis

5. 키 입력 (char)키 입력이 일어났을 때 , 공통으로 실행 되는 부분으로 , 점이 입력한 키의 안에 있을 경우 감지하는 함수로 , 키 값에 따라 호출 빈도가 다르다 .

키 입력이 있을 때 , res/values/string.xml 의 ‘ word_separator’ 참조 하는 과정으로 무슨 키를 입력하던 공통 적으로 일어 남 .

onKey() : 입력 값의 종류를 구분 지어주는 메소드 (cancel_key, shift_key, character_key 등등 )

Page 23: Sample Soft Keyboard  source  analysis

5. 키 입력 (char)‘q’ 일반 character 키 입력의 경우

Page 24: Sample Soft Keyboard  source  analysis

5. 키 입력 (cancel)

Page 25: Sample Soft Keyboard  source  analysis

5. 키 입력

Page 26: Sample Soft Keyboard  source  analysis

5. 키 입력

Page 27: Sample Soft Keyboard  source  analysis

5. 키 입력

extends

Call to parent method

Class Key

Class LatinKey

Page 28: Sample Soft Keyboard  source  analysis

5. 키 입력