且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我们可以用一个库项目作为一个jar文件?

更新时间:2023-09-29 08:14:52

您不能将库项目导出到一个JAR文件即可。为了确保你的项目codeS可以使用的ProGuard

You cannot export a library project to a JAR file. To secure you project codes you can use ProGuard.

为了使您的项目中的ProGuard,编辑project.properties文件

您可以配置您 project.properties 文件

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt

# Project target.
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt //configuring proguard
target=Google Inc.:Google APIs:16 //target api in my case api 16
android.library.reference.1=../actionbarsherlock //indicating you are refering library

其中的细节在以下链接avaialbe

Details of which is avaialbe in the below link

http://developer.android.com/tool​​s/help/proguard.html

请您的项目库项目,你可以参考它在其他的Andr​​oid项目。

Make your project a library project and you can refer it in another android project.

库项目

这些项目包含可共享的Andr​​oid的来源$ C ​​$ C 资源,你可以在Android的项目引用。当你有要重用公共code这是非常有用的。 库项目不能被安装到一个设备,但是,他们被拉入在构建时.apk文件。

These projects contain shareable Android source code and resources that you can reference in Android projects. This is useful when you have common code that you want to reuse. Library projects cannot be installed onto a device, however, they are pulled into the .apk file at build time.

有关详细信息,有主题下看看链接库项目。

For more information have a look at the link under the topic Library Projects.

http://developer.android.com/tool​​s/projects/index.html

您库项目将有打勾,如下图所示的复选框。

Your library project will have a check box ticked as shown below.

我们可以用一个库项目作为一个jar文件?

您可以到您的Andr​​oid项目添加库项目。右键单击您的项目。转到属性。选择左侧面板上的Andr​​oid。单击添加然后浏览和库项目添加到您的Andr​​oid项目。你可以看到下面一个绿色的勾指示库项目被添加。

You can add library project to your android project. Right click on your project. Goto properties. Choose Android on the left panel. Click add then browse and add the library project to your android project. You can see below a green tick indicating the library project is added.

我们可以用一个库项目作为一个jar文件?