简体   繁体   English

为什么Android应用程序中有“libs”文件夹?

[英]Why is there a “libs” folder in my application in Android?

我无法理解Android下应用程序中libs文件夹的用途。

它是存储应用程序引用的所有库的位置

如果您使用第三方库,则会将jar添加到libs文件夹中。

If you use the Android command line to create your project, it'll default to libs/. 如果您使用Android命令行来创建项目,它将默认为libs /。 It turns out that the Android Ant tasks are set to look in libs/ by default. 事实证明,默认情况下,Android Ant任务设置为在libs /中查找。

See $ANDROID_HOME/tools/ant/main_rules.xml: 请参阅$ANDROID_HOME/tools/ant/main_rules.xml:

<property name="jar.libs.dir" value="libs" />

If you just care about Eclipse, you can use whatever you want. 如果你只关心Eclipse,你可以使用你想要的任何东西。 It contain all the libraries referenced by your application are stored 它包含存储的应用程序引用的所有

In newer revisions of ADT (revision 17 onwards), the Ant-based build system and the Eclipse plug-in are aligned so that they behave the same way. 在ADT的更新版本(版本17以后)中,基于Ant的构建系统和Eclipse插件是一致的,因此它们的行为方式相同。 This means, by default, only the jars that are present in the libs folder are included in the final apk file. 这意味着,默认情况下,只有libs文件夹中存在的jar包含在最终的apk文件中。 These jars would automatically appear under "Android Dependencies" in your Eclipse project. 这些jar将自动出现在Eclipse项目的“Android Dependencies”下。

For more details please refer here. 有关详细信息,请参阅此处。 http://tools.android.com/recent/dealingwithdependenciesinandroidprojects http://tools.android.com/recent/dealingwithdependenciesinandroidprojects

Please review the following from the android developer site: 请从Android开发者网站查看以下内容:

http://developer.android.com/tools/projects/index.html#ApplicationProjects http://developer.android.com/tools/projects/index.html#ApplicationProjects

libs/ Contains private libraries. libs /包含私有库。

You can find a lot of additional helpful information there as a new developer! 作为新开发人员,您可以在那里找到许多其他有用的信息!

因为Google说我们应该将jar添加到/ libs文件夹,而/ lib文件夹用于可执行文件使用的共享库文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM