Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase compatibility of LauncherActivity by extending AppCompatActivity #483

Open
mbarrben opened this issue Oct 22, 2024 · 0 comments
Open

Comments

@mbarrben
Copy link

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 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant