Android Jar 库 [英] Android Jar libraries

查看:21
本文介绍了Android Jar 库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How do you setup a project that can result in a jar library file that can be used for android? I want to create a custom library across all projects.

其他几个问题:

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

推荐答案

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

Google just release a new version of the SDK that handles Shared Libraries!

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

ADT 0.9.7(2010 年 5 月)

ADT 0.9.7 (May 2010)

库项目:
ADT 插件现在支持使用库项目在开发过程中,一种能力允许您存储共享的 Android应用程序代码和资源单独的开发项目.你可以然后引用库项目来自其他 Android 项目,在构建时间,工具编译作为一部分的共享代码和资源依赖的应用程序.更多的有关此功能的信息是在 Eclipse 中开发带有 ADT 文档.如果你不是在 Eclipse 中开发,SDK Tools r6提供等效的库通过 Ant 构建的项目支持系统.

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 库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆