GoogleChrome / GoogleChrome/android-browser-helper
Increase compatibility of `LauncherActivity` by extending `AppCompatActivity`
- Dominant language
- Java
- Stars
- 832
- Forks
- 370
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
**Read this First**
If you have a Trusted Web Activity related question, the best place to ask it is on StackOverflow, on the
[trusted-web-activity](https://stackoverflow.com/questions/tagged/trusted-web-activity) tag, which is also monitored by the team.
**Is your feature request related to a problem? Please describe.**
Our project has been utilizing `android-browser-helper` to launch our web app as a Trusted Web Activity (TWA) for a couple years already. We've implemented this by extending the `LauncherActivity` class and adding custom functionality. As our project has evolved, we've encountered the following challenges:
1. Increased Complexity: Our `LauncherActivity` subclass and its dependencies have grown significantly due to additional pre-launch checks and customizations.
2. Dependency Injection Incompatibility: We aim to use Hilt for dependency injection to improve our development process. However, Hilt requires activities to extend `AppCompatActivity`, while `LauncherActivity` currently extends `Activity`.
**Describe the solution you'd like**
We propose that `LauncherActivity` be modified to extend `AppCompatActivity` instead of `Activity`. This change would enable us to:
1. Utilize Hilt for dependency injection in our TWA launcher.
2. Streamline our codebase and improve maintainability.
3. Leverage modern Android development practices and tools.
**Describe alternatives you've considered**
Implementing a custom `LauncherActivity` that extends `AppCompatActivity`. This approach has significant drawbacks:
- Code duplication: We would likely need to replicate most of the existing `LauncherActivity` code.
- Maintenance burden: Our custom implementation would require ongoing updates to stay in sync with the official `LauncherActivity`.
**Additional context**
N/A
Contributor guide
Assessment
This issue has not been assessed yet.