Build your Android App with Gradle Android new build system.

Slides:



Advertisements
Similar presentations
Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
Advertisements

Developing in CAS. Why? As distributed you edit CAS 3 with Eclipse and build with Maven 2 – Best Practice for Release Engineering – Difficult edit-debug.
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna.
Introduction to Maven Michael Youngstrom. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to the Java Stack.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
Java Build Tool Comparison HJUG - April 29th, 2009 John Tyler.
Java development infrastructure at FMI Pekka Rantala FMI.
Maven: Build and project management in the 21th century.
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
INSTALLATION OF WORDPRESS. WORDPRESS WordPress is an open source CMS, often used as a blog publishing application powered by PHP and MySQL. It has many.
Android: Hello World Frank Xu Gannon University. Steps Configuration ▫Android SDK ▫Android Development Tools (ADT)  Eclipse plug-in ▫Android SDK and.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
CHAPTER 4 SPRING FRAMEWORK Wattanapong suttapak, Software Engineering, school of Information communication Technology, university of phayao.
Chapter 3 Navigating a Project Goals & Objectives 1.Get familiar with the navigation of the project. How is everything structured? What settings can you.
Erlware For Managing Distribution and Build Erlang User Conference 2007.
Maven & Bamboo CONTINUOUS INTEGRATION. QA in a large organization In a large organization that manages over 100 applications and over 20 developers, implementing.
MAVEN-BLUEMARTINI Yannick Robin. What is maven-bluemartini?  maven-bluemartini is Maven archetypes for Blue Martini projects  Open source project on.
Android Programming By Mohsen Biglari Android Programming, Part1: Introduction 1 Part1: Introduction By Mohsen Biglari.
Understanding Eclipse Development Environment Hen-I Yang July 7, 2006
COMP-14: Automating your deployments using ANT Gary S Clink Business Consultant.
Introducing NativeScript [Pavel Kolev Software Telerik: a Progress company]
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
Android for Java Developers Denver Java Users Group Jan 11, Mike
INFSOM-RI Juelich, 10 June 2008 ETICS - Maven From competition, to collaboration.
MAE Continuous Integration Administration guide July 8th, 2013.
How to publish your app 1 CS440. Step 1: Remove any debug logging  Good practice: comment out any debug logging  Why? CS440 2.
July 2011CMSC 341 CVS/Ant 1 CMSC 341 Java Packages Ant CVS Project Submission.
First Venture into the Android World Chapter 1 Part 2.
14th Oct 2005CERN AB Controls Development Process of Accelerator Controls Software G.Kruk L.Mestre, V.Paris, S.Oglaza, V. Baggiolini, E.Roux and Application.
Development with Eclipse Software Engineering Prof. Werner Krandick.
J.P. Wellisch, CERN/EP/SFT SCRAM Information on SCRAM J.P. Wellisch, C. Williams, S. Ashby.
Chapter 1 Introducing Ant. What is ant? Ant is a build tool  Automate the tasks of compiling code, running test, and packaging the results for redistribution.
Maven for building Java applications By Nalin De Zoysa
ANDROID APPLICATION DEVELOPMENT. ANDROID DEVELOPMENT DEVELOPER.ANDROID.COM/INDEX.HTML THE OFFICIAL SITE FOR ANDROID DEVELOPERS. PROVIDES THE ANDROID SDK.
Build Systems Presentation December 14, 2015 Noon-1pm Kathy Lee Simunich Bldg. 203/ D120 Brought to you by: Argonne Java.
Open project in Microsoft Visual Studio → build program in “Release” mode.
USING HARDWARE DEVICES When building a mobile application, it's important that you always test your application on a real device before releasing it.
Time to apply stuff… Faculty of Mathematics and Physics Charles University in Prague 5 th October 2015 Workshop 1 – Java Wrestling.
8/29/10 Maven Repository Management with Nexus Jim McMahon.
Maven. Introduction Using Maven (I) – Installing the Maven plugin for Eclipse – Creating a Maven Project – Building the Project Understanding the POM.
CS520 Web Programming Introduction to Maven Chengyu Sun California State University, Los Angeles.
UAB Requirements for 2016 Ivan Prieto Barreiro 18/04/2016 UAB Requirements for
Android apps development - Eclipse, Android SDK, and ADT plugin Introduction of.
Maven & NetBeans Platform. Agenda ● Maven NetBeans Platform Project Types ● Three NetBeans RCP project types ● Differences with Ant project types ● All.
Platform & Maven2 David Šimonek. Certified Engineer Course Agenda What is Maven? Why Maven? NB IDE & Maven NB Platform & Maven.
This material is based upon work supported by the U.S. Department of Energy Office of Science under Cooperative Agreement DE-SC , the State of Michigan.
Introduction to Android Programming
Agenda:- DevOps Tools Chef Jenkins Puppet Apache Ant Apache Maven Logstash Docker New Relic Gradle Git.
Maven 04 March
CS520 Web Programming Introduction to Maven
Build Automation with Gradle
Plan What is Maven ? Links : mvn command line tool
Android Runtime – Dalvik VM
Compile, Build, and Debug
Zlatko Stamatov JavaSkop 13 December 2015
Jonas Ragaišis Programų sistemų 2M kursas Vilnius, 2015
Cordova & Cordova Plugin Installation and Management
CS 240 – Advanced Programming Concepts
The Most Popular Android UI Automation Testing Tool Andrii Voitenko
Android Application Development
International Living Atlases Workshop Madrid 2018
Software Engineering and Architecture
Building LabKey with Gradle
Software Engineering and Architecture
Presentation transcript:

Build your Android App with Gradle Android new build system

Agenda What is Gradle Getting started with gradle Use cases Q&A

Download Meetup Sample Code –

What is gradle Gradle is a JVM based project build automation tool that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy based domain-specific-language (DSL) instead of the more traditional XML form of declaring the project configuration.

Installation Download the latest android plugin supported Gradle version Extract the downloaded zip “gradle-1.10-all.zip” to any directory Configure the GRADLE_HOME environment variable set GRADLE_HOME= \gradle-1.10 set PATH=%PATH%\%GRADLE_HOME%\bin C:\> gradle

Gradle Task C:\> gradle tasks Applying the plugin’s to the build file will automatically add set of build task to run assemble The task to assemble the output(s) of the project check The task to run all the checks. build This task does both assemble and check clean This task cleans the output of the project

Build File Skeleton buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.8.+' } apply plugin: 'android' android { buildToolsVersion "19.0.1" compileSdkVersion 19 }

Gradle Wrapper C:\> gradle wrapper task wrapper(type: Wrapper) { gradleVersion = '1.10‘ } / └── gradlew └── gradlew.bat └── gradle └── wrapper └── gradle-wrapper.jar └── gradle-wrapper.properties

Convention Over Configuration src └── main l└── java l └── instrumentTest └── java sourceSets { main{ manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } instrumentTest.setRoot('tests') }

Usecase : 1 I have project with multiple library projects, one of which is required to be shared with one of my colleague who's working in a another project.

Dependency Management dependencies DSL element is part of the standard Gradle Can add dependencies on local and remote libraries To add a dependency have to provide library on the compile configuration under dependencies DSL Everything added to the compile configuration get packaged in to the final APK Gradle will follow all dependencies transitively

Dependencies On Multiple Projects Each projects will have its own build.gradle declaring how it gets built There will be a file called settings.gradle at the root, which define which folder is a Gradle project If there are more than one library, importing order should be considered on dependencies on each other

Publish Library To Artifact Repo Publish artifacts to local artifact repository Maven Central  Proper release and snapshot release management

Usecase :2 I want to make a digitally signed and secured release version of my app

Build types This is achieved by buildTypes DSL By default, the android plugin automatically sets up the project to build both a debug and a release version of the application Difference is that the ability to enable debug and how the APK is signed It allows to customize both debug and release versions, as well as creating other build types

Build Types… Build Types can contribute to the build with code and resources. For each Build Type, a new matching sourceSet is created, under src directory src/ / This means the Build Type names cannot be main or instrumentTest

Signing APK Android system will not install or run an application that is not signed appropriately. To sign an APK have to make use of signingConfigs DSL

Obfuscating Tool ProGuard is used automatically to obfuscate the APK It will rename classes, fields, and methods with semantically obscure names to make it difficult to reverse engineer. Android plugin support proguard version is 4.10 ProGuard will shrinks, optimizes, and remove unused code which will result smaller APK

Usecase : 3 I want to make a free version of my application with less features and commercial version with all features.

Build Variants – Different versions of the same application or Same application packaged differently or combination of both. Have to occupy productFlavors DSL Build Type + Product Flavor = Build Variant Product flavor will generate APK’s for all possible combinations of Build Types and Product Flavors

Usecase : 4 I want to unit test my project with a testing framework,

Testing No need to have a separate test project any more it is integrated to the application project Default location for the instrument test cases are located in src/instrumentTest Test APK is built to test the app under test using the Android instrumentation framework No need to have a AndroidManifest.xml for the app, cause it will get generated automatically Test app manifest is automatically get filled with the package name and the instrument test runner

Usecase : 5 I want to measure the quality of my source code continuously with some quality tools by Integrate it with a Continuous Integration System

Q&A

Thank you