Web | App/Android 11

[Kotlin] RecyclerView, 리스트 리소스 관리

이런 유튜브처럼, 스크롤을 내려보면 리스트가 계속 나오는 어플을 먼저 구현하라고 하셨다 리소스 관리하면서 하라고 하셔서 리소스 재사용을 할 수 있는 RecyclerView로 구현하게 되었다 RecycelrView는 이렇게 리스트가 새로 생길 때마다 추가로 view를 만드는 것이 아니라 이전에 만들어뒀던, 지금은 사용자에게 보이지 않는 뷰를 가져와서 재사용한다 1. import recyclerview // RecyclerView implementation "androidx.recyclerview:recyclerview:$version_recyclerview" // For control over item selection of both touch and mouse driven selection impleme..

Web | App/Android 2021.05.16

Android Emulator for AMD Processors failed 해결하기

Android Emulator Hypervisor Driver for AMD Processors installation failed. To install Android Emulator Hypervisor Driver for AMD Processors 라고 뜨면서 암드용 애뮬레이터 설치가 안되길래 작업관리자에서 가상화를 확인해보니까 꺼져있었다 ... # AMD 가상화 활성화하기 컴퓨터를 다시 시작하고 F2 버튼을 눌러서 BIOS에 접속 (시작할 때 F2 누르면 들어갈 수 있다고 뜬다) Advanced Mode > Advanced > SVM Mode : Enabled 로 가상화를 켜준다 저장 # 암드용 애뮬레이터 다운로드 Tools > SDK manager에서 install을 한다 바로 된다

Web | App/Android 2021.05.15

[Kotlin] 프로젝트에 모듈 추가하기

새로운 프로젝트에 다른 프로젝트를 어떻게 추가하나, 이미 빌드한 프로젝트를 어떻게 import 하는지 이렇게 먼저 File > New > Import 프로젝트 해주기 빌드된 aar 파일이 들어가고 넣으려는 모듈: player (.aar 파일) 현재 프로젝트: SampleTV 현재 프로젝트에 추가된 모듈들이 표시된다 dependency에도 추가 import com.sample.test.Function; 그러면 이제 해당 파일에 있는 함수를 가져와 사용할 수 있다 - Reference Android 라이브러리 만들기: https://developer.android.com/studio/projects/android-library?hl=ko

Web | App/Android 2021.05.15

[Kotlin] 코루틴 coroutine

Reference: wooooooak.github.io/kotlin/2019/08/25/%EC%BD%94%ED%8B%80%EB%A6%B0-%EC%BD%94%EB%A3%A8%ED%8B%B4-%EA%B0%9C%EB%85%90-%EC%9D%B5%ED%9E%88%EA%B8%B0/ 코틀린 코루틴(coroutine) 개념 익히기 · 쾌락코딩 코틀린 코루틴(coroutine) 개념 익히기 25 Aug 2019 | coroutine study 앞서 코루틴을 이해하기 위한 두 번의 발악이 있었지만, 이번에는 더 원론적인 코루틴에 대해서 알아보려 한다. 코루틴의 개념이 정확 wooooooak.github.io 정리를 너무 잘해놓으셔서 코루틴 찾다가 행복사했다 정리해주신 내용들 중에 이게 메인

Web | App/Android 2021.01.06

[Kotlin] 갑자기 Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>: 어쩌구,,

Rejecting re-init on previously-failed class java.lang.Class: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener; 갑자기 이런 오류가 떴는데 로그를 보니까 setContentView(R.layout.activity_main) 여기가 문제란다,, 아니 지난주까지 잘됐잖아,,,, 왜이래,,,,, 이제 com.android.support 의 지원이 없어지고 androidx로 간다고 하는데 이거 때문에 그런건가? 아무튼 AppCompat 에서 나는 문제는 맞다 그래서 이 부분을 수정해줘야하는데 확인한 방법은 두 가지다 1. Depend..

Web | App/Android 2020.12.14

[Kotlin] Retrofit2 + OkHttp로 API request 시작기

- Retrofit square.github.io/retrofit/ Retrofit A type-safe HTTP client for Android and Java square.github.io 안드로이드에서 사용가능한 REST Client (서버 통신을 위한 라이브러리) Retrofit은 HTTP요청에 OkHttp 라이브러리를 사용함 처음에 Asynctask를 알려주셨었는데 Asynctask는 어렵고 시간도 많이 들고 해서 안드로이드에서 deprecated 되었다고 한다 1. build.gradle(Module:) > dependencies에 Retrofit, OkHttp 추가 // Retrofit: 서버와 통신 implementation 'com.squareup.retrofit2:retrofit:2...

Web | App/Android 2020.12.06

[Kotlin] findViewById 대신 id 값이었지만 이제는 view binding

코틀린으로 개발하면서 가장 많이 봤던 글이 findViewByID를 안쓰고 그냥 id 값만으로도 사용할 수 있다! 였다 val imageView = itemView.findViewById(R.id.image_view) imageView.setImageResource(R.mipmap.ic_launcher) 이렇게 불러와서 사용했던 걸 image_view.setImageResource(R.mipmap.ic_launcher) 이렇게 바로 사용할 수 있다고 그런데 안드로이드 스튜디오 4.1 들어서면서 이 기능을 제공해줬던 plugins { id 'kotlin-android-extensions' } 이 kotilin-android-extensions을 기본으로 제공하지 않고 앞으로는 지원하지 않을 거라고 한다 이..

Web | App/Android 2020.12.05

[Kotlin] data class 여러 개 코드 컨벤션

먼가 개발을 하는데 한 파일에 클래스를 여러개 만드니까 얘만 아이콘이 이렇게 파일 형태로 바뀌고,, 확장자도 보이고,, 그래서 코틀린 코드 컨벤션을 찾아봤다 kotlinlang.org/docs/reference/coding-conventions.html#source-file-organization Coding Conventions - Kotlin Programming Language kotlinlang.org Placing multiple declarations (classes, top-level functions or properties) in the same Kotlin source file is encouraged as long as these declarations are closely relat..

Web | App/Android 2020.12.05