简体   繁体   English

外部库vs libs文件夹

[英]External libraries vs libs folder

Hey I'm pretty new to android studio, and relatively new to android development and it recently occurred to me that I'm not sure whether to put libraries in the libs folder or set them up as as an external library - what's the difference? 嘿,我对android studio来说还很陌生,对android开发来说还比较陌生,最近我想到我不确定是将库放在libs文件夹中还是将它们设置为外部库-有什么区别?

Most of what I've found online explains how to include jar files in the libs folder and then compile in the app gradle. 我在网上找到的大多数内容都说明了如何将jar文件包含在libs文件夹中,然后在应用程序gradle中进行编译。 This is what I've tended to do, but I've seen projects that work differently and I'm wondering what the protocol is for this. 这是我倾向于做的事情,但是我看到的项目工作方式有所不同,我想知道该协议的用途是什么。

Also how do you make an external library? 另外,您如何制作外部库? Do you just place the jar file in it? 您是否只是将jar文件放入其中?

Thanks! 谢谢!

There is no way to create an external library directly in Android Studio. 无法直接在Android Studio中创建外部库。 You add a library to your libs folder or add a dependency to your build.gradle, then you reimport the project, and it appears as an external library. 您将库添加到libs文件夹或将依赖项添加到build.gradle,然后重新导入项目,该项目显示为外部库。

In other words, there is no difference - it's the same thing. 换句话说,没有区别-这是同一件事。

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

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