본문 바로가기
[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] 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] Direct Reply Tutorial https://blog.stylingandroid.com/nougat-direct-reply/ -Direct Reply 는 Notification 으로부터 App Launch 없이 바로 답장을 보내는 기능이다.Message App 에 한정되지 않고 모든 앱이 사용 가능하다. -Direct Reply 는 Android N Nougat 버전에 한해 사용 가능하다. -Direct Reply 의 키는, Notification 을 만들 때 remoteInput 을 추가하는 것이다.// notification 생성private static final String REPLY_KEY = “reply”;private static final String REPLY_LABEL = “Input reply”; // Action.. 2018. 2. 28.
[Kotlin] Kotlin 의 숨겨진 비용 #2 [Kotlin] Kotlin 의 숨겨진 비용 #2 https://medium.com/@BladeCoder/exploring-kotlins-hidden-costs-part-2-324a4a50b70 Local functions -local function 의 limit 은 inline 으로 정의될 수 없다는 것 ( 글 쓴 당시까지는, 현재버전에서 꼭 체크해보라 ).그리고 local function 을 가지고 있는 녀석도 inline 이 될 수 없다.fun someMth(a: Int): Int { fun sumSquare(b: Int) = (a+b) * (a+b) return sumSquare(1) + sumSqaure(2)} local function 은 Function object 로 바뀐다.public .. 2018. 1. 17.
[android] ContentProviderOperation 에 대한 짧은 이야기 [android] ContentProviderOperation 에 대한 짧은 이야기 https://www.grokkingandroid.com/better-performance-with-contentprovideroperation/http://stackoverflow.com/questions/4655291/semantics-of-withvaluebackreferencehttps://developer.android.com/reference/android/content/ContentProviderOperation.Builder.html -여러 개의 data 에 대하 Create, Delete, Update 를 수행하려면 ContentProviderOperation 을 사용하여 batch 를 돌리는 것이 추천된.. 2017. 4. 15.
Android StrictMode Android StrictMode 출처http://code.tutsplus.com/tutorials/android-best-practices-strictmode--mobile-7581http://developer.android.com/reference/android/os/StrictMode.html - android strict mode 는 2가지 category 가 있다. 하나는 thread policy 이고 다른 하는 VM policy 이다. - Thread policy 는 다음과 같은 것들을 monitoring 한다. disk read disk write network access custom slow code - VM policy 는 다음과 같은 것들을 monitoring 한다. Leaked ac.. 2015. 6. 26.
[Effective Java] 생성자의 매개변수가 많을 때는 빌더(builder)를 고려하자. 생성자의 매개변수가 많을 때는 빌더(builder)를 고려하자. - static 팩토리 메소드와 생성자는 공통적 제약이 있다. 선택가능한 매개변수가 많아질 경우 신축성 있게 처리하지 못한다. - 텔레스코핑 생성자(telescoping constructor) 패턴이 대안이 될 수 있으나, 마찬가지로 매개변수 수가 증가하면 무척 번거로워 진다. 가독성도 떨어지고, 유지보수도 어려워진다. ( 갯수를 세고 의미를 파악하는데만도 한세월~ ) - 자바빈즈(Java Beans) 패턴이 두번째 대안이 될 수 있으나, 이 패턴은 심각한 단점을 가지고 있다. 여러 번의 메소드 호출로 나누어져 인스턴스가 완성되기 때문에 객체가 일관된 상태를 유지하지 못할 수 있다. ( multi thread 환경 ) 또한 자바빈즈는 불변 .. 2015. 2. 8.
[android] Up Navigation 설정하기. android, Up Navigation 설정하기. Up Navigation 설정하기 1. manifest 에서 parent 로 지정한다. 4.1 이상에서는 activity tag 에 android:parentActivityName 를 적용하면 된다. 4.0 이하에서는 meta-data 를 통해 설정해준다. 2. actionbar 설정을 바꿔준다.( up 을 지원하도록 ) getActionBar().setDisplayHomeAsUpEnabled(true); 3. Navigate up 하기. NavUtils.navigateUpFromSameTask() 를 통해서 할 수 있다. 이것이 불리면 현재 Activity 는 종료되면서 stack 의 상단에 있는 녀석이 호출된다. 이 때 FLAG_ACTIVITY_CL.. 2013. 12. 19.
[android] NotificationCompat and its Builder NotificationCompat.Builder.setSmallIcon( int resId ); setSmallIcon 이 지정되지 않으면 notification 은 등록이 아예 되지 않음.Small Icon 은 status bar 에 뜨는 아이콘과 notification view 안의 우측에 표시됨. 만약 large icon 이 지정되지 않으면 notification view 안에 있는 icon 도 이녀석으로 지정됨.만약 large icon 이 지정되어 있다면 content info 자리에 icon 이 같이 표시됨. NotificationCompat.Builder.setLargeIcon( Bitmap bitmap ); Notification View 안에 있는 icon 이 지정됨. Notificatio.. 2013. 11. 21.
반응형