Android Design Patterns and Best Practice
eBook - ePub

Android Design Patterns and Best Practice

Kyle Mew

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

Android Design Patterns and Best Practice

Kyle Mew

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Create reliable, robust, and efficient Android apps with industry-standard design patterns

About This Book

  • Create efficient object interaction patterns for faster and more efficient Android development
  • Get into efficient and fast app development and start making money from your android apps
  • Implement industry-standard design patterns and best practices to reduce your app development time drastically

Who This Book Is For

This book is intended for Android developers who have some basic android development experience. Basic Java programming knowledge is a must to get the most out of this book.

What You Will Learn

  • Build a simple app and run it on real and emulated devices
  • Explore the WYSIWYG and XML approaches to material design provided within Android Studio
  • Detect user activities by using touch screen listeners, gesture detection, and reading sensors
  • Apply transitions and shared elements to employ elegant animations and efficiently use the minimal screen space of mobile devices
  • Develop apps that automatically apply the best layouts for different devices by using designated directories
  • Socialize in the digital word by connecting your app to social media
  • Make your apps available to the largest possible audience with the AppCompat support library

In Detail

Are you an Android developer with some experience under your belt? Are you wondering how the experts create efficient and good-looking apps? Then your wait will end with this book! We will teach you about different Android development patterns that will enable you to write clean code and make your app stand out from the crowd.

The book starts by introducing the Android development environment and exploring the support libraries. You will gradually explore the different design and layout patterns and get to know the best practices of how to use them together. Then you'll then develop an application that will help you grasp activities, services, and broadcasts and their roles in Android development.

Moving on, you will add user-detecting classes and APIs such as gesture detection, touch screen listeners, and sensors to your app. You will also learn to adapt your app to run on tablets and other devices and platforms, including Android Wear, auto, and TV. Finally, you will see how to connect your app to social media and explore deployment patterns as well as the best publishing and monetizing practices.

The book will start by introducing the Android development environment and exploring the support libraries. You will gradually explore the different Design and layout patterns and learn the best practices on how to use them together. You will then develop an application that will help you grasp Activities, Services and Broadcasts and their roles in Android development. Moving on, you will add user detecting classes and APIs such as at gesture detection, touch screen listeners and sensors to our app. You will also learn to adapt your app to run on tablets and other devices and platforms, including Android Wear, Auto, and TV. Finally, you will learn to connect your app to social media and explore deployment patterns and best publishing and monetizing practices.

Style and approach

This book takes a step-by-step approach. The steps are explained using real-world practical examples. Each chapter uses case studies where we show you how using design patterns will help in your development process.

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 Android Design Patterns and Best Practice als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Android Design Patterns and Best Practice von Kyle Mew im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatik & Open-Source-Programmierung. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2016
ISBN
9781786467218

Android Design Patterns and Best Practice


Android Design Patterns and Best Practice

Copyright © 2016 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: December 2016
Production reference: 1201216
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78646-721-8
www.packtpub.com

Credits

Author
Kyle Mew
Copy Editor
Safis Editing
Reviewer
Víctor Albertos
Project Coordinator
Devanshi Doshi
Commissioning Editor
Amarabha Banerjee
Proofreader
Safis Editing
Acquisition Editor
Shweta Pant
Indexer
Mariammal Chettiyar
Content Development Editor
Narendrakumar Tripathi
Graphics
Jason Monteiro
Technical Editor
Anushree Arun Tendulkar
Production Coordinator
Shantanu N. Zagade

About the Author

Kyle Mew has been programming since the early eighties and has written for several technology websites. He has also written three radio plays and three other books on Android development.

About the Reviewer

Victor Albertos has been developing Android apps for 5 years. During this time, he had the chance to explore several approaches to achieve maintainable and testable code. From an imperative style, gradually he has switch to a more declarative one, applying concepts and theories from functional languages such as Haskell to the Android and Java ecosystem.
He is an active open source contributor, sharing with the Android community useful libraries, mainly focused on reactive programming.
Currently he is working as an Android architect at Sabadell Bank.
I would like to thank to my family for their constant support, my few friends for being always there, and specially to Inma, who I deeply love.

www.PacktPub.com

For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
www.PacktPub.com
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.

Why subscribe?

  • Fully searchable across every book published by Packt
  • Copy and paste, print, and bookmark content
  • On demand and accessible via a web browser

Customer Feedback

Thank you for purchasing this Packt book. We take our commitment to improving our content and products to meet your needs seriously—that's why your feedback is so valuable. Whatever your feelings about your purchase, please consider leaving a review on this book's Amazon page. Not only will this help us, more importantly it will also help others in the community to make an informed decision about the resources that they invest in to learn.
You can also review for us on a regular basis by joining our reviewers' club. If you're interested in joining, or would like to learn more about the benefits we offer, please contact us: [email protected]

Preface

Welcome to Android Design Patterns and Best Practice, a comprehensive guide to how to get the most out of your apps with the tried and tested programming philosophy, design patterns. These patterns provide a logical and elegant approach to solving many of the development problems that coders face. These patterns act as a guide creating a clear path from problem to solution, and although applying a design pattern does not guarantee best practice in itself, it will hugely assist the process and make the discovery of design flaws far easier. Design patterns can be implemented on very many platforms and written in as many programming languages. Some code libraries even apply patterns as part of their internal mechanics, and many readers will already be familiar with the Java Observer and Observable classes. The Android SDK we will be exploring makes great use of many patterns, such as factories, builders and listeners (which are really just observer patterns). Although we will cover these built-in design patterns, the book will mostly explore how we can build our own, custom made, patterns and apply them to Android development. Rather than approach each design pattern in turn, this book approaches the subject from the perspective of a developer, moving through each aspect of app development exploring individual design patterns as they would arise in the course of building an Android app. To clarify this journey, we will be focusing on a single imaginary app, designed to support a small business. This will take us from application conception through to publication, covering such topics as UI design, internal logic and user interaction along the way. During each of these steps we will explore those design patterns that are relevant to that process, by first exploring the pattern in its abstract form and then applying it to that particular situation. By the end of the book you will have learned how design patterns can be applied to all aspects of Android development and how using them assists best practice. It is the concept of design patterns that is more important than any specific pattern itself. Patterns can, and should, be adapted to suit our specific purposes, and by learning this way of approaching app development, we can even go on to create entirely original patterns of our own.

What this book covers

Chapter 1, Design Patterns, introduces the development environment, and two common design patterns, the factory and abstract factory.
Chapter 2, Creational Patterns, covers material and interface design, exploring the design support library and the builder design pattern.
Chapter 3, Material Patterns, introduces Android User Interfaces and some of the most significant material design components such as the app bar and sliding navigation drawer. This will introduce menus and action icons and how to implement them and how to use a drawer listener to detect user activity.
Chapter 4, Layout Patterns, leads in from the previous one, delving further into Android Layout design patterns and how gravity and weight can be used to create layouts that work on a variety of devices. This will take us onto how Android handles device orientation and screen size and shape differences. The strategy pattern is introduced and demonstrated.
Chapter 5, Structural Patterns, delves us deeper into the design library and create a layout governed by a coordinator layout with a recycler view. This requires exploring the adapter design pattern, first the internal versions and then we build one of our own, as well as a bridge pattern and facade and filter patterns.
Chapter 6, Activating Patterns, shows us how to apply patterns directly to our app. We cover more design library features such as collapsing toolbars, scrolling and divider. We crate a custom dialog, triggered by user activity. We revisit the factory patterns and show how a builder pattern can be used to inflate a UI.
Chapter 7, Combining Patterns, introduces and demonstrates two new structural patterns the prototype and decorator, covering their flexibility. This is then put in to practice as we use the patterns to control a UI comprised of different compound buttons such as switches and radio groups.
Chapter 8, Composing Patterns, concentrates on the composite pattern and how it can be used in many situations and how to select the right situation. We then continue to use it in a practical demonstration to inflate ...

Inhaltsverzeichnis