Android/App개발2010. 2. 7. 15:50
Posted by 삼스
Android/App개발2010. 2. 7. 15:50

Controls for the Android OS
Keyboard OS function
Escape Back button
Home Home button
F2, PageUp Menu (Soft-Left) button
Shift-F2, PageDown Star (Soft-Right) button
F3 Call/Dial button
F4 Hangup/EndCall button
F5 Search button
F7 Power button
Ctrl-F3, Ctrl-KEYPAD_5 Camera button
Ctrl-F5, KEYPAD_PLUS Volume up button
Ctrl-F6, KEYPAD_MINUS Volume down button
KEYPAD_5 DPad center
KEYPAD_4 DPad left
KEYPAD_6 DPad right
KEYPAD_8 DPad up
KEYPAD_2 DPad down
Controls for the Android Emulator
Keyboard Emulator function
F8 toggle cell network on/off
F9 toggle code profiling (when -trace option set)
Alt-ENTER toggle fullscreen mode
Ctrl-T toggle trackball mode
Ctrl-F11, KEYPAD_7 switch to previous layout
Ctrl-F12, KEYPAD_9 switch to next layout
KEYPAD_MULTIPLY increase onion alpha
KEYPAD_DIVIDE decrease onion alpha
Posted by 삼스
Android/정리2010. 1. 21. 12:01
Activity의 메인 윈도우에 어떻게 on-screen soft keyboard가 동작할것인지에 대한 방법을 기술한다.
이 설정은 두가지에 대해 영향을 준다.
 1. soft keyboard의 상태 - activity가 사용자의 포커스를 받을때 보여질지 숨겨질지
 2. activity의 메인윈도우를 조정할지 - soft keyboard의 크기를 줄이거나 soft keyboard에의 해 덮어씌워질때 윈도우 사이즈를 조정하거나 한다.

아래 나열한 값들 중에 하나이상을 나열할 수 있으며 "state.."값하나와 "adjust.."값 하나씩 사용할 수 있다.
각 그룹에 여러개의 값을 지정하는것은 정의되어 있지 않으며 각 값은 |로 분리하여 나열할 수 있다.

stateUnspecified : hidden 또는 visible을 지정하지 않음. 시스템이 알아서 선택하거나 theme의 값을 참조한다.
stateUnchanged : activity가 foreground로 올때 마지막 상태(visible, hidden)를 유지하고 있는다.
stateHidden : activity 실행중에 hidden이다. that is, when the user affirmatively navigates forward to the activity, rather than backs into it because of leaving another activity.
stateAlwaysHidden : activity가 focus를 가지고 있으면 무조건 softkeyboard는 hidden으로 함.
stateVisible : 일반적인 모드로 동작
stateAlwaysVisible : activity 실행중에 visible이다.  that is, when the user affirmatively navigates forward to the activity, rather than backs into it because of leaving another activity.

adjustUnspecified : resize나 pan하지 않는다. 메인윈도우의 디폴트셋팅이다. 시스템은 자동으로 하나의 모드를 선택하는데 자신의 콘텐츠를 스크롤할 수 있는 layout view를 윈도우가 가지고 있는지에 따라 결정된다. 만일 그런 view라면 윈도우는 resize되어 더 작은 영역에서 모든 윈도우의 콘텐츠가 스크롤되어 표시될수 있어야 한다.
adjustResize : Activity의 메인윈도우가 softkeyboard에 따라 항상 resize된다. 
adjustPan : Activity의 메인윈도우가 resize되지 않고 pan된다. 따라서 keyboard에 의해 현재 포커스가 가려지지 않아서 사용자는 항상 타이핑결과를 볼수가 있다. resizing옵션보다 권장되지 않는데 사용자는 윈도우상에 보이지 않는 부분을 보기 위해 softkeyboard를 닫아야 하기 때문이다. 


화면의 하단에 EditText가 하나 있다고 가정후 두 옵션의 차이점은 아래와 같다.
 1. adjustResize : 메인윈도우 사이즈가 줄어든다, 하지만 EditText는 보이지 않는다. 스크롤이 지원되면 스크롤하여 볼수는 있다.
 2. adjustPan : 메인윈도우 사이즈가 줄어들지 전체적으로 않고 EditText가 보이도록 위로 올라간다. EditText는 보이나 다른 UI가 보이지 않는다.







Posted by 삼스
Android/정리2010. 1. 14. 13:00
1. ENG모드로 빌드하면 됨.
2. initramfs의 default.prop파일의 secure값이랑 adb값, debuggable값을 각각 0,1,1로 setting한 걸로 바꾸면 됨.
Posted by 삼스
Android/정리2010. 1. 13. 17:11
PowerManager는 Screen을 On/Off할때 WindowManager에 통지를 하고 이는 KeyguardViewMediator를 통해 LockScreen에도 전달된다.

PowerManagerService.mNotificationTask
    -> WindowManagerPolicy.screenTurnedOn()
        -> KeyguardViewMediator.onScreenTurnedOn();
    -> WindowManagerPolicy.screenTurnedOff()
        -> KeyguardViewMediator.onScreenTurnedOff();

Posted by 삼스
Android/정리2010. 1. 13. 16:24
Android concept이다.
Keyguard가 표시중이거나 Hidden일경우 PowerManager.enableUserActivity(true)에 의해 mUserActivityAllowed변수가 set되면서 PowerManager.userActivity(..)에서 setPowerState가 정상적으로 호출될 수 있다.
PowerManager.userActivity는 WindowManagerService.InputDispatcherThread에서 이벤트큐의 이벤트를 처리할때마다 호출된다. 따라서 PowerManager.enableUserActivity()로 screen timeout을 ON/OFF할 수 있다.

Keyguard에서 이를 이용해 LockScreen이 표시중에는 사용자 입력이 있더라도 무조건 5초후에 꺼지도록 되어있다.
KeyguardViewMediator.java
private void adjustUserActivityLocked() {
        // disable user activity if we are shown and not hidden
        if (DEBUG) Log.d(TAG, "adjustUserActivityLocked mShowing: " + mShowing + " mHidden: " + mHidden);
        boolean enabled = !mShowing || mHidden;
        mRealPowerManager.enableUserActivity(enabled);
        if (!enabled && mScreenOn) {
            // reinstate our short screen timeout policy
            pokeWakelock();
        }
    }


Posted by 삼스
Android/정리2010. 1. 6. 23:01
http://learnandroid.blogspot.com/2008/01/run-android-application-from-command.html

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.iftitah.android.contact">
  <application android:icon="@drawable/icon">
   <activity class=".Contact" android:label="@string/app_name">
    <intent-filter>
    <action android:value="android.intent.action.MAIN" />
    <category android:value="android.intent.category.LAUNCHER" />
   </intent-filter>
  </activity>
 </application>
.
.
</manifest>

위와 같이 activity가 정의되어 있을 때... 아래와 같이 실행하면 됨

am start -a android.intent.action.MAIN -n
com.iftitah.android.contact/com.iftitah.android.contact.Contact
Posted by 삼스
Android/정리2009. 12. 9. 17:55
API Level : 6

Android 2.0.1은 android handset에 적용가능한 minor platform release이다.
minor API change, bug-fixes, framework behavioral의 변경이 되었다. framework에 대한 변경은  Framework API 를 참조하라.

Built-in app로 Sync Tester app가 추가되어 thirdparty sync adapter의 테스트를 돕는다.

API 변경 요약
  • quickContactBadgeStyle* 속성이 QuickContactBadge에 추가됨. -> style을 지정가능
  • ACTION_CONFIGURATION_CHANGED를 받기 위해 manifest에 기술할 필요 없으며 run-time에 registerReceiver()로 하면 됨
Framework관련 behavior변경 요약

블루투스
  ACTION_REQUEST_ENABLE과 ACTION_REQUEST_DISCOVERABLE의 리턴값 변경
  • ACTION_REQUEST_ENABLE이 성공하면 RESULT_OK를 사용자가 취소하면 RESULT_CANCELED를 리턴함
  • ACTION_REQUEST_DISCOVERABLE은 사용자가 취소하거나 BT가 enable상태가 아니면 RESULT_CANCELED를 리턴함.

Contacts
  ACTION_INSERT intent는 해당 contact가 더이상 존재하지 않으면(not persist) RESULT_CANCELED를 리턴한다.

Bug fixes
  일부 framework API의 버그를 수정함.

Resource  
  API level에 따른 app resource를 잘못 로딩하는 경우 수정됨. ex) drawable-v4는 API level4이상에서만 로드함.

Contacts
  ACTION_INSERT intent가 Contacts API로 생성한 요구에 대해 적절한 종류의 URI를 리턴함.

Others
  getCallingPackage()가 process명보다 package명으로 리턴함.

API differences report

For a detailed view of API changes in Android 2.0.1 (API Level 6), as compared to API Level 5, see the API Differences Report. Note that this difference report compares only to the most recent API Level, and there are few changes, so to see changes introduces in Android 2.0 (API Level 5), see the API Differences between 4 and 5.









Posted by 삼스
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 삼스
카테고리 없음2009. 11. 25. 14:00
Posted by 삼스