마스터Q&A
접속유지
가입하기
안드로이드 Q&A
최근 질문
미답변 질문
태그
사용자
질문하기
마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다.
안드로이드펍
에서 운영하고 있습니다. [
사용법
,
운영진
]
인기있는 태그
초보어플개발
(3427)
안드로이드스튜디오
(2664)
안드로이드-초보어플개발
(1333)
안드로이드-스튜디오
(1086)
도와주세요-
(995)
이미지
(970)
listview
(866)
리스트뷰
(844)
오류
(805)
레이아웃
(693)
fragment
(675)
webview
(670)
코루틴 gradle없이도 사용이 되는데 왜죠?
0
추천
현재 사용중인 gradle들인데
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.9.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("androidx.navigation:navigation-fragment-ktx:2.5.3")
implementation("androidx.navigation:navigation-ui-ktx:2.5.3")
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
implementation("com.squareup.okhttp3:okhttp:4.11.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.10.0")
implementation("com.github.bumptech.glide:glide:4.14.2")
implementation("androidx.paging:paging-runtime-ktx:3.2.0")
implementation("com.google.dagger:hilt-android:2.44")
kapt("com.google.dagger:hilt-android-compiler:2.44")
implementation("androidx.activity:activity-ktx:1.7.2")
코루틴을 사용하려면 코루틴의 gradle을 추가해줘야된다고 알고있습니다만
그래도 viewmodelscope나 launch 등 잘 썼는데 왜 되는거죠?
코루틴
coroutine
수원통학러
(
3,590
포인트)
님이
2023년 9월 17일
질문
https://developer.android.com/build/dependencies#view-dependency-tree
Please
log in
or
register
to add a comment.
답변 달기
·
글에 소스 코드 보기 좋게 넣는 법
·
질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
답변이 채택되거나 답변에 댓글이 달리면 이메일로 알려드립니다:
답변이 채택되거나 댓글이 달리면 이메일로 알려드립니다
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면
로그인
하거나 혹은
가입
하세요.
2개의 답변
+1
추천
코틀린 세팅이 되어 있으면 코루틴은 별도로 추가할 필요가 없구요, ViewLifecycleScope, ViewModelScope 등의 extension을 사용하려면 해당 라이브러리들이 추가되어야 합니다.
spark
(
230,170
포인트)
님이
2023년 9월 17일
답변
spark
님이
2023년 9월 17일
수정
fun insertReport(book: BooksModel.Response.BooksItem) {
viewModelScope.launch {
localBookReportUseCase.executeInsert(book)
}
}
이런식으로 사용하고 있는데, 저는 관련 gradle을 아예 써주지 않았는데 어떻게 된걸까요..?
https://developer.android.com/topic/libraries/architecture/coroutines
에 관련 디펜던시가 있구요, 분명 어딘가에 관련 디펜던시를 포함하고 있으니까 해당 기능이 되는 거겠죠. 자세한 것은 리피님 말씀처럼 디펜던시 그래프를 확인해 보시면 쉬울 것 같아요.
https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html
안드로이드 스튜디오에서 프로젝트 뷰모드에서 Extenal Librararies에서 포함된 디펜던시들을 확인할 수 있습니다.
또는
./gradlew app:dependencies
Please
log in
or
register
to add a comment.
+1
추천
paging3가 내부적으로 ViewModel-ktx를 사용하기 때문에 그건 것 같네요.
androidx.paging:paging-runtime-ktx:3.2.0
| +--- androidx.paging:paging-common-ktx:3.2.0
| | +--- androidx.paging:paging-common:3.2.0
| | | +--- androidx.annotation:annotation:1.3.0
| | | +--- androidx.arch.core:core-common:2.2.0 (*)
| | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.21 -> 1.9.10 (*)
| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 (*)
| | | +--- androidx.paging:paging-runtime:3.2.0 (c)
| | | +--- androidx.paging:paging-common-ktx:3.2.0 (c)
| | | \--- androidx.paging:paging-runtime-ktx:3.2.0 (c)
| | +--- androidx.paging:paging-common:3.2.0 (c)
| | +--- androidx.paging:paging-runtime:3.2.0 (c)
| | \--- androidx.paging:paging-runtime-ktx:3.2.0 (c)
| +--- androidx.paging:paging-runtime:3.2.0
| | +--- androidx.core:core-ktx:1.7.0 -> 1.9.0 (*)
| | +--- androidx.lifecycle:lifecycle-livedata-ktx:2.4.0 -> 2.6.1
| | | +--- androidx.lifecycle:lifecycle-livedata:2.6.1 (*)
| | | +--- androidx.lifecycle:lifecycle-livedata-core-ktx:2.6.1 (*)
| | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 -> 1.9.10 (*)
| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 (*)
| | | +--- androidx.lifecycle:lifecycle-common:2.6.1 (c)
| | | +--- androidx.lifecycle:lifecycle-livedata:2.6.1 (c)
| | | +--- androidx.lifecycle:lifecycle-livedata-core:2.6.1 (c)
| | | +--- androidx.lifecycle:lifecycle-livedata-core-ktx:2.6.1 (c)
| | | +--- androidx.lifecycle:lifecycle-process:2.6.1 (c)
| | | +--- androidx.lifecycle:lifecycle-runtime:2.6.1 (c)
| | | +--- androidx.lifecycle:lifecycle-runtime-ktx:2.6.1 (c)
| | | +--- androidx.lifecycle:lifecycle-viewmodel:2.6.1 (c)
| | | +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1 (c)
| | | \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1 (c)
| | +--- androidx.lifecycle:lifecycle-runtime-ktx:2.4.0 -> 2.6.1 (*)
| | +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0 -> 2.6.1 (*)
spark
(
230,170
포인트)
님이
2023년 9월 18일
답변
Please
log in
or
register
to add a comment.
...