Skip to content

Commit

Permalink
Update the dagger.android docs.
Browse files Browse the repository at this point in the history
This CL updates the docs to add a warning that `dagger.android` is in "maintenance mode" and to link to Hilt now that it's available.

RELNOTES=N/A
PiperOrigin-RevId: 598890324
  • Loading branch information
bcorso authored and Dagger Team committed Jan 16, 2024
1 parent 242f36d commit 82d6630
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
18 changes: 9 additions & 9 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ nav:
name: Dagger
url: /dev-guide
sidenav:
- item:
name: Android
url: /android
- item:
name: Multibindings
url: /multibindings
Expand All @@ -69,12 +66,6 @@ nav:
- item:
name: Resources
url: /resources
- item:
name: Dagger 1 Migration
url: /dagger-1-migration
- item:
name: gRPC
url: /grpc
- item:
name: Versions
url: /versions
Expand All @@ -84,6 +75,15 @@ nav:
- item:
name: FAQ
url: /faq
- item:
name: Dagger 1 Migration
url: /dagger-1-migration
- item:
name: gRPC
url: /grpc
- item:
name: dagger.android
url: /android
- item:
name: Hilt
url: /hilt
Expand Down
22 changes: 11 additions & 11 deletions dev-guide/android.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
---
layout: default
title: Dagger & Android
title: dagger.android
redirect_from:
- /android
---

**Warning**: `dagger.android` is in **maintenance mode** and is no longer under
active development. This means that while we will still try to prioritize bugs,
`dagger.android` will not receive any new features. Instead, see
[Hilt](../hilt), Dagger's newly recommended approach to using Dagger on Android.
{: .c-callouts__warning}

## Philosophy

One of the primary advantages of Dagger 2 over most other dependency injection
frameworks is that its strictly generated implementation (no reflection) means
that it can be used in Android applications. However, there _are_ still some
considerations to be made when using Dagger within Android applications.

## Philosophy

While code written for Android is Java source, it is often quite different in
terms of style. Typically, such differences exist to accomodate the unique
terms of style. Typically, such differences exist to accommodate the unique
[performance][android-performance] considerations of a mobile platform.

But many of the patterns commonly applied to code intended for Android are
Expand Down Expand Up @@ -73,7 +79,7 @@ This has a few problems:
dependency injection: a class shouldn't know anything about how it is
injected.

## `dagger.android`
## Using `dagger.android`

The classes in [`dagger.android`] offer one approach to simplify the above
problems. This requires learning some extra APIs and concepts but gives you
Expand All @@ -86,12 +92,6 @@ the one
This may be simpler to understand but comes with the downside of having to write
extra boilerplate manually.

The Jetpack and Dagger teams are working together on a
[new initiative](https://medium.com/androiddevelopers/dependency-injection-guidance-on-android-ads-2019-b0b56d774bc2)
for Dagger on Android that hopes to be a large shift from the current status
quo. While it is unfortunately not ready yet, this may be something to consider
when choosing how to use Dagger in your Android projects today.

### Injecting `Activity` objects

1. Install [`AndroidInjectionModule`] in your application component to ensure
Expand Down

0 comments on commit 82d6630

Please sign in to comment.