什么检查"为图书馆和QUOT;复选框做"在封面"? [英] What does checking the "is Library" checkbox do "Under the Cover"?

查看:127
本文介绍了什么检查"为图书馆和QUOT;复选框做"在封面"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,当我转换现有的Andr​​oid应用程序项目在Android库项目<一个href=\"http://developer.android.com/guide/developing/projects/projects-eclipse.html#SettingUpLibraryProject\">by选中是库复选框,没有在项目的源$ C ​​$ C或XML文件的变化。

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

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


  1. 我有什么兴趣知道(主要是
    为了排除故障)是
    什么区别应用程序包从库
    包的掩护下?

  2. 的事实是,一个项目
    图书馆项目的标记
    地方
    ?如果是这样,它在哪里
    将其标记(显然不是在源
    文件,而不是连在res的XML
    文件)


解决方案

从<一个href=\"http://developer.android.com/guide/developing/projects/projects-cmdline.html#SettingUpLibraryProject\">Managing从命令行页面项目:


  

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


  
  

android.library = TRUE


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

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

<一个href=\"http://devmaze.word$p$pss.com/2011/05/22/android-application-android-libraries-and-jar-libraries/\">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.

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:

  1. What I am interested to know (mainly for troubleshooting purposes) is what differentiates an Application package from a Library package "under the cover"?
  2. 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/

这篇关于什么检查&QUOT;为图书馆和QUOT;复选框做&QUOT;在封面&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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