24.08.08
출처
프로젝트에 README.md파일 생성
Android Stduio 상단에서 Help -> Find Action
Choose Boot Java Runtime for the IDE
검색
JetBrains Runtime을 JCEF로 변경한다.
설치 완료 후 Android Studio를 재시작하면 Preview가 보인다.
class GalleryFragment : Fragment() {
private var _binding: FragmentGalleryBinding? = null
private val binding get() = _binding!!
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View {
_binding = FragmentGalleryBinding.inflate(inflater, container, false)
return binding.root
}
override fun onDestroyView() {
_binding = null
super.onDestroyView()
}
}
remote를 위한 기본설정 (dependencies, permission)
libs.versions.toml
okhttp = "4.10.0"
retrofit = "2.9.0"
gson = "2.10.1"
[libraries]
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
[bundles]
retrofit = [
"retrofit",
"converter-gson",
"okhttp",
"logging-interceptor"
]
build.gradle.kts(Module :app) dependencies
implementation(libs.bundles.retrofit)
implementation(libs.gson)
manifasts.xml
<uses-permission android:name="android.permission.INTERNET" />