프로그래밍/Android 131

[안드로이드] Kotlin Flow를 이용한 순간검색 (Instant Search)을 구현해보자

내가 만든 앱에서 순간검색을 지원하고 싶었던 순간이 많았는데...원래 되는대로 검색 요청 날리다가 이번에 새로운 방법을 알게되서 적어본다.Kotlin에서 Flow가 뭘까...공부하다가 나온 예제에서 발견했다.완성하면 이렇게된다. 전체 프로젝트 Githubhttps://github.com/lx5475/Kotlin-Flow-Instant-Search 간단하게 치킨집 목록을 검색하는 걸로 시작해보도록하겠다. 12345678910111213dependencies { // RecyclerView implementation "androidx.recyclerview:recyclerview:1.1.0" // ViewModel def lifecycle_version = "2.2.0" implementation "andr..

64bit 안드로이드에서 32bit 라이브러리를 불러오지 못 할 때

갤럭시 S10 5G를 사용중인데 평소엔 잘되던 라이브러리가 제대로 작동하지 않았다. ㅠㅠㅠ오류 메세지도 매우 애매하게 떠서 검색하기 어려웠는데 어쨌든 해결되었다. 관련 오류 메세지들은 이런식이다...UnsatisfiedLinkError: dlopen failed "librealm-jni.so" is 32-bit instead of 64-bitjava.lang.UnsatisfiedLinkError: ... nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libcalculate.so" 어쨋든 해결을 위해서는 1. gradle.properties 에 android.useDeprecatedNdk=true 한 줄을 추가한다. 2. app/..

[안드로이드] 2020년 Path에서 Uri 얻기

File Path에서 Uri를 얻고싶을때 아래 메소드를 활용하면 된다. 12345678910111213 private Uri getUriFromPath(String filePath) { long photoId; Uri photoUri = MediaStore.Images.Media.getContentUri("external"); String[] projection = {MediaStore.Images.ImageColumns._ID}; Cursor cursor = getContentResolver().query(photoUri, projection, MediaStore.Images.ImageColumns.DATA + " LIKE ?", new String[] { filePath }, null); cursor..