Gradle for Android
eBook - ePub

Gradle for Android

Kevin Pelgrims

Buch teilen
  1. 172 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Gradle for Android

Kevin Pelgrims

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

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.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Gradle for Android als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Gradle for Android von Kevin Pelgrims im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Open Source Programming. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
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.

Inhaltsverzeichnis