如何为 Android 发送库

发布于 2024-10-02 09:47:23 字数 82 浏览 0 评论 0原文

我想为 Android 开发一个库。我可以以什么形式运送? jar、apk 还是其他?我应该如何做才能让其他开发人员可以在他们的应用程序中使用我的库?

I want to develop a library for Android. In what form can I ship it? jar, apk or something else? How should I do it so that other developers can use my library in their application?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

终遇你 2024-10-09 09:47:23

如果您的库是纯 Java 代码,则 JAR 就可以,也许可以压缩文档等。

如果您需要资源或其他特定于 Android 的非 Java 内容,您应该考虑使用 Android 库项目。最好以源代码形式提供,尽管有一些技巧可以将其打包为(大部分)二进制形式。正在开发的新的基于 Gradle 的构建系统应该可以更轻松地创建以二进制(非源)形式发布的库项目。

If your library is pure Java code, a JAR is fine, perhaps ZIPped with documentation, etc.

If you need resources or other Android-specific non-Java stuff, you should look at using an Android library project. That is best shipped as source code, though there are tricks for packaging it up in (mostly) binary form. And the new Gradle-based build system under development should make it easier to create library projects that ship in binary (non-source) form.

春风十里 2024-10-09 09:47:23

作为一个普通的罐子。您的库类将与具体应用程序一起转换为 Dalvik VM 字节码。

As a regular jar. Your library classes will be converted to the Dalvik VM bytecode along with a concrete application.

但可醉心 2024-10-09 09:47:23

我只是将您的代码放在 链接文本 上,并允许用户下载代码或从那里分叉它。我在 GitHub 上看到了不少 Android 库。

I would just toss your code up on link text and allow users to download the code or fork it from there. I've seen quite a few Android libraries on GitHub.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文