본문 바로가기
[android] Binder Tokens 에 대해 이해해보자. [android] Binder Tokens 에 대해 이해해보자. Binder Tokens -Binder object 는 system 에서 하나의 Unique ID ( 32-bit )를 갖는다.Binder 가 system 안에서 Unique ID 를 갖는것은 security 문제를 해결하는 데 도움이 된다. - Binder 가 쓰이는 가장 대표적인 예는 Service의 aidl 연결이나 WakeLock 등이 있겠다. Window Tokens -WIndow Token 은 Window manager 가 사용하는 특별한 token 이다. 각 window 를 구별하는 데 사용된다. - WindowToken 은 다른 허가되지 않은 앱이 다른 app 위에 무언가를 그리는 것을 불허한다. Window 를 새로 add .. 2016. 5. 26.
[android] Lollipop (LOS) 부터는 Notification Icon 에 색상을 넣을 수 없다? [android] Lollipop (LOS) 부터는 Notification Icon 에 색상을 넣을 수 없다? 출처 : https://developer.android.com/intl/ko/about/versions/android-5.0-changes.html#BehaviorNotifications #Lollipop ( Android 5.0 ) 부터는 Notification 의 Icon 의 Color 값을 전부 무시하며, Non-Alpha Channel 은 모두 White 로 바꾸어 버린다.즉, Alpha 가 있는 부분은 transparent 로, Alpha 가 없는 부분은 모두 흰색으로 표시한다. ( Material Design 의 영향 ) #만약 기존과 같이 색상이 있는 Notification Icon.. 2016. 2. 14.
[android] Binder 와 Death Recipients 에 대한 이해 [android] Binder 와 Death Recipients 에 대한 이해 안드로이드는 기본적으로 multi-task 를 위해 만들어진 앱이다. 그래서 초창기에는 user 가 명시적으로 process 를 죽이지 못하도록 만들고, main activity 를 종료했을 때는 아주 낮은 priority 로 계속 process 를 살려둔다. 왜 그렇게 하냐? app switching 이 일어날 때 process 를 처음부터 만들려고 하면 너무 많은 시간이 들기 때문이다. 그럼 process 들을 유지함으로서 메모리가 부족하면 어떻게 하냐? 해당 process 를 최소한의 정보를 보존한 후 죽인다. 그리고 해당 process 가 다시 launch 되면 최소한의 정보를 통해 어느 정도 선까지는 상태복구를 해준다.. 2015. 12. 29.
[android] Thread Scheduling 에 대한 이야기 [android] Thread Scheduling 에 대한 이야기 -Thread 에는 priority 값을 주어 CPU 사용량을 조절할 수 있다. ( Process#setThreadPriority( int ), Thread#setPriority( int ) ) 이 Priority 에 들어가는 값은 Nice value 라 부르는데, 다른 Thread 에 대해 얼마나 Nice 한가를 나타내는 값이다. Nice 값이 높다는 것은 다른 Thread 에게 많이 양보하는 착한(?)놈이라는 의미. 즉 Nice 값이 높을수록 우선순위가 낮아 CPU 활용이 적어진다. - Android 에서는 Main ( UI ) Thread 가 우선순위가 보통 가장 높아야 한다. BG 에서 도는 Thread 들의 Nice Value 가.. 2015. 12. 22.
[android] toLowerCase() 에 대한 고찰 ( 터키어, 이스라엘어, 리투아니아어 ) [android] toLowerCase() 에 대한 고찰 ( 터키어, 이스라엘어, 리투아니아어 ) -터키어, 이스라엘어, 리투아니아어 환경에서 개발할 일은 거의 없겠지만...영어에 대해 toLowerCase() 를 호출하면, 이상한 현상이 생기는 것을 목격할 수 있을 것이다. - toLowerCase() 는 Locale 을 지정할 수 있는데, Locale 을 지정해주지 않으면 기본적으로 Locale.getDefault() 를 호출하게 된다. 이 getDefault() 는 현재 단말에 설정된 언어에 기반한다. - 이스라엘어 ( Azeri ) 와 터키어 ( Turkish ) 의 경우는 영문자 I ( 아이 ) 가 점이 없는 ı 로 변경된다. 리투아니아어 ( Lituanian ) 의 경우는 I 뿐만 아니라 J .. 2015. 12. 21.
[android] Serialization 을 사용할 때 다음의 예외를 고려하자. [android] Serialization 을 사용할 때 다음의 예외를 고려하자. serialVersionUID 를 명시적으로 주자. serialVersionUID 를 명시적으로 주지 않으면, compiler 가 계산한 값을 부여한다. 환경이 변하지 않으면 좋겠지만, compiler 가 계산한 값은 상황에 따라 값이 달라질 수 있다. serialVersionUID 가 매치하지 않는 경우에 deserialize 하려고 시도하면 InvalidClassException 이 발생한다. 잠재적 위험을 피하기 위해 serialVersionUID 를 명시적으로 주는 것이 좋다. 만~약 이전 버전에 이미 compiler 가 자동으로 할당한 serialVersionUID 값을 사용하게 되었다면, 그 값을 찾아 명시적으로.. 2015. 12. 17.
[android] intent data filter - android:ssp xml attribute. [android] intent data filter - android:ssp xml attribute. https://chris.orr.me.uk/android-ssp-data-intent-filter - SDK 19 부터 android:sspPrefix, android:sspPattern 을 사용할 수 있다. - 예를 들어 내가 관심있는 것은 카카오톡의 설치 혹은 삭제여부인데, 기존과 같은 방식으로 broadcast receiver 를 등록하면 모든 앱에 대해서 받게 된다. -sspPrefix, sspPattern 을 사용하면 내가 관심있는 카카오톡에 대해서만 broadcast 를 받을 수 있다. ( cf, 카카오톡의 package 이름은 저것이 아닐 수 있다. ) -broadcast 뿐만 아니라 다른.. 2015. 12. 16.
[android] Activity Configuration Change Simulation. [android] Activity Configuration Change Simulation. https://developer.android.com/reference/android/app/Activity.html#recreate%28%29 Activity 의 recreate() 함수를 호출하면 된다. public void recreate ()Added in API level 11Cause this Activity to be recreated with a new instance. This results in essentially the same flow as when the Activity is created due to a configuration change -- the current instance w.. 2015. 12. 14.
[android] Useful ADB commands [android] Useful ADB commands # Start an activity adb shell am start / # Power Button adb shell input keyevent 26 # Menu Button adb shell input keyevent 82 # Print all installed packages adb shell pm list packages [-f] // -f 옵션이 있으면 apk 위치까지 함께 표시된다. # Logcat filter by tagname adb logcat -s TAG_NAME_1 TAG_NAME_2 # Logcat filter by priority adb logcat "*:E" # Logcat filter by tagname and priority.. 2015. 12. 12.
반응형