{"id":44329,"date":"2020-06-27T09:25:16","date_gmt":"2020-06-27T00:25:16","guid":{"rendered":"https:\/\/www.charlezz.com\/?p=44329"},"modified":"2020-06-27T09:32:51","modified_gmt":"2020-06-27T00:32:51","slug":"hilt-5-1-core-apis-%ec%bb%b4%ed%8f%ac%eb%84%8c%ed%8a%b8-2","status":"publish","type":"post","link":"https:\/\/charlezz.com\/?p=44329","title":{"rendered":"[Hilt] 5.2 Core APIs \u2013 Hilt Application"},"content":{"rendered":"<p><a href=\"https:\/\/dagger.dev\/hilt\/application\">https:\/\/dagger.dev\/hilt\/application<\/a><\/p>\n<hr \/>\n<p><a href=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2020\/06\/1078edcee19384aeeaa25f053a09c82c.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.charlezz.com\/wordpress\/wp-content\/uploads\/2020\/06\/1078edcee19384aeeaa25f053a09c82c-236x300.png\" alt=\"\" width=\"236\" height=\"300\" class=\"aligncenter size-medium wp-image-44317\" srcset=\"https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2020\/06\/1078edcee19384aeeaa25f053a09c82c-236x300.png 236w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2020\/06\/1078edcee19384aeeaa25f053a09c82c-768x975.png 768w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2020\/06\/1078edcee19384aeeaa25f053a09c82c-807x1024.png 807w, https:\/\/charlezz.com\/wordpress\/wp-content\/uploads\/2020\/06\/1078edcee19384aeeaa25f053a09c82c.png 1145w\" sizes=\"(max-width: 236px) 100vw, 236px\" \/><\/a><\/p>\n<h1>5.2 Core APIs &#8211; Hilt Application<\/h1>\n<p>Gradle \ud50c\ub7ec\uadf8\uc778\uc744 \uc0ac\uc6a9\ud558\ub294 \uac83\uc744 \uac00\uc815\ud558\uace0 \uc124\uba85\ud558\uace0 \uc788\ub2e4. \ub9cc\uc57d \ud50c\ub7ec\uadf8\uc778\uc744 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\ub294\ub2e4\uba74 Gradle \uc124\uc815\ud558\uae30 \uc139\uc158\uc744 \ucc38\uc870\ud558\uc790.<\/p>\n<h2>Hilt Application<\/h2>\n<p>Hilt\ub97c \uc0ac\uc6a9\ud558\ub294 \ubaa8\ub4e0 \uc571\uc740 @HiltAndroidApp\uc774 \ub2ec\ub9b0 Application \ud074\ub798\uc2a4\ub97c \ud3ec\ud568\ud574\uc57c \ud55c\ub2e4. @HiltAndroidApp\uc740 Hilt \ucef4\ud3ec\ub10c\ud2b8\uc758 \ucf54\ub4dc \uc0dd\uc131\uacfc \ucef4\ud3ec\ub10c\ud2b8\ub97c \uc0ac\uc6a9\ud558\ub294 Application\uc758 \uae30\ubcf8 \ud074\ub798\uc2a4\ub97c \uc0dd\uc131\ud558\uac8c \ub41c\ub2e4. \ucf54\ub4dc \uc0dd\uc131\uc5d0\ub294 \ubaa8\ub4e0 \ubaa8\ub4c8\uc5d0 \ub300\ud55c \uc561\uc138\uc2a4 \uad8c\ud55c\uc774 \ud544\uc694\ud558\ubbc0\ub85c Application \ud074\ub798\uc2a4\ub97c \ucef4\ud30c\uc77c\ud558\ub294 \ub300\uc0c1\uc5d0\ub294 \uc804\uc774 \uc758\uc874\uc131\uc5d0 \ubaa8\ub4e0 Dagger \ubaa8\ub4c8\uc774 \uc788\uc5b4\uc57c \ud55c\ub2e4.<\/p>\n<p>@AndroidEntryPoint\uac00 \ub2ec\ub9b0 \ub2e4\ub978 \uc548\ub4dc\ub85c\uc774\ub4dc \ud504\ub808\uc784\uc6cc\ud06c \ud074\ub798\uc2a4\uc640 \ub9c8\ucc2c\uac00\uc9c0\ub85c Application\uc5d0\ub3c4 \uba64\ubc84 \uc8fc\uc785\uc774 \ub41c\ub2e4. \uc774\ub294 super.onCreate()\uac00 \ud638\ucd9c \ub41c \ud6c4 Application\uc758 \ud544\ub4dc\uc5d0 \uc758\uc874\uc131 \uc8fc\uc785\uc774 \uc774\ub8e8\uc5b4\uc9c0\ub294 \uac83\uc744 \uc758\ubbf8 \ud55c\ub2e4.<\/p>\n<p>\uc608\ub97c \ub4e4\uc5b4 \uc77c\ubc18\uc801\uc778 Dagger \uc0ac\uc6a9\uc2dc MyApplication\uc774 MyBaseApplication\uc744 \uc0c1\uc18d\ud558\ub294 \uad6c\uc870\uc774\uba74\uc11c \uba64\ubc84 \ubcc0\uc218\ub85c Bar\ub97c \uac00\uc9c0\uace0 \uc788\ub2e4\uace0 \uac00\uc815\ud574\ubcf4\uc790.<\/p>\n<pre><code class=\"language-kotlin\">class MyApplication : MyBaseApplication() {\r\n    @Inject lateinit var bar: Baroverride fun onCreate() {\r\n        super.onCreate()\r\n\r\n        val myComponent =\r\n            DaggerMyComponent.builder()\r\n                ...\r\n                .build()\r\n\r\n        myComponent.inject(this)\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>\uc55e\uc5d0\uc11c \uc0b4\ud3b4\ubcf8 \ucf54\ub4dc\ub294 Hilt\ub97c \uc0ac\uc6a9\ud558\uba74 \ub2e4\uc74c\uacfc \uac19\uc774 \uba64\ubc84 \uc8fc\uc785\uc774 \ub41c\ub2e4.<\/p>\n<pre class=\"\"><code class=\"language-kotlin\">@HiltAndroidApp\r\nclass MyApplication : MyBaseApplication() {\r\n    @Inject lateinit var bar: Bar\r\n    override fun onCreate() {\r\n        super.onCreate() \/\/ super.onCreate()\uc5d0\uc11c \uc758\uc874\uc131 \uc8fc\uc785\uc744 \ud558\uac8c \ub41c\ub2e4.\r\n        \/\/ \uc5ec\uae30\uc5d0\uc11c bar \ubcc0\uc218\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.\r\n    }\r\n}\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/dagger.dev\/hilt\/application 5.2 Core APIs &#8211; Hilt Application Gradle \ud50c\ub7ec\uadf8\uc778\uc744 \uc0ac\uc6a9\ud558\ub294 \uac83\uc744 \uac00\uc815\ud558\uace0 \uc124\uba85\ud558\uace0 \uc788\ub2e4. \ub9cc\uc57d \ud50c\ub7ec\uadf8\uc778\uc744 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\ub294\ub2e4\uba74 Gradle \uc124\uc815\ud558\uae30 \uc139\uc158\uc744 \ucc38\uc870\ud558\uc790. Hilt Application Hilt\ub97c \uc0ac\uc6a9\ud558\ub294 \ubaa8\ub4e0 \uc571\uc740 @HiltAndroidApp\uc774 \ub2ec\ub9b0 Application \ud074\ub798\uc2a4\ub97c \ud3ec\ud568\ud574\uc57c \ud55c\ub2e4. @HiltAndroidApp\uc740 Hilt \ucef4\ud3ec\ub10c\ud2b8\uc758 \ucf54\ub4dc \uc0dd\uc131\uacfc \ucef4\ud3ec\ub10c\ud2b8\ub97c \uc0ac\uc6a9\ud558\ub294 Application\uc758 \uae30\ubcf8 \ud074\ub798\uc2a4\ub97c \uc0dd\uc131\ud558\uac8c \ub41c\ub2e4. \ucf54\ub4dc \uc0dd\uc131\uc5d0\ub294 \ubaa8\ub4e0 \ubaa8\ub4c8\uc5d0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[28],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/44329"}],"collection":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=44329"}],"version-history":[{"count":3,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/44329\/revisions"}],"predecessor-version":[{"id":44333,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/44329\/revisions\/44333"}],"wp:attachment":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=44329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=44329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=44329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}