Gradle for Android
eBook - ePub

Gradle for Android

Kevin Pelgrims

Partager le livre
  1. 172 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Gradle for Android

Kevin Pelgrims

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

If you are an experienced Android developer wanting to enhance your skills with the Gradle Android build system, then this book is for you. As a prerequisite, you will need some knowledge of the concepts of Android application development.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Gradle for Android est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Gradle for Android par Kevin Pelgrims en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Open Source Programming. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2015
ISBN
9781783986828

Gradle for Android


Table of Contents

Gradle for Android
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with Gradle and Android Studio
Android Studio
Staying up to date
Understanding Gradle basics
Projects and tasks
The build lifecycle
The build configuration file
The project structure
Creating a new project
Getting started with the Gradle Wrapper
Getting the Gradle Wrapper
Running basic build tasks
Migrating from Eclipse
Using the import wizard
Migrating manually
Keeping the old project structure
Converting to the new project structure
Migrating libraries
Summary
2. Basic Build Customization
Understanding the Gradle files
The settings file
The top-level build file
The module build file
Plugin
Android
Dependencies
Getting started with tasks
Base tasks
Android tasks
Inside Android Studio
Customizing the build
Manipulating manifest entries
Inside Android Studio
BuildConfig and resources
Project-wide settings
Project properties
Default tasks
Summary
3. Managing Dependencies
Repositories
Preconfigured repositories
Remote repositories
Local repositories
Local dependencies
File dependencies
Native libraries
Library projects
Creating and using library project modules
Using .aar files
Dependency concepts
Configurations
Semantic versioning
Dynamic versions
Inside Android Studio
Summary
4. Creating Build Variants
Build types
Creating build types
Source sets
Dependencies
Product flavors
Creating product flavors
Source sets
Multiflavor variants
Build variants
Tasks
Source sets
Resource and manifest merging
Creating build variants
Variant filters
Signing configurations
Summary
5. Managing Multimodule Builds
The anatomy of a multimodule build
The build lifecycle revisited
Module tasks
Adding modules to a project
Adding a Java library
Adding an Android library
Integrating Android Wear
Using Google App Engine
Analyzing the build file
Using the backend in an app
Custom tasks
Tips and best practices
Running module tasks from Android Studio
Speeding up multimodule builds
Module coupling
Summary
6. Running Tests
Unit tests
JUnit
Robolectric
Functional tests
Espresso
Test coverage
Jacoco
Summary
7. Creating Tasks and Plugins
Understanding Groovy
Introduction
Classes and members
Methods
Closures
Collections
Groovy in Gradle
Getting started with tasks
Defining tasks
Anatomy of a task
Using a task to simplify the release process
Hooking into the Android plugin
Automatically renaming APKs
Dynamically creating new tasks
Creating your own plugins
Creating a simple plugin
Distributing plugins
Using a custom plugin
Summary
8. Setting Up Continuous Integration
Jenkins
Setting up Jenkins
Configuring the build
TeamCity
Setting up TeamCity
Configuring the build
Travis CI
Configuring the build
Further automation
The SDK manager plugin
Running tests
Continuous deployment
Beta distribution
Summary
9. Advanced Build Customization
Reducing the APK file size
ProGuard
Shrinking resources
Automatic shrinking
Manual shrinking
Speeding up builds
Gradle properties
Android Studio
Profiling
Jack and Jill
Ignoring Lint
Using Ant from Gradle
Running Ant tasks from Gradle
Importing an entire Ant script
Properties
Advanced app deployment
Split APK
Summary
Index

Gradle for Android

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: July 2015
Production reference: 1140715
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-682-8
www.packtpub.com

Credits

Author
Kevin Pelgrims
Reviewers
Peter Friese
Jonathan H. Kau
Takuya Miyamoto
Marco A. Rodriguez-Suarez
Felix Schulze
Hugo Visser
Commissioning Editor
Amarabha Banerjee
Acquisition Editor
Nikhil Karkal
Content Development Editor
Prachi Bisht
Technical Editor
Pankaj Kadam
Copy Editors
Puja Lalwani
Laxmi Subramanian
Project Coordinator
Shipra Chawhan
Proofreader
Safis Editing
Indexer
Tejal Soni
Production Coordinator
Manu Joseph
Cover Work
Manu Joseph

About the Author

Kevin Pelgrims started his career as a .NET developer in Belgium. After some years working on Windows and web development for corporate clients, he moved to Copenhagen to become part of its start-up community. There, he began working on mobile platforms, and within a year, he was the lead developer of several Android and Windows Phone apps. Kevin is also a regular speaker at the Android developers group in Copenhagen. He maintains multiple Android apps in his spare time and likes to experiment with server-side technology. When he is not busy writing code, he is most likely playing the guitar with his wife and their cat.
To follow what Kevin is up to, you can take a look at his blog at http://www.kevinpelgrims.com or follow him on Twitter at @kevinpelgrims.

Table des matiĂšres