Gradle for Android
eBook - ePub

Gradle for Android

Kevin Pelgrims

Compartir libro
  1. 172 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Gradle for Android

Kevin Pelgrims

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Gradle for Android un PDF/ePUB en línea?
Sí, puedes acceder a Gradle for Android de Kevin Pelgrims en formato PDF o ePUB, así como a otros libros populares de Computer Science y Open Source Programming. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2015
ISBN
9781783986828
Edición
1

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.

Índice