본문 바로가기
[android] Doze 모드와 GCM high priority 조합 중 주의해야 할 것 [android] Doze 모드와 GCM high priority 조합 중 주의해야 할 것 https://android-developers.googleblog.com/2015/10/how-google-cloud-messaging-handles-doze.html?linkId=17513523 -Doze 모드에 들어갔어도 High Priority GCM 을 받으면 wake up 되면서 일 처리를 할 수 있는 것으로 대부분의 개발자가 알고 있다.그리고 그것을 남용하는 케이스가 있는데, 사실 가이드는 battery save 를 위해 꼭 필요한 경우가 아니면 normal priority 를 사용을 권장한다.( 실제 요즘 안드로이드 최신 버전의 트랜드를 봐도 적절하지 않은 API 사용들에 대해 제재가 가해지는 형국이.. 2019. 1. 31.
[android] Lazy loading dex files [android] Lazy loading dex files https://medium.com/@Macarse/lazy-loading-dex-files-d41f6f37df0e -65K method limit 을 넘어서면 multi dex 가 필요하다. -LOS 이전에서 MultiDex 를 사용하면 startup time 에 delay 가 있었다. -MultiDex lib source code 를 보면, 거기서 하는 일은. classloader 를 이용하여 추가 dex file 를 app 시작 시 로드하도록 프로그래밍 되어 있다.왜 app 시작시 로드를 할까? 예를 들어 payment 에 관련된 lib 이 있다면 이런 녀석들은 사용되지 않을 수도 있는데.. 사용해도 나중에 로드해도 될텐데 말이다. -lazy.. 2019. 1. 30.
[android] "Memory leak" detect library [android] "Memory leak" detect library https://medium.com/square-corner-blog/leakcanary-detect-all-memory-leaks-875ff8360745 -Square 에서 고객 사인에 대한 OOM 방지를 위해 한 노력들 1. Bitmap.Config.ALPHA_8 로 Bitmap 생성 (color 값이 필요 없는 경우.)2. OutOfMemoryError(이하 OOM) 을 catch 해서 GC 를 강제로 수행하고 retry -Bitmap 이 문제가 아님을 깨달음.OOM 은 memory 가 full 에 가까우면 작은 bitmap 을 생성할 때도 죽을 수 있다.즉, 애초에 memory leak 이 나지 않게 해서 memory footpr.. 2019. 1. 29.
[android] Google Play Service: Nearby Connections API [android] Google Play Service: Nearby Connections API https://code.tutsplus.com/tutorials/google-play-services-using-the-nearby-connections-api--cms-24534 -Google Play Service(이하 G.P.S) 에 있는 Nearby Connections API 를 이용하면,LAN ( Local Area Network ) 를 이용해 App 을 host 로 작동시키면서 여러개의 device 를 해당 host 에 연결시킬 수 있다. Use case 는 phone 을 android TV 에 연결해서 control 을 한다던지, Multi user 를 연결해서 game 을 한다던지 할 수 있겠.. 2019. 1. 28.
[android] background work(AlarmManager) 수행에 대한 이야기 [android] background work(AlarmManager) 수행에 대한 이야기 https://plus.google.com/+AndroidDevelopers/posts/GdNrQciPwqo -구버전 안드로이드에서는 background work 를 위해서 보통 AlarmManager 를 사용했다.AlarmManager 를 사용하면 앱이 foreground 가 아닌 상황에서도 미래 특정 시점에 어떤 일을 하도록 scheduling 을 할 수 있다. -60초 이내에 무언가를 수행하게 하고 싶다면 AlarmManager 는 best choice 가 아닐 수 있다.이 때는 Handler 를 이용해보도록 하자. -API 21+ (5.0 LOS) 부터는 setAlrmClock() API 를 통해서 user.. 2019. 1. 27.
[android] Chrome Custom Tabs - 기존에 특정 web page 를 보여주기 위해서는 external browser 에 의존하거나 internal WebView 를 활용하는 방법만 있었다.external browser 는 많은 기능을 support 하며 state 를 share 한다는 장점이 있지만, context switch 적 성격이 강하며 customize 하기 어렵다.internal WebView 의 경우 반대로 context switch 적 성격이 약하고, customize 하기는 쉽지만, state 를 share 하지 못하고, standard 를 맞춰 support 하기 어렵워 많은 공수가 든다는 단점이 있다. external browser (chrome) 만큼의 호환성을 갖춘 “Custom Tabs” 라는 것이 suppor.. 2019. 1. 26.
[android] PercentLayout [android] PercentLayout https://blog.stylingandroid.com/percent-part-1 -LinearLayout 의 weight 로 해결할 수 있는데 왜 PercentLayout 이 필요할까? parent 가 LinearLayout 이 아닌데 percent 기준으로 view 의 layout 하거나 size 를 구성할 일이 있을 것이다. nested weight 는 cost 가 꽤 크지만(weight 자체가 2번 measure), PercentLayout 은 그렇지 않다. -PercentLayout 은 2가지 타입이 있다. PercentRelativeLayout 과 PercentFrameLayout기본적인 동작은 RelativeLayout 과 FrameLayout 과.. 2019. 1. 25.
[android] FlatBuffers ( json 보다 좋은 format? ) [android] FlatBuffers ( json 보다 좋은 format? ) http://frogermcs.github.io/flatbuffers-in-android-introdution -Facebook 이 대부분의 Android app 에서 JSON 을 FlatBuffers 로 바꾸면서 많은 성능 향상을 이루었다고 발표했다. -FlatBuffers 는 Google 의 cross-platform serialization lib 이다.원래는 game 개발을 목적으로 생성되었으며, UI 를 가진 앱들의 기본인 16ms rule 을 따른다. -FlatBuffers 가 효율적인 이유는? Serialized data 가 flat binary buffer 라서 parsing 이 필요없다. -> 빠르다 Buff.. 2019. 1. 24.
[android] Curved motion [android] Curved motion https://blog.stylingandroid.com/curved-motion-part-1/ -기본적으로 KK 부터 등장한 TransitionManager 를 사용한다. -Transition 을 줄 때 custom transition 을 주면 transition 형태를 바꿀 수 있다.custom transition load 는 TransitionInflater 를 통해 한다.TransitionInflater.from(context).inflateTransition(transitionManager, transitionId); // transitionId 는 @TransitionRes -Transition res 는 아래와 같이 정의한다.TransitionMan.. 2019. 1. 23.
반응형