Skip to content

Getting Started Path and Streamlined Flow for Android + Java #7883

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

Closed
GregoryComer opened this issue Jan 23, 2025 · 3 comments
Closed

Getting Started Path and Streamlined Flow for Android + Java #7883

GregoryComer opened this issue Jan 23, 2025 · 3 comments
Assignees
Labels
module: android Issues related to Android code, build, and execution module: user experience Issues related to reducing friction for users triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Milestone

Comments

@GregoryComer
Copy link
Member

GregoryComer commented Jan 23, 2025

🚀 The feature, motivation and pitch

Many, if not most, Android developers will want to interface with ExecuTorch through Java, rather than C++ code. We see this semi-frequently with issues reported against the framework. For users not already familiar with C++ or not doing Android native development, integrating ET via C++ can be a sizable barrier to adoption.

We have support for Java and Android-specific bindings, as well as pre-built .aar binaries for Android users, however these may not be discoverable for new users, and I also believe we can continue to invest in this area to make consuming ET via Android/Java a first-class feature.

Specifically, I'd envision the following:

  1. Android developers have a dedicated, Java-first getting started experience and documentation flow. It will convey all the information a user needs to integrate ET into an existing Java or Kotlin Android app. They won't need to read any C++ focused documentation to integrate the framework for standard use cases.
  2. Android developers don't need to clone the repository or build from source for common use cases. They should be able to use standard package management through Maven/Gradle to acquire the library, and can use pip to install the Python components.
  3. The Java API surface has parity with native, to the extent possible.

To accomplish this, I'd propose the following:

  1. Create a dedicated, top-level getting started path for Android development in the ExecuTorch docs. The entry point will be a "Getting Started with ExecuTorch on Android" under the top-level "Getting Started" section. Amend other top-level getting introduction / started documentation to guide Android developers to this page.
    a) All code snippets that the user needs to integrate with the framework should be representable in-line in the Getting Started page.
    b) The focus should be on integrating ET into an existing Android app. Our demo apps are good as a supplemental reference, but not necessarily the best way to introduce the framework or help users get started.
  2. Document the Java API surface.
  3. Publish prebuilt Android binaries to the Maven Central Repository, such that users can add the library to their app using standard Maven/Gradle tooling.
  4. Update the ExecuTorch README to explicitly mention Android support and Java language bindings.
  5. Continue to invest in the Java bindings to achieve parity with native, to the extent possible. That includes exposing result values and error handling, log routing, profiling, and any other features users may require for common use cases.
  6. Create a script or path for users to easily re-build the ET Android binaries from source, in a manner that is drop-in with pre-builts. It should be easy to start with pre-builts, and then drop-in a from-source build if the user needs to change backends, log level, profiling, etc.

This should have the effect of making the framework much easier to adopt for Android developers, which make up a sizable portion of our users.

Alternatives

No response

Additional context

No response

RFC (Optional)

No response

cc @kirklandsign @mergennachin @byjlw

@GregoryComer GregoryComer added the module: user experience Issues related to reducing friction for users label Jan 23, 2025
@github-project-automation github-project-automation bot moved this to To triage in ExecuTorch DevX Jan 23, 2025
@GregoryComer GregoryComer self-assigned this Jan 23, 2025
@GregoryComer GregoryComer added the module: android Issues related to Android code, build, and execution label Jan 23, 2025
@mergennachin
Copy link
Contributor

Java bindings for Module.h and Tensor.h are good starters

@mergennachin
Copy link
Contributor

@GregoryComer - can you also point specific issues developers face? And also can you lay the current state of documentations and how the user journey looks like for Android developers?

@mergennachin mergennachin moved this from To triage to Ready in ExecuTorch DevX Jan 23, 2025
@orionr
Copy link
Contributor

orionr commented Jan 30, 2025

Is this the equivalent of @mergennachin 's work for iOS at #7903 by any chance? Just checking

@digantdesai digantdesai added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Feb 4, 2025
@mergennachin mergennachin added this to the 0.6.0 milestone Feb 6, 2025
@mergennachin mergennachin moved this from Ready to Done in ExecuTorch DevX Mar 27, 2025
@mergennachin mergennachin closed this as completed by moving to Done in ExecuTorch DevX Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: android Issues related to Android code, build, and execution module: user experience Issues related to reducing friction for users triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Status: Done
Development

No branches or pull requests

4 participants