⊙ 생성자 : 소스코드에서 뷰가 생성될 때 호출되는 형태와, 레이아웃 파일에서 뷰가 전개(inflate) 될 때 호출되는 형태 두가지가 있습니다. 두번째 형태는 레이아웃에 정의된 속성을 분석한 후 적용합니다.

⊙ onFinish!Inflate() :뷰와 그 하위 자식들이 XML 에서 전개 된 후 호출됩니다.

⊙ onMeasure(int, int) : 뷰와 그 자식들에 대한 크기를 결정하기 위해 호출됩니다.

⊙ onLayout(boolean, int, int, int, int) : 뷰가 그 자식들에게 크기와 위치를 할당할 때 호출됩니다.

⊙ onSizeChanged(int, int, int, int) : 뷰의 크기가 바뀔 때 호출됩니다.

⊙ onDraw(Canvas) : 뷰가 컨텐츠를 그릴 때 호출되지요

⊙ onKeyDown(int, KeyEvent) : 새로운 키 이벤트 발생시 호출됩니다.

⊙ onKeyUp(int, KeyEvent) : 키 업 이벤트 발생시에 호출됩니다.

⊙ onTrackballEvent(MotionEvent) : 트랙볼 모션 이벤트 발생시에 호출됩니다.

⊙ onTouchEvnet(MotionEvent) : 터치스크린의 모션 이벤트 발생시에 호출됩니다.

⊙ onFocusChanged(boolean, int, Rect) : 뷰가 포커스를 가지거나 잃을 때 호출됩니다.

⊙ onWindowFocusChanged(boolean) : 뷰를 포함한 윈도우가 포커스를 가지거나 잃을 때 호출됩니다.

⊙ onAttachedToWindow() : 뷰가 윈도우에 포함될 때 호출됩니다.

⊙ onDetachedFromWindow() : 뷰가 윈도우에서 분리될 때 호출됩니다.

⊙ onWindowVisibillityChanged(int) : 뷰를 포함한 윈도우가 보여지는 상태가 변할 때 호출됩니다.

'안드로이드' 카테고리의 다른 글

Animation 에서의 interpolator  (0) 2011.10.13
Activity 이동시 Animation 효과 주기  (0) 2011.10.13
Criteria  (0) 2011.10.11
메모리 릭 관찰하기  (0) 2011.10.10
Onpe GL 강좌 주소  (0) 2011.08.18

Criteria

정의

è  GPS Provider로써, 기기 상황에 따른 옵션을 설정할 수 있음.
예를 들면, 해상도가 우수하거나 또는 그렇지 않는 기기에 따른 GPS 옵션 설정.

 

사용되는 함수

è  setAccuracy(int accuracy)                                                          : 정확도

è  setPowerRequirement(int level)                                              : 전원 소비량

è  setAltitudeRequired(boolean altitudeRequired)                                    : 고도 사용여부

è  setBearingRequired(boolean bearingRequired)                                    : 방위 데이터

è  setSpeedRequired(boolean speedRequired)                        : 속도

è  setCostAllowed(boolean costAllowed)                                                     : 금전적 비용

 

Constants

Constants

int

ACCURACY_COARSE

A constant indicating an approximate accuracy requirement

int

ACCURACY_FINE

A constant indicating a finer location accuracy requirement

int

ACCURACY_HIGH

a constant indicating a high accuracy requirement - may be used for horizontal, altitude, speed or bearing accuracy.

int

ACCURACY_LOW

A constant indicating a low location accuracy requirement - may be used for horizontal, altitude, speed or bearing accuracy.

int

ACCURACY_MEDIUM

A constant indicating a medium accuracy requirement - currently used only for horizontal accuracy.

int

NO_REQUIREMENT

A constant indicating that the application does not choose to place requirement on a particular feature.

int

POWER_HIGH

A constant indicating a high power requirement.

int

POWER_LOW

A constant indicating a low power requirement.

int

POWER_MEDIUM

A constant indicating a medium power requirement.

 

'안드로이드' 카테고리의 다른 글

Activity 이동시 Animation 효과 주기  (0) 2011.10.13
뷰에서 프레임워크가 호출하는 다른 메소드들  (0) 2011.10.12
메모리 릭 관찰하기  (0) 2011.10.10
Onpe GL 강좌 주소  (0) 2011.08.18
IOS-639 CODE  (0) 2011.08.12
출처 : http://shadowxx.egloos.com/10688758

"adb shell" 연결 상태에서 "ps -P" RSS 커지기만 하는 process 없는  관찰한다

예를 들어  

system    2521  2378  889252 120084 0     -20   0     0     fg  ffffffff 00000000 S system_server  -> 120M 들고있음.


이후 "cat /proc/해당 process id/maps" 해서 어떤 영역이 커지고 있는 것인지를 좁혀갈수 있는지 파악해볼 수 있다.

실시간으로 Memory 상태는 top 명령으로 볼 수 있다.
top -m 10 -s rss -d 1 

'안드로이드' 카테고리의 다른 글

뷰에서 프레임워크가 호출하는 다른 메소드들  (0) 2011.10.12
Criteria  (0) 2011.10.11
Onpe GL 강좌 주소  (0) 2011.08.18
IOS-639 CODE  (0) 2011.08.12
가상 키보드 보이기/감추기  (0) 2011.08.12

'안드로이드' 카테고리의 다른 글

Criteria  (0) 2011.10.11
메모리 릭 관찰하기  (0) 2011.10.10
IOS-639 CODE  (0) 2011.08.12
가상 키보드 보이기/감추기  (0) 2011.08.12
공개 api 작업하기 (make update-api)  (0) 2011.07.30
FAQ : 프로그래밍적으로 키보드 숨김/감춤/보기. 액티비티 시작시 키보드 숨김/감춤/보기, EditText선택시 키보드 안뜨게하기 등 소프트 키보드 동작 관련 질문에 대한 답변

1. 키보드 감추기
EditText editText = (EditText) findViewById(R.id.myEdit);
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);

2. 키보드 보여주기
EditText editText = (EditText) findViewById(R.id.myEdit);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED);

위 코드로 안보이는 경우 아래코드도 시도해보세요
- imm.showSoftInputFromInputMethod (editText .getApplicationWindowToken(),InputMethodManager.SHOW_FORCED);

onCreate등에서 제대로 동작하지 않는다면 
Handler로 post를 해서 위 코드를 실행시켜보세요.

3. 키보드 토글 - 위 두가지 방법으로 안되는 경우 다음과 같은 코드로 동작하는 경우가 있습니다.
imm.toggleSoftInputFromWindow(editText.getApplicationWindowToken(),  InputMethodManager.SHOW_FORCED, 0); 

4. 액티비티 시작시 자동으로 키보드 보여주기
AndroidManifest.xml의 activity 태그의 속성에 android:windowSoftInputMode="stateVisible" 혹은 "stateAlwaysVisible"삽입

5. 액티비티 시작시 자동으로 키보드 보여주지 않기
AndroidManifest.xml의 activity 태그의 속성에 android:windowSoftInputMode="stateHidden" 혹은 "stateAlwaysHidden" 삽입

6. 에디트 텍스트 선택해도 키보드 안뜨게 하기
EditText xml 속성에서 inputType 을 0으로 주면 안뜹니다.

반복되는 질문을 정리하는 FAQ 작업 진행중입니다. 키보드 동작 관련해서 정리할 글입니다. 
잘못된 부분이나 추가할 부분있으면 알려주세요.

출처 : http://www.androidpub.com/1104990
 

공개 API를 작업하기위해서는 아래와 같은 작업을 해야만 합니다.
아래의 작업은 tat를 공개 Api로 작업 하는 내용입니다.

모듈별로 작업하기 위해서는 make update-api TARGET_PRODUCT=[모델명] 을 입력하시면 됩니다.

(1)  i add it to frameworks/base/tat. 


(2) modify build/core/pathmap.mk 


like this: 
FRAMEWORKS_BASE_SUBDIRS := \ 
        $(addsuffix /java, \ 
            core \ 
            graphics \ 
            im \ 
            location \ 
            media \ 
            opengl \ 
            sax \ 
            telephony \ 
            wifi \ 
            tat \ 
         ) 


(3) make and make sdk. (successfully). 

Unhanlded fault
커널 로그를 보면 보통 위의  로그를 찍어주면서 시작하게 됩니다. 
보통 커널 패닉 또는 다운로드 모드로 진입하게 됩니다.
아직 커널 관련해서 잘 몰라서 왜 위의 에러가 발생하는지에 대해서는 잘 모릅니다.
아래의 내용은 다른 웹사이트에서 발췌한 내용입니다.
참고하시길 바랍니다.

추후에 커널에 대해서 알게된다면 정리하도록 하겠습니다.
 
I found this error message when access memory io 

"Unhandled fault: external abort on non-linefetch"

1. I suspect memory io address then I access another memory io address but it was OK
2. I thought my driver has a some interface problem, because kernel has some changes for driver interface as like ioctl - but it's not
3. then I thought ioremap and request_mem_region usage are changing - but it's not
4. I tried this memory address at machine start but I got same message 
5. Finally I suspected memory IO Pheriperal device power status then I checked power manegement register 

I got a result 
when memory io device is not power up this message shows 

It took a few hours, finally I got new one today.

출처 : http://dokyunblog.blogspot.com/2011/04/unhandled-fault-external-abort-on-non.html 

1. layout/main.xml의 progress bar의 android:progressDrawable 속성을 설정한다.

 

<ProgressBar

android:progressDrawable="@drawable/new_drawable"

...

</ProgressBar>

 

2. res/drawable/new_drawable.xml 파일을 생성한다.

각 스타일을 설정한다.

<?xml version="1.0" encoding="utf-8"?>

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+android:id/background" android:drawable="@drawable/backgroundProgress" />
    <item android:id="@+android:id/secondaryProgress" android:drawable="@drawable/secondaryProgress" />
    <item android:id="@+android:id/progress" android:drawable="@drawable/progress" />
</layer-list>

3. res/drawable 디렉토리 밑에 다음의 파일을 생성한다.

 

backgroundProgress.png

secondaryProgress.png

progress.png

 

png파일을 생성하지 않고 drawable로 작성하려면

2b. res/drawable/new_drawable.xml 파일을 다음과 같이 설정한다.

<?xml version="1.0" encoding="utf-8"?>

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    
    <item android:id="@android:id/background">
        <shape>
            <corners android:radius="0dip" />
            <gradient
                    android:startColor="#ff9d9e9d"
                    android:centerColor="#ff5a5d5a"
                    android:centerY="0.75"
                    android:endColor="#ff747674"
                    android:angle="270"
            />
        </shape>
    </item>
    
    <item android:id="@android:id/secondaryProgress">
        <clip>
            <shape>
                <corners android:radius="0dip" />
                <gradient
                        android:startColor="#80ffd300"
                        android:centerColor="#80ffb600"
                        android:centerY="0.75"
                        android:endColor="#a0ffcb00"
                        android:angle="270"
                />
            </shape>
        </clip>
    </item>
    
    <item android:id="@android:id/progress">
        <clip>
            <shape>
                <corners android:radius="0dip" />
                <gradient
                        android:startColor="#ff0000"
                        android:centerColor="#00ff00"
                        android:centerY="0.75"
                        android:endColor="#0000ff"
                        android:angle="0"
                />
                <stroke android:width="3dp" color="#000000"/> <- Progress 테두리 그려주는 곳.
                <padding android:left="10dp" android:top="10dp"         
      android:right="10dp" android:bottom="10dp" /> 
            </shape>     
        </clip>       
    </item>    
</layer-list>



LOCK이 걸려있는 상황에서 그 위로 어떤 화면인가를 보여주고 싶을때 사용할 수 있는 FLAG가 있습니다.


바로 FLAG_SHOW_WHEN_LOCK 


Android developer Reference에는 아래와 같이 설명되어있습니다.
Window flag : 
special flag to let windows be shown when the screen is locked. 
This will let application windows take precedence over key guard or any other lock screens. 
Can be used with FLAG_KEEP_SCREEN_ON to turn screen on and display windows directly before showing the key guard window. 
Can be used with FLAG_DISMISS_KEYGUARD to automatically fully dismisss non-secure keyguards. 
This flag only applies to the top-most full-screen window.
Constant Value: 524288 (0x00080000) 

중요한 내용은...
FLAG_KEEP_SCREEN_ON 플래그와 함께 사용해서 락 위에 직접적으로 창을 보여주고 싶을때 사용한다는 것.
FLAG_DISMISS_KEYGUARD 플래그와 함께 사용해 키가드의 보호를 자동으로 없앨수있다는 것.
그리고 이 flag는 full-screen의 창만을 지원한다는 것. 

코드는 간단합니다.
아래의 한줄을 onCreate에 추가해주면 됩니다.
 

getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
 

만약, 타이틀 바(Title bar)도 없애고 싶다면 아래의 코드를 추가해줍니다.
이때는 xml Layout을 setContent 하기 전에 코드를 추가해야 합니다. 아래와 같이 해주면 됩니다.
 

super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);

FLAG_KEEP_SCREEN_ON 또는 FLAG_DISMISS_KEYGUARD 역시 FLAG_SHOW_WHEN_LOCKED와 같이 추가해서 사용하면 됩니다.

출처 :  
http://croute.me/350

+ Recent posts