什么检查"为图书馆和QUOT;复选框做"在封面"?复选框、封面、图书馆、QUOT

2023-09-07 15:57:52 作者:forever°为你锁心

我注意到,当我转换现有的Andr​​oid应用程序项目在Android库项目by选中是库复选框,没有在项目的源$ C ​​$ C或XML文件的变化。

那么,什么时候,是库复选框被选中真的会发生什么?内部有什么变化,在包装和/或项目文件?我在哪里可以了解更多关于此?

为了更好地解释我的问题:

我有什么兴趣知道(主要是为了排除故障)是什么区别应用程序包从库包的掩护下?的事实是,一个项目图书馆项目的标记地方?如果是这样,它在哪里将其标记(显然不是在源文件,而不是连在res的XML文件)解决方案

从Managing从命令行页面项目:

  

在创建LIB项目命令创建  标准项目结构  包括preset的属性,  表示要构建系统的  项目是一个图书馆。它通过  加入这行来项目的  default.properties文件:

    

android.library = TRUE

在换句话说,它是由生成系统而不是由操作系统使用的属性

更新:我在我的iPhone,所以我不会打出来的整体意译,但这里有一个pretty好的博客文章讨论了一个Java JAR和一个Android库项目,包括如何在DEX工具之间的差异资源和D​​EX code添加到.apk文件:

http://devmaze.word$p$pss.com/2011/05/22/android-application-android-libraries-and-jar-libraries/

I noticed that when I convert an existing Android Application project to an Android Library project by checking the "is Library" checkbox, nothing changes in the project's source code or XML files.

1017次,216册 图书馆数据 达人大揭秘,还不来戳

So what really happens when the "is Library" checkbox is checked? What changes internally, in the package and/or project files? Where can I learn more about this?

To better explain my question:

What I am interested to know (mainly for troubleshooting purposes) is what differentiates an Application package from a Library package "under the cover"? Is the fact that a project is "Library Project" marked somewhere? If so, where does it mark it (obviously not in the source files and not even in the res XML files)

解决方案

From the Managing Projects from the Command Line page:

The create lib-project command creates a standard project structure that includes preset property that indicates to the build system that the project is a library. It does this by adding this line to the project's default.properties file:

android.library=true

In other words, it's a property that is utilized by the build system and not by the operating system.

UPDATE: I'm on my iPhone so I won't type out a whole paraphrase, but here's a pretty good blog article discussing the differences between a Java JAR and an Android Library Project, including how the dex tools add the resources and dex code to the .apk:

http://devmaze.wordpress.com/2011/05/22/android-application-android-libraries-and-jar-libraries/