0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Androidアプリ作りで躓いたり悩んだりしたところメモ

0
Posted at

あまり内容を突き詰めていないので、ご指摘あればお願いします。

Hilt関係

Injectされる側の設定

class XxxModel @Inject constructor()  {

@Injectと空のconstructorを設定すると管理してくれるらしい。

Springの@Componentの代わりが@Injectと解釈をしつつ、空のconstructorまではテンプレで書くことになる。

gradle

Hilt

compilerだけで3つも出てくるがhilt-android-compilerを利用することになる。

  • com.google.dagger:hilt-compiler
    jvm等向けで基本使わない。参考にしたサイトでたまたまかこっちを使っていたのでbuild失敗に悩みましたが一番下の利用が標準
  • androidx.hilt:hilt-compiler
    WorkManagerなどを利用する際にはこちらも併用らしい、
  • com.google.dagger:hilt-android-compiler
    AndroidアプリにHiltを導入するにあたりはこれ
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?