'android 2.0'에 해당되는 글 1건

  1. 2009.12.01 Android 2.0 brief 4
Android/정리2009. 12. 1. 17:56
2009년 11월 배포, framework API가 변경되었으며 사용자와 개발자에게 새로운 feature를 제공한다.
SDK에 다운로드하여 콤포넌트의 설치가 가능하다.

새로운 UI
 * Contacts and accounts
   - Email과 Contacts에 여러개의 계정을 사용할 수 있다(Exchange account포함).
   - 개발자가 Sync adapter를 추가할 수 있다(원하는 포맷의 동기화를 직접 구현할 수 있다).
   - Quick Contact기능은 contact에 대한 정보와 communication mode에 대해 빠른 억세스를 할수 있게 해준다. Photo, Call, SMS, email등의 기능을 바로 실행할 수 있다.
 * Email
   - Exchange 지원
   - 하나의 페이지내에서 다중사용자의 이메일을 보기 위한 이메일박스를 통합하여 보여준다.
 * Messaging
   - 모든 저장된 SMS, MMS message의 검색기능
   - 조건에 따른 오래된 메세지 자동삭제 기능
 * Camera
   - flash 지원
   - Digital zoom
   - Scene mode
   - White balance
   - Color effect
   - Macro focus
 * Andorid Virtual keyboard
   - 문자를 더 정확하게 입력하고 편하도록 keyboard layout개선
   - multitouch 기능의 안정화(두손가락이 빠르게 입력될 때 key press가 사라지지 않도록 함)
   - 더 스마트해진 사전기능.
 * Browser
   - 동작가능한 URL bar로 입력된 주소로 search나 이동이 가능함.
   - webpage thumnail기반의 bookmark
   - double-tab zoom지원
   - HTML5지원
    • Database API support, for client-side databases using SQL.
    • Application cache support, for offline applications.
    • Geolocation API support, to provide location information about the device.
    • <video> tag support in fullscreen mode.
   
* Calendar
   - Agenda view가 무제한 scroll지원
   - 각 초대에 대해 이벤트 감지(?)
   - 이벤트에 새로운 게스트 초대

새로운 플랫폼 기술
* Media Framework
   - graphic 성능 개선
* Bluetooth
   - Bluetooth 2.1
   - New BT profiles : Object Push Profile(OPP) and Phone Book Access Profile(PBAP)

새로운 Framework API
API Level은 5이며 몇가지 새로운 API를 제공한다.

* Bluetooth
  - Turn on/off Bluetooth
  - Device와 Service 검색
  - Connect to a remote device usinng RFCOMM and send/receive data
  - Advertise RFCOMM services and listen for incoming RFCOMM connection
* Sync adapters
  - 임의 데이터의 싱크 지원 가능함.
* Account Manager
  - 보안고려한 통합된 Account manager API지원
* Contacts
  - multi account지원하는 새로운 Contacts API
  - 새로운 Quick Contact framework API제공
* WebView
  - UrlInterceptHandler, Plugin, PluginData, PluginList,UrlInterceptRegistry 제거
* Camera
  - 새로운 파라메터 제공 : color effect, scene mode, flash mode, focus mode, white balance, rotation, etc...
  - Zoom level 변경시 ZoomCallback interface제공
* Media
  - 모든 image는 MediaStore에 저장될 때 thumbnail생성
  - 새로운 Thumnail API제공하여 image와 video thumnail을 검색가능
* Other framework
  - 새로운 System theme제공(R.style) : 현재 system wallpaper상에 최상위에 activity를 표시하거나 이전 activity를 background에 보여지게 할 수 있슴.
  - WallpaperManager가 새롭게 교체됨 
  - 새로운 Service API : service가 수행중 메모리가 모자란 경우등에 대해서 Application에서  Service life-cycle을 정확하게 처리할 수 있는 API가 추가됨 -> Service.setForeground()는 사용되지 않으며 Service.startForeground()사용함.
  - MotionEvent가 multi-touch지원함. 동시에 3개까지 지원
  - KeyEvent가 새로운 dispatch API제공 : action-on-up, long-press, cancel key 메커니즘(viertual key)
  - WindowManager.LayoutParams에 새로운 상수 추가 : 화면에 보여지거나 스크린이 lock되어 있는 상태에서 표시될 때 wake-up시킬수 있는 상수 제공. AlarmClock같은 app에서 쉽게 구현 가능
  - 새로운 Intent API : device의 docking상태를 broadcast하고 Application에서 이때 임의 activity를 실행할 수 있다.

** Key-up 이벤트 
  - 2.0은 HOE, MENU, BACK, SEARCH키에 기반하여 동작하도록 설계되었다. 최적의 UX를 위해서 key-down보가 key-down, key-up 쌍으로 수행되도록 개선되었다. 이 로써 잘못된 버튼 이벤트를 방지할 수 있고 사용자가 버튼을 누른상태에서 아무 이벤트발생시키지 않으면서 drag out 할 수 있다.
  - 이 수정사항은 button 이벤트를 가로채서 key-down action을 얻어낼 때 유효하다. Application에서 BACK key를 가로채고 싶다면 App에서 key event 속성을 처리해야 한다.
  - 일반적으로 App에서 BACK key의 가로채기는 권장사항이 아니다. 하지만 그렇게 해야 하고 key-up보가 key-down이벤트를 처리해야 한다면 코드를 수정해야 한다.
  - Activity나 Dialog에서 BACK key를 가로채고 싶다면 onBackPressed()만 구현하면 된다.

  - If you are intercepting the BACK key in a view, you should track the key event on key-down (through the new startTracking() method), then invoke the action at key up. Here's a pattern you can use:

        public boolean onKeyDown(int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_BACK
                    && event.getRepeatCount() == 0) {
                event.startTracking();
                return true;
            }
            return super.onKeyDown(keyCode, event);
        }
    
        public boolean onKeyUp(int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_BACK && event.isTracking()
                    && !event.isCanceled()) {
                // *** DO ACTION HERE ***
                return true;
            }
            return super.onKeyUp(keyCode, event);
        }

If you want to update a legacy application so that its handling of the BACK key works properly for both Android 2.0 and older platform versions, you can use an approach similar to that shown above. Your code can catch the target button event on key-down, set a flag to track the key event, and then also catch the event on key-up, executing the desired action if the tracking flag is set. You'll also want to watch for focus changes and clear the tracking flag when gaining/losing focus.


  

API differences report

For a detailed view of API changes in Android 2.0 (API Level 5), as compared to the previous version, see the API Differences Report.







Posted by 삼스