Android Jar 库

标签 android jar

您如何设置一个可以生成可用于 android 的 jar 库文件的项目? 我想为所有项目创建一个自定义库。

其他几个问题:

  1. 是否需要针对特定​​版本的 android sdk 进行编译?
  2. 当针对 jar 库编译 android 包时,是否将处理代码所需的类与主代码一起编译到 apk 中,还是包含整个 jar?
  3. 关于使用 jar 而不是直接集成代码,我需要了解哪些值得注意的优化或缺陷?
  4. jar 是否必须像 apk 那样签名?

最佳答案

Google 刚刚发布了处理共享库的 SDK 的新版本!

https://developer.android.com/tools/projects/projects-eclipse.html#SettingUpLibraryProject

ADT 0.9.7(2010 年 5 月)

Library projects:
The ADT Plugin now supports the use of library projects during development, a capability that lets you store shared Android application code and resources in a separate development project. You can then reference the library project from other Android projects and, at build time, the tools compile the shared code and resources as part of the dependent applications. More information about this feature is available in the Developing in Eclipse with ADT document. If you are not developing in Eclipse, SDK Tools r6 provides the equivalent library project support through the Ant build system.

关于Android Jar 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1983617/

相关文章:

Android、IOS强制压屏

java - 带有外部 JAR 的 Spring Boot 获取 NoClassDefFoundError

java - 如何获取.jar 中的资源?

java - 从使用 jdbc 的 java 项目创建 jar

android - 如何替换 xml 项目的可绘制源

android - google places api 被弃用后如何使用地点选择器

java - 使用外部.jar在命令行中编译java程序

java - 关闭 Jar 文件后恢复数据

java - 概念之间的区别

java - 无法从静态上下文引用非静态方法 getAssets (Java)(Android)