android studio 引入arr包的方法
2015-12-23 15:36
519 查看
生成arr包
Module 配置为 library,在 gradle 文件中如下:输出 aar : apply plugin: ‘com.android.library’;
在moudule的build->utputs->aar目录下就能找到生成的arr文件
其它项目引入
Gradle 的一些基本依赖配置方式如下:compile fileTree(dir: ‘xxx’, include: [‘.jar’, “.xxx”]):
将某个目录下 所有符合扩展名的文件作为依赖;
compile ‘com.xx.xx:ProjectName:Version’: 配置Maven` 库作为依赖;在 Maven 库中心 可以搜索自己想用的库进行依赖;
compile project(‘:AnotherModule’): 配置另一个 Module 作为本 Module 的依赖,被依赖的 Module 必须被导入到当前工程中;
compile files(‘xxx.jar’): 配置某个 jar 包作为依赖。
方法1:
file->new module
导入后再在依赖中添加该module
方法2:
将arr放入libs目录下
在app module build.gradle
添加
apply plugin: 'com.android.application' android { //... repositories { //... flatDir { dirs 'libs' } } } dependencies { //... compile(name: 'tourguide-release', ext: 'aar') }
引入成功可在build->intermediates->exploded-arr文件夹下看到
其它参考
http://www.androidchina.net/2467.html
相关文章推荐
- Android通过代码模拟物理、屏幕点击事件
- Android RadioButton 图片位置和大小
- android BitmapFactory.Options.inSampleSize用法说明
- Android Service 相关
- Android PullToRefresh 分析之四、扩展RecyclerView
- android开源框架
- 安卓加载大量图片
- Android 线性布局按比例显示
- android使用系统裁剪图片
- Android studio 编译报错 Error:Error converting bytecode to dex:
- Android判断横屏竖屏代码
- Android Activity生命周期以及Fragment生命周期的区别与分析
- Groovy的方法、闭包语法,接口的实现
- Android VideoView简单播放视频
- 如何去阅读Android的崩溃日志(crash log)和栈轨迹(stack trace)
- 分析android图片的抖动处理
- Android Studio你不知道的调试技巧
- 详细的Android Studio系列教程一--下载和安装
- Android View Scroller类,scrollTo(...)和scrollBy(...)方法
- Android点击非编辑框区域键盘隐藏