About This eBook ePUB is an open, industry-standard format for eBooks. However, support of ePUB and its many features varies across reading devices and applications. Use your device or app settings to customize the presentation to your liking. Settings that you can customize often include font, font size, single or double column, landscape or portrait mode, and figures that you can click or tap to enlarge. For additional information about the settings and features on your reading device or app, visit the device manufacturer’s Web site. Many titles include programming code or configuration examples. To optimize the presentation of these elements, view the eBook in single-column, landscape mode and adjust the font size to the smallest setting. In addition to presenting code and configurations in the reflowable text format, we have included images of the code that mimic the presentation found in the print book; therefore, where the reflowable format may compromise the presentation of the code listing, you will see a “Click here to view code image” link. Click the link to view the print-fidelity code image. To return to the previous page viewed, click the Back button on your device or app. ™ Android User Interface Design Turning Ideas and Sketches into Beautifully Designed Apps Ian G. Clifton Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 [email protected] For sales outside the United States, please contact: International Sales [email protected] Visit us on the Web: informit.com/aw Library of Congress Cataloging-in-Publication Data is on file. Copyright © 2013 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission to use material from this work, please submit a written request to Pearson Education, Inc., Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your request to (201) 236-3290. Google is a registered trademark of Google, Inc. Android, Gmail, Google Currents, Google Maps, Google Play, and Nexus are trademarks of Google, Inc. Amazon and Kindle Fire are registered trademarks of Amazon.com, Inc. Java is a registered trademark of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. ISBN-13: 978-0-321-88673-6 ISBN-10: 0-321-88673-9 Text printed in the United States on recycled paper at R.R. Donnelley in Crawfordsville, Indiana. First printing: May 2013 Editor-in-Chief Mark Taub Acquisitions Editor Laura Lewin Development Editor Songlin Qiu Managing Editor Kristy Hart Project Editor Betsy Gratner Copy Editor Bart Reed Indexer Lisa Stumpf Proofreader Jess DeGabriele Technical Reviewers Joseph Annuzzi Cameron Banga Joshua Jamison Editorial Assistant Olivia Basegio Cover Designer Chuti Prasertsith Compositor Nonie Ratcliff Praise for Android User Interface Design “Android User Interface Design is a truly excellent book, written by one of the most experienced and knowledgeable Android developers. This is a very practical, highly readable guide and a great how-to resource for every Android developer. Each chapter reveals a clear and deep understanding of UI design. I highly recommend this book to anyone wishing to develop Android apps with superior UI.” —Kyungil Kim Software Engineer, Facebook “I recommend this book for all Android developers who work alone and want to give a professional look to their apps. The content of the book is excellent and covers all aspects needed to understand how to design Android apps that stand out.” —Gonzalo Benoffi CEO, Coffee and Cookies, Android Development “Design was never part of a developer’s job until mobile app development started; now it’s a must. This book gives a simple yet effective way to design your apps. It’s easy for beginners and informative for experienced developers as well. This is the best book I could ever refer to anyone who is in Android development. A one-time read of this book covers the experience you might gain from three years of learning development. I am amazed to see instructions on how to design starting from wireframes, which is something no other book has provided clear enough explanation of. (Some don’t even cover it.) I really love it. Thanks to Ian for this wonderful contribution to the Android developer community. Best, simple, and effective!” —Chakradhar Gavirineni Android Application Developer, Adeptpros IT Solutions Pvt Ltd. “Ian’s book is an invaluable resource for everything there is to know about designing, creating layouts, and rendering Android applications. The ‘Common Task Reference’ appendix is an excellent addition that makes this book a must-have. Make sure to keep this one within arm’s reach of your desk.” —Josh Schumacher Software Engineer, HasOffers “From the first few pages, this book provides a wealth of tips, tricks, and techniques for developing Android user interfaces. If you are grappling with all the various view types, then read this book—it really helps cement when and why you should include the various UI components to great effect (with worked examples!). Well worth a read by anyone looking for inspiration to improve their user interface into a great user experience.” —Richard Sey PassBx Developers Dedicated to my family Contents Introduction Part I The Basics of Android User Interface 1 Android UI Overview A Brief History of Android Design The Android Design Website Core Principles Standard Components Supporting Multiple Devices Notable Changes Summary 2 Understanding Views—The UI Building Blocks What Is a View? Displaying Text Displaying Images Views for Gathering User Input Other Notable Views Listening to Events Summary 3 Creating Full Layouts with View Groups and Fragments ViewGroup Fragments Summary 4 Adding App Graphics and Resources Introduction to Resources in Android Resource Qualifiers Understanding Density Supported Image Files Nine-Patch Images XML Drawables Other Resources Summary Part II The Full Design and Development Process 5 Starting a New App Defining Goals High-Level Flow Wireframes Summary 6 Developing the App Foundation Organizing into Activities and Fragments Breaking Wireframes into Views Creating Themes and Styles Summary 7 Finalizing the Design Wireframes and Graphical Design App Visual Style and Personality Text Considerations Standard Icons Dynamic Content Considerations Navigation and Transitions Error Cases Summary 8 Applying the Design Working with the Designer Slicing the Graphics Assets Updating Themes and Styles Breaking Comps into Views Improving Efficiency Basic Testing Across Device Types Summary 9 Further Improving the App Hierarchy Viewer Animations Custom Fonts Summary Part III Advanced Topics for Android User Interfaces
Description: