{"id":99,"date":"2025-10-01T19:08:55","date_gmt":"2025-10-01T10:08:55","guid":{"rendered":"https:\/\/devserver.kr\/blog\/?p=99"},"modified":"2025-10-01T19:08:55","modified_gmt":"2025-10-01T10:08:55","slug":"%ec%95%88%eb%93%9c%eb%a1%9c%ec%9d%b4%eb%93%9c-viewmodel-gradle-%ec%84%a4%ec%a0%95","status":"publish","type":"post","link":"https:\/\/devserver.kr\/blog\/android\/%ec%95%88%eb%93%9c%eb%a1%9c%ec%9d%b4%eb%93%9c-viewmodel-gradle-%ec%84%a4%ec%a0%95\/","title":{"rendered":"\uc548\ub4dc\ub85c\uc774\ub4dc ViewModel gradle \uc124\uc815"},"content":{"rendered":"\n<div class=\"wp-block-jetpack-markdown\"><h3>ViewModel<\/h3>\n<p>app gradle \uc5d0 \uc885\uc18d\ud56d\ubaa9 \uc120\uc5b8\ud574\uc90c\nhttps:\/\/developer.android.com\/jetpack\/androidx\/releases\/lifecycle?hl=ko#declaring_dependencies<\/p>\n<pre><code class=\"language-gradle\">dependencies {\n        val lifecycle_version = &quot;2.4.0-alpha02&quot;\n        val arch_version = &quot;2.1.0&quot;\n\n        \/\/ ViewModel\n        implementation(&quot;androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version&quot;)\n        \/\/ LiveData\n        implementation(&quot;androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version&quot;)\n        \/\/ Lifecycles only (without ViewModel or LiveData)\n        implementation(&quot;androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version&quot;)\n\n        \/\/ Saved state module for ViewModel\n        implementation(&quot;androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version&quot;)\n\n        \/\/ Annotation processor\n        kapt(&quot;androidx.lifecycle:lifecycle-compiler:$lifecycle_version&quot;)\n        \/\/ alternately - if using Java8, use the following instead of lifecycle-compiler\n        implementation(&quot;androidx.lifecycle:lifecycle-common-java8:$lifecycle_version&quot;)\n\n        \/\/ optional - helpers for implementing LifecycleOwner in a Service\n        implementation(&quot;androidx.lifecycle:lifecycle-service:$lifecycle_version&quot;)\n\n        \/\/ optional - ProcessLifecycleOwner provides a lifecycle for the whole application process\n        implementation(&quot;androidx.lifecycle:lifecycle-process:$lifecycle_version&quot;)\n        \/\/ optional - ReactiveStreams support for LiveData\n        implementation(&quot;androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycle_version&quot;)\n\n        \/\/ optional - Test helpers for LiveData\n        testImplementation(&quot;androidx.arch.core:core-testing:$arch_version&quot;)\n    }\n<\/code><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-android"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":1,"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"predecessor-version":[{"id":100,"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/posts\/99\/revisions\/100"}],"wp:attachment":[{"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devserver.kr\/blog\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}