Profile

Cover photo
Winkey Wong
Works at Own Project
Attended South China University of Technology
Lives in GuangZhou
133 followers|53,566 views
AboutPostsPhotosYouTube

Stream

 
Cool
 
Today’s #AndroidDev #Protip from +Ankur Kotwal  is about using Gradle build types.

Gradle [0] enables you to declare multiple build types, allowing you to vary signing keys, package names, source sets, resources, and configuration files. These can be used to separate out development builds from usertest and release builds.

To get started, declare signing configurations for the build types. Signing configurations allow you to specify the keystore and alias to sign the APK with. You can reuse the same signing config for multiple build types but its best to have a dedicated one for release. It’s generally not a good idea to store your release configuration in plain text and thus a release signing config has not been specified here - this will result in an unsigned APK.
    signingConfigs {
        debug {
            storeFile file("../debug.keystore")
            keyAlias "androiddebugkey"
        }
        usertest {
            storeFile file("../usertest.keystore")
            storePassword "testing123"
            keyAlias "testKey"
            keyPassword "WhereIsSanta"
        }
    }

Next, you need to declare the build types. Here we can see that the debug and usertest builds are using different suffixes for package names and for the app version. Having unique package names enables all three build type APKs to be installed on the device at once - this is a big time saver during development. Release builds should always use ProGuard to obfuscate the APK and remove unused code. It’s a good idea to turn ProGuard on for usertest builds too since the aim is for these builds to resemble the release build as much as possible.
    buildTypes {
        debug {
            packageNameSuffix ".debug"
            versionNameSuffix "-debug"
        }
        usertest {
            packageNameSuffix ".usertest"
            versionNameSuffix "-usertest"
            runProguard true
            proguardFile getDefaultProguardFile('proguard-android.txt')
            signingConfig signingConfigs.usertest
        }
        release {
            runProguard true
            proguardFile getDefaultProguardFile('proguard-android.txt')
        }
    }

A Gradle project’s directory structure helps to differentiate individual files between each build type. Gradle will overlay the “main” directory with the files in the active build type at build time. This enables you to provide custom configuration files enabling you to point your debug, usertest and release APKs to point to their respective sandbox, staging and production backends. Since we’re using different package names and potentially installing multiple versions of the app on different devices, you might want to use a different app icon for each build type. 

Gradle can help you create a very powerful build setup with relative ease. Gradle integration is available in Android Studio / IntelliJ [1].

[0] http://tools.android.com/tech-docs/new-build-system/user-guide
[1] http://developer.android.com/sdk/installing/studio.html
1
1
hayball leung's profile photo
Add a comment...

Winkey Wong

Shared publicly  - 
 
I found that Chiang Mai that I'm going to visit has its GDG!
1
Krime Lam's profile photo
 
Where there is googler, there is gdg~
Add a comment...

Winkey Wong

Shared publicly  - 
 
+GDG Guangzhou 年底的两大活动之一。
 
GDG校园开放日中山大学站将于10月13日在中山大学东校区多功能会议厅举办。

我们将带来Google最新的技术分享,包括Android,GoLang等。以及最新的科技产品体验,如Chromebook Pixel,ChromeBox,Leapmotion,脑电波测量仪等。

Google Glass本体也将光临本次活动,敬请期待。

地点:中山大学东校区(大学城)多功能会议厅

活动流程:
1:00PM:签到开始
2:00PM:介绍GDG Guangzhou,GDG,SOD以及Google的动态,Anson Ho;
2:30PM - 3:10PM:主题分享《Android studio及Android开发入门》,资深Android讲师Winkey Wong;
3:10PM - 3:50PM:主题分享《Google Glass介绍和开发入门》,国内Google Glass开发第一人Leap Lee;
2:50PM - 4:20PM:茶歇,设备体验;
4:20PM - 5:00PM:主题分享《GoLang开发入门》,资深服务器端开发工程师MJ;
5:00PM - 5:30PM:致辞结束词,大合照。
 ·  Translate
1
Add a comment...
 
我将准备丰富的Android开发入门介绍和Code Lab,手把手教大家玩转Android。
 
1)由资深讲师和大家进行Android、HTML5、Go、Google Glass的技术交流
2)CODE LAB,一起动手“玩转”代码
 ·  Translate
GDG GUANGZHOU DEVFEST
Sat, November 9, 2013, 10:00 AM GMT+8
TIT创意园

4
2
John Cache's profile photoKrime Lam's profile photo谢琨's profile photo
 
十分期待
 ·  Translate
Add a comment...

Winkey Wong

Shared publicly  - 
 
Been waiting to see when this would happen.
1
Add a comment...
Have him in circles
133 people
小云's profile photo
Casum Liang's profile photo
風雅's profile photo
田清波's profile photo

Winkey Wong

Shared publicly  - 
 
chiang mai
 ·  Translate
2
1
Jason Wu's profile photo林佳楠's profile photoMaria Reyes's profile photo
2 comments
 
期待特殊人群的照片
 ·  Translate
Add a comment...

Winkey Wong

Shared publicly  - 
 
GDG School Open Day中山大学站
Sun, October 13, 2013, 2:00 PM GMT+8
1

Winkey Wong

Shared publicly  - 
 
這次我要認真備課,給學生們帶來一次真的能聽懂的入門講座。(這永遠是個美好的願望)歡迎大家參加!
 
GDG校园开放日中山大学站将于10月13日在中山大学东校区多功能会议厅举办。

我们将带来Google最新的技术分享,包括Android,GoLang等。以及最新的科技产品体验,如Chromebook Pixel,ChromeBox,Leapmotion,脑电波测量仪等。

地点:中山大学东校区(大学城)多功能会议厅

活动流程:
1:00PM:签到开始
2:00PM:介绍GDG Guangzhou,GDG,SOD以及Google的动态,Anson Ho;
2:30PM - 3:10PM:Android studio及Android开发入门,Winkey Wong;
3:10PM - 3:50PM:Google Glass介绍和开发入门,Leap Lee;
2:50PM - 4:20PM:茶歇,设备体验;
4:20PM - 5:00PM:GoLang开发入门,MJ;
5:00PM - 5:30PM:致辞结束词,大合照。歇,设备体验;
4:20PM - 5:00PM:GoLang开发入门,MJ;
5:00PM - 5:30PM:致辞结束词,大合照。
 ·  Translate
1
Jason Wu's profile photoKrime Lam's profile photo谢琨's profile photoGuests Zhen's profile photo
5 comments
 
+谢琨 ......官方有介绍,btw,GDG stands for Google Developer Groups....
 ·  Translate
Add a comment...

Winkey Wong

Shared publicly  - 
FFXIV ARR BX
1
Krime Lam's profile photoWinkey Wong's profile photo
5 comments
 
Seems awesome~
Add a comment...

Winkey Wong

Shared publicly  - 
 
又一期!
 
GDL-Guangzhou Android Hours又跟大家见面啦!

GDG广州发起全国GDL活动,为广大Android开发者提供一个中文的技术交流平台!

由广州GDG发起的GDL Guangzhou,每隔一周的周三晚上8:30PM - 9:00PM,将会通过G+ Hangout进行实时交流,并且使用Youtube进行直播,录制后上传到Youku。
Hangout中将会探讨在汇问中的提问,和现场加入Hangout的各位朋友的提问。欢迎加入交流!

Hangout时间:7月24日(周三) 晚上 8:30PM - 9:00PM
节目网站:
http://live.gdgcn.org/

参与方式:

提问:
可以通过每次活动详细页面底部的提问系统进行提问,也可以对别人的提问进行评论。
你也可以通过G+ Hangout现场提问,或者在活动现场进行提问!

现场参加:
绝对欢迎大家来围观!

线上参加:
想加入我们Hangout的朋友,或者外地,甚至外国的朋友,你们可以通过G+ Hangout参加到我们的互动中,在直播开始之后,我们会在活动网页上放置加入Hangout的按钮,只要点击就能加入到我们当中来!
(请预先安装好G+ Hangout的Chrome插件,可以跟朋友先Hangout一次玩玩G+ Hangout的各种有趣功能哦)
 ·  Translate
GDL-Guangzhou Android Hours
Wed, August 7, 2013, 8:30 AM

1
Add a comment...
People
Have him in circles
133 people
小云's profile photo
Casum Liang's profile photo
風雅's profile photo
田清波's profile photo
Work
Occupation
CCE
Skills
Android, Java, Team Manage
Employment
  • Own Project
    CCE, 2013 - present
  • Mtelnet China
    CTO, 2011 - 2013
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
GuangZhou
Previously
Singapore - ShenZhen
Links
Other profiles
Contributor to
Links
Story
Tagline
Organizer of GDG Guangzhou
Introduction
Organizer of GDG Guangzhou, China. Host GDL-Guangzhou Android Hours hangout
Education
  • South China University of Technology
    Software Engineer, 2004 - 2008
Basic Information
Gender
Male
Apps with Google+ Sign-in