본문 바로가기

[Android] AndroidX Paging 사용 시 내가 겪은 부분 Paging Library는 정말 편하고 잘 만들어져 있지만, 처음 사용하면서 겪게된 부분을 공유하고자 글을 쓴다. ## 간략 내용 setInitialLoadSizeHint와 setPageSize 사이즈를 제법 넉넉하게 줘라. DataSource.Factory에서 DataSource 객체를 꼭 생성해라. DataSource객체를 참조할때는 DataSource.Factory객체를 통해서만 해라. ## 내가 겪은 내용 setInitialLoadSizeHint와 setPageSize 사이즈를 제법 넉넉하게 줘라. 당연히 Paging Library는 RecyclerView와 사용할텐데, 사이즈를 너무 좁게 잡으면 PagedListAdapter에서 loadAfter를 호출 되기 전에 모든 데이터를 가져왔다고 인식.. 더보기
Firebase Analytics 사용시 Could not resolve com.google.android.gms:play-services-measurement-xxx:[17.2.0] Build 시 위와 같은 오류가 발생하고 진행이 되지 않을 시 참고 하세요. 혹시 dependency를 아래와 같이 firebase-core를 지정했는지 체크 하세요. (아닐 경우.. 아래 내용은 쓸모 없습니다.) implementation "com.google.firebase:firebase-core:17.2.0" https://firebase.google.com/support/release-notes/android#2019-09-09 Firebase Android Release Notes | Firebase To review release notes for t.. 더보기
[Android] Robolectric 사용 중인지 체크 val isRoboUnitTest: Boolean = "robolectric" == Build.FINGERPRINT 이렇게 만들어서 사용하면 된다!! 라고만 하고 싶지만.. 테스트 코드에 이건 Robolectric을 사용한다고 명시를 해줘야 한다. @RunWith(RobolectricTestRunner::class) class SomeTest { @Test fun test() { ... } } 그럼 체크가 가능해 진다. 혹시나 하나 더 참고 사항으로 아래와 같은 Socket 에러를 보시는 분... java.io.IOException: socket not created at android.net.LocalSocketImpl.bind(LocalSocketImpl.java:305) at android.net... 더보기
[번역] Android Architecture Components 사용시 5가지 일반적인 실수 출처 : https://proandroiddev.com/5-common-mistakes-when-using-architecture-components-403e9899f4cb 5 common mistakes when using Architecture Components Subtle oversights with more or less serious consequences - even if you’re not making these mistakes it should be worth keeping them in… proandroiddev.com 다소 심각한 결과를 초래하는 미묘한 실수 - 심지어 이러한 실수를 하지 않더라도 향후 어떤 문제가 발생 향후 발생할 가능성이 있기 때문에 기억할만한 가치가 있다. 글 목.. 더보기
[Android][DI] ViewModel onCleared 함수가 호출 되지 않을 때 Android Architecture Component 라이브러리에서 제공하는 ViewModel 클래스에서 onCleared라는 함수를 override 할 수 있습니다. 이 함수에서 ViewModel이 라이프사이클에서 종료가 되었을 때 호출 되어 불필요한 메모리를 초기화 시킵니다. (CompositeDisposable를 정의하여 onCleared 함수에서 clear를 시키기도 하죠.) 그런데 이상하게 ViewModel을 생성한 Activity나 Fragment를 종료 시켰는데 onCleared 함수가 호출이 되지 않을 때가 있다. 그럼 아래 두 가지를 테스트 해봐라. 1. Android Support 라이브러리 버전 확인 Android Support 라이브러리 버전이 27.1.0 이하일 경우 onClea.. 더보기
[Android] Android Architecture 공유 https://proandroiddev.com/android-architecture-d7405db1361c Android Architecture 🏗 A Journey Looking For The Perfect Design proandroiddev.com 보신 분들도 있을지 모르지만, 개인적으로 최신 기술을 잘 이용하여 잘 모듈화되어 있는 Architecture 샘플이라고 생각합니다. Koin이나 Coroutine 같은 최신 기술을 이용하였고, 요즈음 관심이 많은 Multi Module화를 시켰으며 kotlin-dsl로 빌드가 되어 있습니다. 이 샘플 소스를 하나에 최신 트렌드가 다 포함 되어 있습니다. 관심 있으신 분들은 한번 보시면 좋을 듯 합니다. 더보기
[Android] MacOS에서 갑자기 키보드가 동작을 하지 않을 때 MacOS에서 Android Studio를 사용할 때, 갑자기 키보드가 먹통이 되는 현상이 발생 되었다. 무어지??? 원인을 검색해보니 특수문자를 지원해주는 'hold down key' 기능이 MacOS에서 자동적으로 바꿔서 생기는 일이다. 이 기능을 disable 시키는 방법은 terminal을 열어서 아래와 같이 입력만 하면 된다. defaults write -g ApplePressAndHoldEnabled -bool false 참고하세요. 참고 : https://stackoverflow.com/a/53938438 Keyboard get disabled on Android Studio on Mac While coding sometimes I have to press the undo keyboard s.. 더보기
[Android] 구글 맵에서 갑자기 팅길 때 다른 폰에선 잘 되는데 특정 폰에서 구글맵이 팅기는 현상이 있으신 분은 참고 하세요. 저 같은 경우 아래와 같은 이슈가 발생 했었네요. ( 갤럭시 노트8 이었습니다.) java.lang.ClassNotFoundException: Didn't find class "org.apache.http.ProtocolVersion" on path 확인 해보니 라이브러리 버그라고 하더군요. 역시나 정보가 있더군요. https://stackoverflow.com/a/54654613 Android Google maps java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion I am using Google maps Andro.. 더보기