{"id":44339,"date":"2020-06-27T22:57:35","date_gmt":"2020-06-27T13:57:35","guid":{"rendered":"https:\/\/www.charlezz.com\/?p=44339"},"modified":"2020-07-07T10:53:48","modified_gmt":"2020-07-07T01:53:48","slug":"hilt-5-5-core-apis-entry-points","status":"publish","type":"post","link":"https:\/\/charlezz.com\/?p=44339","title":{"rendered":"[Hilt] 5.5 Core APIs &#8211; Entry Points"},"content":{"rendered":"<p><a href=\"https:\/\/dagger.dev\/hilt\/entry-points\">https:\/\/dagger.dev\/hilt\/entry-points<\/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.5 Core APIs &#8211; Entry Points<\/h1>\n<h2>Entry point\ub780 \ubb34\uc5c7\uc778\uac00?<\/h2>\n<p>Entry point(\uc9c4\uc785\uc810)\ub294 Dagger\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc758\uc874\uc131 \uc8fc\uc785\uc744 \ud560 \uc218 \uc5c6\ub294 \ucf54\ub4dc\uc5d0\uc11c \uc81c\uacf5\ub41c Dagger \uac1d\uccb4\ub97c \uc5bb\uc744 \uc218 \uc788\ub294 \ubc29\ubc95\uc774\ub2e4. Dagger\uac00 \uad00\ub9ac \ud558\ub294 \uc624\ube0c\uc81d\ud2b8 \uadf8\ub798\ud504\uc5d0 \ucf54\ub4dc\uac00 \ucc98\uc74c \ub4e4\uc5b4\uac00\ub294 \uc9c0\uc810\uc774\ub2e4.<\/p>\n<p>\ub9cc\uc57d Dagger \ucef4\ud3ec\ub10c\ud2b8\uc5d0 \uc775\uc219\ud558\ub2e4\uba74, Entry point\ub294 Hilt\uac00 \uc0c1\uc18d\ud558\uc5ec \uc0dd\uc131\ud560 \ucef4\ud3ec\ub10c\ud2b8\uc758 \uc778\ud130\ud398\uc774\uc2a4\ub2e4.<\/p>\n<h2>Entry point\ub294 \uc5b8\uc81c \ud544\uc694\ud560\uae4c?<\/h2>\n<p>Dagger\ub97c \uc801\uc6a9\ud558\uc9c0 \uc54a\uc740 \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c \uc778\ud130\ud398\uc774\uc2f1 \ud558\uac70\ub098 Hilt\uc5d0\uc11c \uc9c0\uc6d0\ud558\uc9c0 \uc54a\ub294 \uc548\ub4dc\ub85c\uc774\ub4dc \uad6c\uc131\uc694\uc18c\uac00 Dagger \uac1d\uccb4\uc5d0 \uc811\uadfc\uc774 \ud544\uc694\ud560 \ub54c Entry point\uac00 \ud544\uc694\ud558\ub2e4.<\/p>\n<p>\uc77c\ubc18\uc801\uc73c\ub85c, \ub300\ubd80\ubd84\uc758 entry point\ub294 Activity, Fragment \uc640 \uac19\uc740 \uc548\ub4dc\ub85c\uc774\ub4dc \ud50c\ub7ab\ud3fc\uc774 \uc778\uc2a4\ud134\uc2a4\ud654 \ud558\ub294 \uacf3\uc5d0\uc11c \ud544\uc694\ud558\ub2e4. @AndroidEntryPoint\ub294 Entry point\ub4e4\uc744 \ub2e4\ub8e8\uae30 \uc704\ud574 \ud2b9\ud654\ub41c \ub3c4\uad6c\uc774\uba70 \uc548\ub4dc\ub85c\uc774\ub4dc \ud074\ub798\uc2a4\uc758 Entry point\uc5d0 \uc811\uadfc\ud560 \uc218 \uc788\ub3c4\ub85d \ud55c\ub2e4. \uc774 \uc791\uc5c5\uc740 \uc774\ubbf8 \ud574\ub2f9 \uc548\ub4dc\ub85c\uc774\ub4dc \ud074\ub798\uc2a4\ub4e4\uc5d0\uc11c\ub294 \ud2b9\ubcc4\ud788 \ub2e4\ub8e8\uace0 \uc788\uae30 \ub54c\ubb38\uc5d0, \ub2e4\uc74c \ub098\uc62c \ubb38\uc11c\uc5d0\uc11c\ub294 \ub2e4\ub978 \ud0c0\uc785\uc758 \ud074\ub798\uc2a4\uc5d0 Entry point\uac00 \ud544\uc694\ud55c \uacbd\uc6b0\ub97c \ub2e4\ub8ec\ub2e4.<\/p>\n<h2>Entry Point, \uc5b4\ub5bb\uac8c \uc0ac\uc6a9\ud558\ub098?<\/h2>\n<h3>EntryPoint \uc0dd\uc131\ud558\uae30<\/h3>\n<p>Entry point\ub97c \uc0dd\uc131\ud558\uae30 \uc704\ud574\uc11c\ub294 \uac01 \ubc14\uc778\ub529 \ud0c0\uc785\uc5d0 \ub300\ud55c \uc811\uadfc \uac00\ub2a5\ud55c \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc778\ud130\ud398\uc774\uc2a4\ub97c \uc815\uc758\ud558\uace0 @EntryPoint \uc5b4\ub178\ud14c\uc774\uc158\uc744 \ucd94\uac00\ud574\uc57c \ud55c\ub2e4. \uadf8\ub7f0 \ub2e4\uc74c @InstallIn\uc744 \ucd94\uac00\ud558\uc5ec Entry point\uac00 \uc124\uce58\ub420 \ucef4\ud3ec\ub10c\ud2b8\ub97c \uc9c0\uc815\ud55c\ub2e4.<\/p>\n<pre><code class=\"language-kotlin\">@EntryPoint\r\n@InstallIn(ApplicationComponent::class)\r\ninterface FooBarInterface {\r\n    @Foo fun getBar(): Bar\r\n}\r\n<\/code><\/pre>\n<h3>EntryPoint\uc5d0 \uc811\uadfc\ud558\uae30<\/h3>\n<p>Entry point\uc5d0 \uc811\uadfc\ud558\uae30 \uc704\ud574\uc11c\ub294 EntryPoints\ud074\ub798\uc2a4\ub97c \uc0ac\uc6a9\ud558\uc5ec \ucef4\ud3ec\ub10c\ud2b8 \uc778\uc2a4\ud134\uc2a4\ub97c \ub9e4\uac1c\ubcc0\uc218\ub85c \uc804\ub2ec\ud558\uac70\ub098 \ucef4\ud3ec\ub10c\ud2b8 \ud640\ub354 \uc5ed\ud560\uc744 \ud558\ub294 @AndroidEntryPoint \uac1d\uccb4\ub97c \uc804\ub2ec\ud55c\ub2e4. \ub9e4\uac1c\ubcc0\uc218\ub85c \uc804\ub2ec\ud558\ub294 \ucef4\ud3ec\ub10c\ud2b8\uac00 @EntryPoint \uc778\ud130\ud398\uc774\uc2a4\uc5d0 \ucd94\uac00\ub418\uc5b4 \uc788\ub294 @InstallIn \uc5b4\ub178\ud14c\uc774\uc158\uc774 \uc804\ub2ec\ud558\ub294 \ucef4\ud3ec\ub10c\ud2b8\uc640 \uc77c\uce58\ud558\ub294\uc9c0 \ud655\uc778\ud558\uc790.<\/p>\n<p>\uc55e\uc5d0\uc11c \uc815\uc758\ud55c Entry point \uc778\ud130\ud398\uc774\uc2a4\ub97c \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n<pre><code class=\"language-kotlin\">val bar = EntryPoints.get(applicationContext, FooBarInterface::class.java).getBar()\r\n<\/code><\/pre>\n<p>\ucd94\uac00\uc801\uc73c\ub85c EntryPointAccessors\uc758 \uba54\uc11c\ub4dc\ub294 \ud45c\uc900 \uc548\ub4dc\ub85c\uc774\ub4dc \ucef4\ud3ec\ub10c\ud2b8\ub85c\ubd80\ud130 Entry point\ub4e4\uc744 \uac00\uc838\uc624\ub294\uac83\uc5d0 \ub300\ud574 \ub354 \uc801\ud569\ud558\uba70 \ud0c0\uc785\uc5d0 \uc548\uc804\ud558\ub2e4.<\/p>\n<h2>\ubaa8\ubc94 \uc0ac\ub840 : Entry point \uc778\ud130\ud398\uc774\uc2a4\ub294 \uc5b4\ub514\uc5d0 \uc815\uc758\ud574\uc57c \ud560\uae4c?<\/h2>\n<p>\ub9cc\uc57d Hilt\ub97c \uc0ac\uc6a9\ud558\uc9c0 \uc54a\ub294 \ub77c\uc774\ube0c\ub7ec\ub9ac \uadf8\ub9ac\uace0 Dagger\ub85c\ubd80\ud130 Foo \ud074\ub798\uc2a4\ub97c \ud544\uc694\ub85c \ud558\ub294 \ud074\ub798\uc2a4 \uc778\uc2a4\ud134\uc2a4\ud654\ub97c \uad6c\ud604\ud574\uc57c\ud55c\ub2e4\uba74, Entry point \uc778\ud130\ud398\uc774\uc2a4\ub294 \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 \ud074\ub798\uc2a4 \ub610\ub294 Foo\uc640 \ud568\uaed8 \uc815\uc758 \ub418\uc5b4\uc57c \ud560\uae4c?<\/p>\n<p>\uc77c\ubc18\uc801\uc73c\ub85c \ud574\ub2f9 \ud074\ub798\uc2a4\uac00 Foo \uc544\ub2cc Entry point \uc778\ud130\ud398\uc774\uc2a4\ub97c \ud544\uc694\ub85c \ud55c\ub2e4\uba74, Entry point\ub97c \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 \ud074\ub798\uc2a4\uc640 \ud568\uaed8 \uc815\uc758\ub418\ub294 \uac83\uc774 \ub9de\ub2e4. \ud574\ub2f9 \ud074\ub798\uc2a4\uc5d0 \ub354 \ub9ce\uc740 \uc758\uc874\uc131\uc774 \ud544\uc694\ud558\uba74, \ucd94\uac00 \uba54\uc11c\ub4dc\ub97c Entry point \uc778\ud130\ud398\uc774\uc2a4\uc5d0 \uc27d\uac8c \ucd94\uac00\ud558\uc5ec \uac00\uc838 \uc62c \uc218 \uc788\ub2e4. \ubcf8\uc9c8\uc801\uc73c\ub85c Entry point \uc778\ud130\ud398\uc774\uc2a4\ub294 \ud574\ub2f9 \ud074\ub798\uc2a4\uc758 @Inject \uc0dd\uc131\uc790\uc758 \uc704\uce58\uc5d0\uc11c \uae30\ub2a5\uc744 \ud558\uac8c \ub41c\ub2e4. \ub300\uc2e0 Entry point\uac00 Foo\uc5d0 \uc815\uc758 \ub41c \uacbd\uc6b0 \ub2e4\ub978 \uc0ac\ub78c\ub4e4\uc774 Foo\ub97c \uc8fc\uc785\ud558\uac70\ub098 Entry point \uc778\ud130\ud398\uc774\uc2a4\ub97c \uc0ac\uc6a9\ud574\uc57c \ud558\ub294\uc9c0 \ud63c\ub3d9 \ub420 \uc218 \uc788\ub2e4. \ub610\ud55c \ub098\uc911\uc5d0 \ub2e4\ub978 \uc758\uc874\uc131\uc774 \ud544\uc694\ud55c \uacbd\uc6b0 \ub354 \ub9ce\uc740 Entry point \uc778\ud130\ud398\uc774\uc2a4\uac00 \ucd94\uac00 \ub420 \uc218 \uc788\ub2e4.<\/p>\n<h3>\ubaa8\ubc94 \uc0ac\ub840<\/h3>\n<pre><code class=\"language-kotlin\">\/\/ Dagger\uc5d0\uc11c \uc778\uc2a4\ud134\uc2a4\ud654\ub418\uc9c0 \uc54a\uae30 \ub54c\ubb38\uc5d0 @Inject\uac00 \uc5c6\ub2e4.\r\nclass MyClass : NonHiltLibraryClass() {\r\n\r\n    @EntryPoint\r\n    @InstallIn(ApplicationComponent::class)\r\n    interface MyClassInterface {\r\n        fun getFoo(): Foo\r\n\r\n        fun getBar(): Bar\r\n    }\r\n\r\n    fun doSomething(context: Context) {\r\n        val myClassInterface =\r\n            EntryPoints.get(applicationContext, MyClassInterface::class.java)\r\n        val foo = myClassInterface.getFoo()\r\n        val bar = myClassInterface.getBar()\r\n    }\r\n}\r\n<\/code><\/pre>\n<h3>\uc548 \uc88b\uc740 \uc0ac\ub840<\/h3>\n<pre class=\"\"><code class=\"language-kotlin\">@Module\r\n@InstallIn(ApplicationComponent::class)\r\nobject FooModule {\r\n    @Provides\r\n    fun provideFoo(): Foo {\r\n      return Foo()\r\n    }\r\n\r\n    @EntryPoint\r\n    @InstallIn(ApplicationComponent::class)\r\n    interface FooInterface {\r\n      fun getFoo(): Foo\r\n    }\r\n}\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/dagger.dev\/hilt\/entry-points 5.5 Core APIs &#8211; Entry Points Entry point\ub780 \ubb34\uc5c7\uc778\uac00? Entry point(\uc9c4\uc785\uc810)\ub294 Dagger\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc758\uc874\uc131 \uc8fc\uc785\uc744 \ud560 \uc218 \uc5c6\ub294 \ucf54\ub4dc\uc5d0\uc11c \uc81c\uacf5\ub41c Dagger \uac1d\uccb4\ub97c \uc5bb\uc744 \uc218 \uc788\ub294 \ubc29\ubc95\uc774\ub2e4. Dagger\uac00 \uad00\ub9ac \ud558\ub294 \uc624\ube0c\uc81d\ud2b8 \uadf8\ub798\ud504\uc5d0 \ucf54\ub4dc\uac00 \ucc98\uc74c \ub4e4\uc5b4\uac00\ub294 \uc9c0\uc810\uc774\ub2e4. \ub9cc\uc57d Dagger \ucef4\ud3ec\ub10c\ud2b8\uc5d0 \uc775\uc219\ud558\ub2e4\uba74, Entry point\ub294 Hilt\uac00 \uc0c1\uc18d\ud558\uc5ec \uc0dd\uc131\ud560 \ucef4\ud3ec\ub10c\ud2b8\uc758 \uc778\ud130\ud398\uc774\uc2a4\ub2e4. Entry point\ub294 \uc5b8\uc81c [&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\/44339"}],"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=44339"}],"version-history":[{"count":3,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/44339\/revisions"}],"predecessor-version":[{"id":44389,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/44339\/revisions\/44389"}],"wp:attachment":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=44339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=44339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=44339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}