본문 바로가기
[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] Shared Element Transition Tutorial ( with transparent bg ) [android] Shared Element Transition Tutorial ( with transparent bg ) https://medium.com/@aitorvs/android-shared-element-transitions-for-all-b90e9361507d#.zoz5i6xkz -LOS 이상부터는 이를 구현하는 것이 매우 쉽다.( https://developer.android.com/training/transitions/start-activity )그러나 그 이전버전도 지원하는 경우 버전분기를 하는 공수가 든다.그래서 새로운 API 없이 Compat 한 방법으로 Transition 하는 방법을 소개한다. -Activity A -> B 로 이동시 동일한 모양을 가진 View 가 있다면,A 에.. 2018. 9. 28.
[android] ArrayMap 과 SparseArray 를 이용한 최적화 [android] ArrayMap 과 SparseArray 를 이용한 최적화 https://medium.freecodecamp.com/android-app-optimization-using-arraymap-and-sparsearray-f2b4e2e3dc47#.pg0eea2cx ArrayMap vs. HashMap -ArrayMap 은 android.util.ArrayMap 과 android.support.v4.util.ArrayMap 두 가지 형태가 있다.뒤의 녀석은 compat 이슈를 위한 것. -ArrayMap 은 HashMap 보다 더 memory 최적화된 데이터 구조를 가진다.ArrayMap 은 array 를 이용해 mapping 을 관리한다.Hash integer 를 가지고 있는 array 와,.. 2018. 3. 5.
[android] Bundled Notification Tutorial -Bundled Notification 은 Android Wear 의 Stacking Notification 과 비슷한 맥락이다.Notification 이 하나의 Title 밑에 List 형태로 붙어서 나온다.그리고 이 녀석을 클릭하면, Notification 이 확장되서 개개별 Notification 으로 나뉘어 나온다. -Bundled Notification 은 Nougat 부터 사용 가능하다.Nougat 이전 버전에서는 아래와 같이 나온다. -Bundled Notification 의 핵심은 “Group” 이라는 녀석과 “GroupSummary” 이란 녀석이다.private Notification buildNotification(Message message, String groupKey){ retur.. 2018. 3. 2.
Android ViewDragHelper Tutorial Android ViewDragHelper Tutorial 이 녀석은 Youtube 비디오가 우하단으로 축소되는 것의 구현에 사용된 녀석이다. ViewDragHelper ( 이하 VDH ) 는 다음과 같은 특징을 가지고 있다. - ViewDragHelper.Callback 은 parent view 와 VDH 간의 communication channel 이다.- VDH instance 를 만들기 위해서는 static factory method 를 이용하면 된다.- Drag direction 은 설정 가능하다.- View 가 없어도 drag detection 이 가능하다. VDH 는 support-v4 library 에 있다.VDH 는 VelocityTracker 나 Scroller 를 사용하여 구현되어 있다.. 2014. 6. 9.
Android RenderScript blur Android RenderScript Blur RenderScript 관련 API 들은 API 11 에 등장했다.하지만 Compat library 를 통해 API 8 부터 사용 가능하다. RenderScript 는 Graphic 작업을 할 때 CPU, GPU 중 해당 작업을 최적으로 처리할 수 있는 것을 찾아내서 multiple processor 작업을 하고 나중에 그 결과를 합치는 작업을 하여 성능을 매우 높인다. Native syntax 는 C99 기반으로, OpenCL, CUDA, GLSL 등이랑 비슷하다. private void blur(Bitmap bg, View textView, float radius) { Bitmap overlay .. 2014. 6. 8.
Android Transition Animation (TransitionManager, Transition, Scene) Tutorial Android Transition Animation (TransitionManager, Transition, Scene) Tutorial 기본 참조 : http://blog.stylingandroid.com/archives/2143 Layout 의 변화에 대한 animation 을 지원한다.Layout 에 add, remove, move, resize, show, hide 등에 대한 기본 animation 을 지원한다. private ViewGroup mLayout1; @Overridepublic View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.in.. 2014. 4. 8.
[android] compat version mapfragment xml example. android, compat version mapfragment xml example. Android, CLASS, com.google.android.gms.maps.MapFragment, com.google.android.gms.maps.SupportMapFragment, compat, compat version mapfragment xml example., fragment, map, map v2, map:cameraTargetLat, map:cameraTargetLng, map:cameraZoom, V2, xmlns 2014. 4. 7.
[Android] Blurring Technique faster than RenderScript [Android] Blurring Technique faster than RenderScript http://trickyandroid.com/advanced-blurring-techniques/ 요즘은 이상하게 Blurring 기술이 많이 언급되고 있다.performance 입장에서 Blurring 은 Renderscript 가 진리! 라는 추세인데,이 article 에서는 pure Java 를 이용하여 blurring 을 하면서 renderscript 보다 더 성능이 좋은 방법을 찾아냈다. Renderscript 의 단점은 그 사용법이 어렵다는 것이고, ( 물론 Blurring 만 하는 것은 어렵지 않다. )BackwardCompatibility 측면에서 제약이 있다는 것이다.그래서 저 글의 필자는 P.. 2014. 3. 27.
반응형