安卓Android studio导入Github中的项目
来源:互联网 发布:淘宝拉帮结派流量协议 编辑:程序博客网 时间:2024/05/16 18:56
Github中有非常多的优秀开源项目值得我们借鉴和提供给我们使用,那么我们怎么才能把这些项目导入到Android studio中呢,结合各种网站,我归纳了一下两种方法
一、添加github项目作为依赖库——直接clone
- 使用Git或者乌龟Git,其中的Clone命令,将Github上的项目拉到本地仓库中来,这里使用https://github.com/Prokky/ClearRecyclerAdapter 来做例子
- 之后在AS中导入刚才拉到本地仓库的project
- 在导入的project中选择对应的gradle文件
- 打开想要导入该开源库的项目的gradle文件
- 在dependencies中添加编译命令行compile
- 这行编译命令行可以在Github的项目readme.md文件中找到,
dependencies { compile 'com.prokkypew:clearrecycleradapter:1.1.0'}
等待AS编译后就可成功使用该项目依赖包
二、添加github项目作为依赖库——使用jitpack导入依赖库
- 登陆JitPack官网
https://jitpack.io/#singwhatiwanna/PinnedHeaderExpandableListView/3dc169178c - 填入相应的github项目链接,点击lookup,这里以https://github.com/mountainblade/modular 这个例子来举例
- 可以得到相应的项目,并点击get it.
- 点击Get it后可以得到该项目添加的方法
- 按照其中的提示将相关代码填入自己的项目的Gradle文件中
repositories { maven {url"https://jitpack.io" }}dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.github.mountainblade:modular:4bf87e0a75'}
等待AS编译后就可成功使用该项目依赖包
1 0
- 安卓Android studio导入Github中的项目
- Android Studio导入github中的项目
- Android Studio导入GitHub项目中的开源库
- Android Studio 导入github项目
- android studio导入github项目
- Android studio导入github项目
- android studio导入github项目
- Android Studio导入github项目
- Android Studio导入github项目
- Android Studio 导入Eclips 安卓项目
- android studio如何导入github中的Android项目
- Android Studio,Eclipse怎样导入Github中的项目
- android studio github 项目导入问题
- Android Studio 导入GitHub项目的注意事项
- ADT、GitHub 导入项目到Android Studio
- 导入Github上Android studio 项目
- android studio 导入 github 项目代码
- Android Studio导入github项目详解
- connect ECONNREFUSED 127.0.0.1:8087解决方案
- 关于文本左,右外边距是对齐方式text-align:justify
- Stage1--Python的特点和安装
- intellij idea如何打包war文件
- HDU 5363 Key Set (快速幂)
- 安卓Android studio导入Github中的项目
- SDUT 3373 数据结构实验之查找一:二叉排序树
- Python Twisted介绍
- poj1182(食物链)----带权并查集
- zz J2EE高手眼里的OSGi
- 队列
- 杭电-1052 Tian Ji -- The Horse Racing (贪心)
- 自定义View 获取焦点
- BFC