创建分发一个Android瓶库 [英] Create an Android Jar library for distribution

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

问题描述

我知道的Andr​​oid库项目,它允许您创建一个可以根据需要拉进Android应用程序共享源项目。然而,这要求源是可用的。

I know of Android Library projects, which allow you to create a shared-source project that can be pulled into Android Applications as needed. However, that requires that source be available.

我在寻找一种方式来构建和分发可以用在其他Android项目,如传统的JAR一个封闭源代码库。这将需要在Android编译器的使用,所以它不是一个香草Java的JAR文件。 FWIW,我并不需要嵌入的资源/布局在JAR。

I'm looking for a way to build and distribute a closed-source library that can be used in other Android projects like a traditional JAR. This will require usage of the Android compiler, so it's not a vanilla-Java JAR file. FWIW, I do not need to embed resources/layouts in the JAR.

我见过 http://andparcel.com/ 但感觉像一个解决办法,我宁愿用一些官方支持由谷歌。另外,我需要确保该JAR我打造的是与Android SDK的新/旧版本兼容(即我需要一种方法来设定目标平台的版本,等等)。

I've seen http://andparcel.com/ but it feels like a workaround, and I would rather use something 'officially supported' by Google. Also, I need to make sure that the JAR I build is compatible with old/new version of the Android SDK (i.e. I need a way to set the target platform version, etc).

做了最新的Andr​​oid工具包允许JAR二进制文件的创建/消费?你能指出一些文件,我怎么能做到这一点?

Do the latest Android toolsets allow for the creation/consumption of JAR binaries? Can you point to some documentation on how I can do it?

推荐答案

如果您创建的Andr​​oid库项目,而无需任何资源,在ADT(在R16首次发现)将创建一个同名的.jar为项目在'bin文件夹。

If you create a Android Library project without having any resources, the ADT (first noticed in r16) will create a .jar with the same name as the project in the 'bin' folder.

这篇关于创建分发一个Android瓶库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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