如何在Android Studio中下载库? [英] How to download libraries in Android Studio?

查看:303
本文介绍了如何在Android Studio中下载库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我必须从互联网添加某个库到我的Android项目中时,我会将它们添加到应用程序级gradle脚本的依赖项中,并为我下载该库。是否有可能下载这些库文件,以便我可以在其他项目中使用它们,而无需再次下载整个库和依赖文件?

只需到Maven central并下载库。

例如,这里是Volley 。只需点击下载JAR按钮。

尽管如此,我强烈建议坚持使用Gradle / Maven,以便与版本保持一致,并适当处理要下载的库的其他依赖项。他们被称为软件包管理员有一个原因,他们做得很好。



这些库实际上只下载到磁盘一次并在项目之间共享,它们不会被下载为每个新项目。


Whenever I have to add certain library from the internet to my Android project, I add them inside the dependencies in the app level gradle script and it downloads the library for me. Is it possible to download these library files so that I can use them in other projects as well without downloading the whole library and dependency files again?

解决方案

Just go to Maven central and download the libraries.

For example, here is Volley. Just click the download JAR button.

I would strongly recommend sticking with Gradle / Maven, though, to keep consistency with versions and appropriately handle additional dependencies for the libraries you want to download. They are called package managers for a reason, and they do their job well.

The libraries are actually downloaded to disk only once and shared between projects, they aren't downloaded for every new project.

这篇关于如何在Android Studio中下载库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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