Builds different channels of code in Android Studio and Eclipse.
来源:互联网 发布:hashmap的hash算法 编辑:程序博客网 时间:2024/06/05 10:13
Builds different channels of code in Android Studio and Eclipse.
Android Studio
对多渠道的设置请看stromZhang的这篇文章。http://stormzhang.com/devtools/2015/01/15/android-studio-tutorial6/
下面介绍如何对不同flavor配置不同的代码。
首先,在src文件夹中,根据flavor名创建相应的目录。如下图所示:
再在文件夹中创建该flavor版本需要的不同代码。
在通常情况下,代码是写在main/java下面的,假如在main/java/com/demo/commont下有Contacts文件,在dalian版本下,contacts中的内容需要替换,那么就可以在dalian文件夹下创建java/com/demo/commont/Contacts.java。此时通过gradle命令打包dalian flavor时: gradle assembledalian就会使用dalian文件夹下的Contacts.java文件。
注意:Contacts文件只能存在一个,不能与main/java下的Contacts.java共存
Eclipse
虽然现在开发都大多使用的是AndroidStudio,但是还有些遗留项目没有迁移到AS上。与Android Studio不同之处是Eclipse需要在build.gradle 中配置代码路径。如下图所示:
创建dalian文件夹的路径和Android Studio中同理。
0 0
- Builds different channels of code in Android Studio and Eclipse.
- Linking different libraries for Debug and Release builds in Cmake on windows?
- Source Code Tags and Builds
- Android code in Eclipse
- Android Studio Eclipse Code Formatter
- Setting up Automatic NDK Builds in Eclipse
- Setting up Automatic NDK Builds in Eclipse
- Setting up Automatic NDK Builds in Eclipse
- Setting up Automatic NDK Builds in Eclipse
- Setting up Automatic NDK Builds in Eclipse
- Setting up Automatic NDK Builds in Eclipse
- Speed Up Project Builds In Eclipse
- We are already in the process of making 11 connections and the number of simultaneous builds has be
- We are already in the process of making n+ connections and the number of simultaneous builds has bee
- common and different of final in java and const in C++
- Android Studio 自带模拟器root时:adbd cannot run as root in production builds
- [Android] Different between Padding and Margin in Layout
- Manage Android source code like sourceinsight in MotoDev Studio or Eclipse
- AudioRecord判断是否有音频输入
- MacOS上brew提示cannot load such file mach
- jQuer基础教程
- 引水入城_洛谷1514_搜索 + dp
- sql case when then end 用法
- Builds different channels of code in Android Studio and Eclipse.
- 17 - 03 - 29 图解HTTP(33)
- Linux-系统更新后启动异常
- codeforces 757 A. Gotta Catch Em' All!
- 动态规划:Super Jumping! Jumping! Jumping!
- AWS EC2 CentOS release 6.5 部署zookeeper、kafka、dubbo
- 微信小程序实例:编写tabBar模板
- Codecraft-17 and Codeforces Round #391 (Div. 1 + Div. 2, combined) B. Bash's Big Day(分拆素因子+求最多的公因子)
- 合并内容相同的单元格