android application development for the intel® platform
TRANSCRIPT
Android Application Development for the
Intel® Platform
Ryan Cohen, Lead Project EditorTao Wang, Lead Contributing Author
Android Application Development for the Intel® Platform
Ryan Cohen & Tao Wang
Copyright © 2014 by Apress Media, LLC, all rights reserved
ApressOpen Rights: You have the right to copy, use and distribute this Work in its entirety, electronically without modification, for non-commercial purposes only. However, you have the additional right to use or alter any source code in this Work for any commercial or non-commercial purpose which must be accompanied by the licenses in (2) and (3) below to distribute the source code for instances of greater than 5 lines of code. Licenses (1), (2) and (3) below and the intervening text must be provided in any use of the text of the Work and fully describes the license granted herein to the Work.
(1) License for Distribution of the Work: This Work is copyrighted by Apress Media, LLC, all rights reserved. Use of this Work other than as provided for in this license is prohibited. By exercising any of the rights herein, you are accepting the terms of this license. You have the non-exclusive right to copy, use and distribute this English language Work in its entirety, electronically without modification except for those modifications necessary for formatting on specific devices, for all non-commercial purposes, in all media and formats known now or hereafter. While the advice and information in this Work are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
If your distribution is solely Apress source code or uses Apress source code intact, the following licenses (2) and (3) must accompany the source code. If your use is an adaptation of the source code provided by Apress in this Work, then you must use only license (3).
(2) License for Direct Reproduction of Apress Source Code: This source code, from Android Application Development for the Intel® Platform, ISBN 978-1-4842-0101-5 is copyrighted by Apress Media, LLC, all rights reserved. Any direct reproduction of this Apress source code is permitted but must contain this license. The following license must be provided for any use of the source code from this product of greater than 5 lines wherein the code is adapted or altered from its original Apress form. This Apress code is presented AS IS and Apress makes no claims to, representations or warrantees as to the function, usability, accuracy or usefulness of this code.
(3) License for Distribution of Adaptation of Apress Source Code: Portions of the source code provided are used or adapted from Android Application Development for the Intel® Platform, ISBN 978-1-4842-0101-5 copyright Apress Media LLC. Any use or reuse of this Apress source code must contain this License. This Apress code is made available at Apress.com/9781483201015 as is and Apress makes no claims to, representations or warrantees as to the function, usability, accuracy or usefulness of this code.
ISBN-13 (pbk): 978-1-4842-0101-5
ISBN-13 (electronic): 978-1-4842-0100-8
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Publisher: Heinz WeinheimerAssociate Publisher: Jeffrey PepperLead Editors: Steve Weiss (Apress); Stuart Douglas and Paul Cohen (Intel)Coordinating Editor: Melissa MaldonadoCover Designer: Anna Ishchenko
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com.
For information on translations, please e-mail [email protected], or visit www.apress.com.
iii
About ApressOpen
What Is ApressOpen?ApressOpen is an open access book program that publishes •high-quality technical and business information.
ApressOpen eBooks are available for global, free, •noncommercial use.
ApressOpen eBooks are available in PDF, ePub, and Mobi formats.•
The user-friendly ApressOpen free eBook license is presented on •the copyright page of this book.
v
Contents at a Glance
About the Lead Project Editor �������������������������������������������������������� xvii
About the Lead Contributing Author ����������������������������������������������� xix
About the Technical Reviewer �������������������������������������������������������� xxi
Introduction ���������������������������������������������������������������������������������� xxiii
Chapter 1: Overview of Embedded Application Development ■for Intel Architecture ���������������������������������������������������������������������� 1
Chapter 2: Intel Embedded Hardware Platform ■ ���������������������������� 19
Chapter 3: Android Application Development Processes ■and Tool Chains for Intel® Architecture ��������������������������������������������47
Chapter 4: Real Device Environment Installation ■ ������������������������� 85
Chapter 5: The Android OS ■ ���������������������������������������������������������� 131
Chapter 6: Customization and Installation of Android ■ ���������������� 191
Chapter 7: GUI Design for Android Apps, Part 1: ■General Overview ����������������������������������������������������������������������� 203
Chapter 8: GUI Design for Android Apps, Part 2: ■The Android-Specific GUI ������������������������������������������������������������ 235
Chapter 9: GUI Design for Android Apps, Part 3: ■Designing Complex Applications ������������������������������������������������ 271
Chapter 10: GUI Design for Android Apps, Part 4: ■Graphic Interface and Touchscreen Input ����������������������������������� 305
■ Contents at a GlanCe
vi
Chapter 11: Performance Optimization for Android ■Applications on x86 ����������������������������������������������������������������������� 335
Chapter 12: NDK and C/C++ Optimization ■ ���������������������������������� 391
Chapter 13: The Low-Power Design of Android Application ■and Intel Graphics Performance Analyzers (Intel GPA): Assisted Power Optimization ��������������������������������������������������������� 445
Index ���������������������������������������������������������������������������������������������� 483
vii
Contents
About the Lead Project Editor �������������������������������������������������������� xvii
About the Lead Contributing Author ����������������������������������������������� xix
About the Technical Reviewer �������������������������������������������������������� xxi
Introduction ���������������������������������������������������������������������������������� xxiii
Chapter 1: Overview of Embedded Application Development ■for Intel Architecture ���������������������������������������������������������������������� 1
Introduction to Embedded Systems �������������������������������������������������������� 1
Mobile Phones ���������������������������������������������������������������������������������������������������������� 3
Consumer Electronics and Information Appliances �������������������������������������������������� 3
Definition of an Embedded System ��������������������������������������������������������� 4
Limited Resources ���������������������������������������������������������������������������������������������������� 4
Real-Time Performance �������������������������������������������������������������������������������������������� 4
Robustness ��������������������������������������������������������������������������������������������������������������� 5
Integrated Hardware and Software �������������������������������������������������������������������������� 5
Power Constraints ���������������������������������������������������������������������������������������������������� 5
Difficult Development and Debugging ���������������������������������������������������������������������� 5
Typical Architecture of an Embedded System ����������������������������������������� 6
Typical Hardware Architecture ���������������������������������������������������������������������������������� 6
Microprocessor Architecture of Embedded Systems ������������������������������������������������ 9
Typical Software Architecture ��������������������������������������������������������������������������������� 15
Special Difficulties of Embedded Application Development ������������������ 17
Summary ����������������������������������������������������������������������������������������������� 18
■ Contents
viii
Chapter 2: Intel Embedded Hardware Platform ■ ���������������������������� 19
Intel Atom Processor ����������������������������������������������������������������������������� 19
Intel Atom Processor Architecture �������������������������������������������������������������������������� 20
Features of the Intel Atom Processor ��������������������������������������������������������������������� 24
Other Technologies Used by the Intel Atom Processor ������������������������������������������� 28
Intel Embedded Chipset ������������������������������������������������������������������������ 29
Intel System on Chip (SoC) �������������������������������������������������������������������� 30
Medfield ������������������������������������������������������������������������������������������������������������������ 31
Bay Trail ������������������������������������������������������������������������������������������������������������������ 32
64-Bit Android OS on Intel Architecture ������������������������������������������������� 32
64 Bits vs� 32-bit Android ��������������������������������������������������������������������������������������� 32
Memory and CPU Register Size ������������������������������������������������������������������������������ 33
Reference Platform for Intel Embedded Systems ��������������������������������� 34
Internet of Things (IoT) and Next Unit of Computing (NUC) ������������������������������������� 34
Smartphones ���������������������������������������������������������������������������������������������������������� 36
Tablets �������������������������������������������������������������������������������������������������������������������� 39
In-Vehicle Infotainment ������������������������������������������������������������������������������������������ 42
Other Application Platforms and Fields ������������������������������������������������������������������ 42
Robotics ����������������������������������������������������������������������������������������������������������������� 43
Summary ����������������������������������������������������������������������������������������������� 45
Chapter 3: Android Application Development Processes ■and Tool Chains for Intel® Architecture ��������������������������������������������47
Android Application Development ��������������������������������������������������������� 47
Development Environment of Android Applications ������������������������������������������������ 48
The Android Application Development Process ������������������������������������������������������ 51
Debugging and Simulation of Android Systems ����������������������������������������������������� 55
■ Contents
ix
Typical Development Tool Chains ��������������������������������������������������������� 60
Editor ���������������������������������������������������������������������������������������������������������������������� 62
Compiler and Linker ����������������������������������������������������������������������������������������������� 62
Debugger ���������������������������������������������������������������������������������������������������������������� 63
Build Manager �������������������������������������������������������������������������������������������������������� 63
Makefile Auto Generation Tool �������������������������������������������������������������������������������� 63
Optimizing Tools -- gprof ���������������������������������������������������������������������������������������� 64
Overview, Installation, and Configuration of Android Application Development Tool Chains on Intel® Architecture ����������������������������������� 65
Intel Environment Setup for Android (OS X Host) ���������������������������������� 72
Android Development on Linux-based Host Machines �������������������������� 73
Intel® Integrated Native Developer Experience beta ����������������������������� 73
Tools and Libraries ������������������������������������������������������������������������������������������������� 74
Setup ���������������������������������������������������������������������������������������������������������������������� 75
Intel INDE Installation ��������������������������������������������������������������������������������������������� 75
Summary ����������������������������������������������������������������������������������������������� 83
Chapter 4: Real Device Environment Installation ■ ������������������������� 85
Mobile Phone Setting ���������������������������������������������������������������������������� 85
Installing the USB Driver on the Host Machine ������������������������������������������������������ 85
Interaction between the Host Machine and the Target Machine ���������������������������� 88
Developing Android Applications ���������������������������������������������������������������������������� 88
Debugging Android Applications ��������������������������������������������������������������������������� 110
Intel Auxiliary Tools for Android Application Development ������������������ 124
Intel C++ Compiler (Intel ICC) ������������������������������������������������������������������������������ 125
Intel Graphics Performance Analyzers for Android OS ������������������������������������������ 126
Intel System Studio����������������������������������������������������������������������������������������������� 127
Intel Project Anarchy: a Free Mobile Game Engine by Havok ������������������������������� 129
Intel Performance Libraries ��������������������������������������������������������������������������������� 129
Summary ��������������������������������������������������������������������������������������������� 130
■ Contents
x
Chapter 5: The Android OS ■ ���������������������������������������������������������� 131
Android Overview �������������������������������������������������������������������������������� 131
Android Architecture ��������������������������������������������������������������������������� 133
Basic Android Functionality from a Programming Perspective ����������� 134
Android System Interface ������������������������������������������������������������������������������������� 134
Common Linux Commands and Operations ���������������������������������������������������������� 140
Using the Android Development and Auxiliary Tools ��������������������������� 151
Using the Emulator ����������������������������������������������������������������������������������������������� 151
Accept “yes” for custom hw and choose x86 for hw�cpu�arch propertyUsing the Help File ���������������������������������������������������������������������������������������������������������� 156
Using DDMS ���������������������������������������������������������������������������������������������������������� 160
Using adb at Command Prompt ���������������������������������������������������������������������������� 177
Using Android Commands ������������������������������������������������������������������������������������ 183
Using Telnet for Emulator Commands ������������������������������������������������������������������ 186
Summary ��������������������������������������������������������������������������������������������� 190
Chapter 6: Customization and Installation of Android ■ ���������������� 191
Tailoring and Customization of an Embedded OS �������������������������������� 191
Overview of Android Customization ���������������������������������������������������� 192
ROM Package/Image �������������������������������������������������������������������������������������������� 193
Overview of Android Image Customization ����������������������������������������������������������� 196
Example of Android Image Customization ������������������������������������������������������������ 196
Installation/Reflash of the Android Image������������������������������������������������������������� 199
Image Installation Example ���������������������������������������������������������������������������������� 200
Intel Build Tools Suite ������������������������������������������������������������������������������������������� 201
Summary ��������������������������������������������������������������������������������������������� 202
■ Contents
xi
Chapter 7: GUI Design for Android Apps, Part 1: ■General Overview ����������������������������������������������������������������������� 203
Overview of GUIs for Embedded Applications ������������������������������������� 203
Characteristics of Interaction Modalities of Android Devices ������������������������������� 204
UI Design Principles for Embedded Systems �������������������������������������� 208
Considerations of Screen Size ������������������������������������������������������������������������������ 208
Size of Application Windows ��������������������������������������������������������������������������������� 209
Considerations Arising from Touch Screens and Styluses ������������������������������������ 210
Keyboard Input Problems ������������������������������������������������������������������������������������� 213
Software Distribution and Copyright Protection Problems ����������������������������������� 214
Android Application Overview ������������������������������������������������������������� 214
Application File Framework ��������������������������������������������������������������������������������� 214
Component Structure of Applications ������������������������������������������������������������������� 228
Content Provider ��������������������������������������������������������������������������������������������������� 231
Android Emulator �������������������������������������������������������������������������������������������������� 231
Introducing Android Runtime (ART) ���������������������������������������������������������������������� 232
Summary ��������������������������������������������������������������������������������������������� 233
Chapter 8: GUI Design for Android Apps, Part 2: ■The Android-Specific GUI ������������������������������������������������������������ 235
State Transitions of Activities �������������������������������������������������������������� 235
Activity States ������������������������������������������������������������������������������������������������������� 235
Important Functions of Activities �������������������������������������������������������������������������� 237
The Context Class �������������������������������������������������������������������������������� 240
Introduction to Intent ��������������������������������������������������������������������������� 243
The Main Roles of Intent ��������������������������������������������������������������������������������������� 244
Intent Resolution ��������������������������������������������������������������������������������������������������� 244
■ Contents
xii
The Relationship between Applications and Activities ������������������������ 247
The Basic Android Application Interface ��������������������������������������������� 247
GuiExam Application Code Analysis ���������������������������������������������������������������������� 248
Using Layouts as Interfaces ��������������������������������������������������������������������������������� 253
Using the View Directly as an Interface ���������������������������������������������������������������� 255
Component ID ������������������������������������������������������������������������������������������������������� 257
Buttons and Events ����������������������������������������������������������������������������� 259
Inner Class Listener ���������������������������������������������������������������������������������������������� 260
Using ImageView �������������������������������������������������������������������������������������������������� 262
Exit Activities and Application ������������������������������������������������������������������������������� 266
Summary ��������������������������������������������������������������������������������������������� 269
Chapter 9: GUI Design for Android Apps, Part 3: ■Designing Complex Applications ������������������������������������������������ 271
Applications with Multiple Activities ��������������������������������������������������� 271
Triggering an Explicit Match of Activities with No Parameters ����������������������������� 272
Triggering Explicit Matching of an Activity with Parameters of Different Applications ���������������������������������������������������������������������������������������������������������� 281
Implicit Matching of Built-In Activities ������������������������������������������������������������������ 292
Implicit Match that Uses a Custom Activity ���������������������������������������������������������� 297
Summary ��������������������������������������������������������������������������������������������� 304
Chapter 10: GUI Design for Android Apps, Part 4: ■Graphic Interface and Touchscreen Input ����������������������������������� 305
Display Output Framework ������������������������������������������������������������������ 305
Drawing Framework for Responding to Touchscreen Input ���������������� 310
Multi-Touch Code Framework ������������������������������������������������������������� 313
Responding to Keyboard Input ������������������������������������������������������������ 317
■ Contents
xiii
Dialog Boxes in Android ���������������������������������������������������������������������� 322
Using an Activity’s Dialog Theme �������������������������������������������������������������������������� 322
Using a Specific Dialog Class ������������������������������������������������������������������������������� 323
Using Toast Reminders ����������������������������������������������������������������������������������������� 323
Dialog Box Example ���������������������������������������������������������������������������������������������� 323
Application Property Settings �������������������������������������������������������������� 328
Summary ��������������������������������������������������������������������������������������������� 333
Chapter 11: Performance Optimization for Android ■Applications on x86 ����������������������������������������������������������������������� 335
Principles of Performance Optimization ���������������������������������������������� 335
Reducing Instructions and Execution Frequency �������������������������������������������������� 336
Selecting Faster Instructions �������������������������������������������������������������������������������� 336
Improving the Degree of Parallelism �������������������������������������������������������������������� 337
Using the Register Cache Effectively �������������������������������������������������������������������� 337
Performance Optimization Methodology ������������������������������������������������������������� 338
Performance Optimization Approaches ����������������������������������������������� 338
Intel Graphics Performance Analyzers (Intel GPA) ������������������������������� 341
Introduction to Intel GPA ��������������������������������������������������������������������������������������� 341
Installing Intel GPA ������������������������������������������������������������������������������������������������ 344
Using Intel GPA on Android ����������������������������������������������������������������������������������� 345
Android Multithreaded Design ������������������������������������������������������������� 355
Android Framework of a Thread ��������������������������������������������������������������������������� 356
Thread Synchronization ���������������������������������������������������������������������������������������� 367
Thread Communication ���������������������������������������������������������������������������������������� 370
Principles of Multithreaded Optimization for the Intel Atom Processor ���������������� 372
■ Contents
xiv
Case Study: Intel GPA-Assisted Multithreaded Optimization for an Android Application ����������������������������������������������������������������������������� 373
Original Application and Intel GPA Analysis ���������������������������������������������������������� 374
Optimized Application and Intel GPA Analysis������������������������������������������������������� 381
Summary ��������������������������������������������������������������������������������������������� 390
Chapter 12: NDK and C/C++ Optimization ■ ���������������������������������� 391
Introduction to JNI ������������������������������������������������������������������������������� 391
Java Methods and C Function Prototype Java ������������������������������������������������������ 394
Introduction to NDK ���������������������������������������������������������������������������������������������� 397
Installing NDK and Setting Up the Environment ���������������������������������� 401
Installing CDT �������������������������������������������������������������������������������������������������������� 401
NDK Examples ������������������������������������������������������������������������������������� 403
Using the Command Line to Generate a Library File �������������������������������������������� 403
Generating a Library File in the IDE ���������������������������������������������������������������������� 411
Workflow Analysis for NDK Application Development ����������������������������������������� 417
NDK Compiler Optimization ����������������������������������������������������������������� 419
Machine-Independent Compiler Switch Options �������������������������������������������������� 420
Intel Processor-Related Compiler Switch Options ������������������������������������������������ 422
Optimization with Intel Integrated Performance Primitives (Intel IPP) 426
NDK Integrated Optimization Examples����������������������������������������������� 427
C/C++: Accelerating the Original Application ������������������������������������������������������� 427
Extending Compiler Optimization ������������������������������������������������������������������������ 436
Comparing Compiler Optimizations ���������������������������������������������������������������������� 441
Summary ��������������������������������������������������������������������������������������������� 443
■ Contents
xv
Chapter 13: The Low-Power Design of Android Application ■and Intel Graphics Performance Analyzers (Intel GPA): Assisted Power Optimization ��������������������������������������������������������� 445
Overview of Low-Power Design ���������������������������������������������������������� 445
The Basics of Consumption ���������������������������������������������������������������������������������� 446
Power Consumption Control Technology �������������������������������������������������������������� 447
Linux Power-Control Mechanism �������������������������������������������������������� 454
Tickless Idle ���������������������������������������������������������������������������������������������������������� 454
PowerTOP ������������������������������������������������������������������������������������������������������������� 455
Intel Power-Optimization Aids ������������������������������������������������������������� 456
Low-Power Considerations in Application Design ������������������������������� 459
The Most Basic Principle of Low-Power Optimization ������������������������������������������ 459
General Recommendations: High Performance = Low Power Consumption �������� 460
Use Low-Power Hardware as Much as Possible to Achieve the Task ������������������� 460
Polling Is the Enemy of Low-Power Optimization ������������������������������������������������� 460
Event-Driven Programming ���������������������������������������������������������������������������������� 462
Reduce Periodic Operations Similar to Polling in Application Programs �������������� 462
Low-Power Recommendations for Data Acquisition and Communications ���������� 463
Establishing a Power-Aware Program ������������������������������������������������������������������ 463
Case Study 1: Intel GPA Assisted Power Optimization for an Android Application ������������������������������������������������������������������������������������������ 463
Original Application and Intel GPA Power Analysis ����������������������������������������������� 464
Optimized Applications and an Intel GPA Power Analysis ������������������������������������� 470
Case Study 2: Timer Optimization and Intel GPA Power Analysis �������� 475
Book Summary ������������������������������������������������������������������������������������ 481
Index ���������������������������������������������������������������������������������������������� 483
xvii
About the Lead Project Editor
Ryan Cohen is the contributing editor responsible for leading the international team of content contributors who created this Intel learning resource; he’s also an Android enthusiast and Portland State graduate. Ryan has been following Android since 2011 when he made the switch from Apple iOS. When he is not writing about Android, he spends his time researching anything and everything new in the world of Android.
xix
About the Lead Contributing Author
Tao Wang came to the United States as a Ph.D. student to study at Oregon State University in 1993. He has been a software engineer with Intel Corporation since 2002. Tao began blogging and writing about Android in 2008; and, since 2011, he has served as a technical collateral manager for the Intel Android Developer Zone, the developer resource for all things Android at Intel. In his spare time, Tao also runs his own mobile app/client education startup called E-k12. He follows closely the latest progress in application development, as well as testing/debugging/performance optimization for mobile devices and Android on x86 platforms. Tao is skilled in many platforms, including Android SDK and NDK; Intel Android tools, game engines such as Cocos2D-x, AndEngine, and libgdx;
OpenGL ES; RenderScript; and Android Runtime. His other areas of interest include mobile Internet technologies such as online content management, cloud-based mobile technologies, embedded devices, robotics, and mobile learning on the go.
xxi
About the Technical Reviewer
Xavier Hallade is Developer Evangelist for the Intel Software and Services Group in Paris, France. Since 2012 and the public release of the first Android smartphone based on an Intel platform, he has been helping Android developers improve their support for new hardware and technologies made or supported by Intel.
xxiii
Introduction
The number of Android devices running on Intel processors has gradually increased ever since Intel and Google announced, in late 2011, that they would be working together to optimize future versions of Android for Intel Atom processors. Today, Intel processors can be found in Android smartphones and tablets made by some of the top manufacturers of Android devices, such as Samsung, Lenovo, and Asus.
The increase in Android devices featuring Intel processors has created a demand for Android applications optimized for Intel architecture. This book was written to help introduce developers of all skill levels to the tools they need to develop and optimize applications for the Intel platform.
Chapter 1This chapter discusses principles for embedded systems, the architecture of SoC, and some pros and cons of platforms such as ARM and x86/x64.
Chapter 2This chapter goes into detail about specific Intel hardware platforms. It covers Intel Atom processors, Intel SoCs, and retail devices.
Chapter 3This chapter introduces Android application development on Intel hardware platforms. It also covers installing the development environment tools for an emulator target machine by showing each tool and application and how to download and install them.
Chapter 4This chapter discusses how to set up and configure the application development software on a host system and install USB drivers for a real Android device, so that you can build the connection between the device and host system to allow testing and debugging of applications. It also discusses how to use the Intel emulator and the steps required to accelerate the emulator and work with it.
■ IntroduCtIon
xxiv
Chapter 5This chapter covers the Android OS and helps build your understanding for subsequent development of embedded applications.
Chapter 6This chapter discusses customization in an embedded OS and then explains how to customize Android, specifically.
Chapter 7This chapter introduces the general GUI design method for desktop systems and then shows how designing the UI and UX for embedded systems is different. It also discusses general methods and principles of GUI design for Android applications.
Chapter 8This chapter introduces Android interface design by having you create a simple application called GuiExam. You learn about the state transitions of activities, the Context class, intents, and the relationship between applications and activities. Finally, the chapter shows how to use the layout as an interface by changing the layout file activity_main.xml, and how the button, event, and inner event listeners work.
Chapter 9In this chapter, you learn how to create an application with multiple activities. This application is used to introduce the explicit and implicit trigger mechanisms of activities. Next, you see an example of an application with parameters triggered by an activity in a different application, which will help you understand of the exchange mechanism for the activity’s parameters.
Chapter 10This chapter introduces the basic framework of drawing in the view, how the drawing framework responds to touchscreen input, and how to control the display of the view as well as the multi-touch code framework. Examples illustrate the multi-touch programming framework and keyboard-input responses. You also learn how to respond to hardware buttons on Android devices, such as Volume +, Volume –, Power, Home, Menu, Back, and Search. After that, you see the three different dialog boxes for Android, including the activity dialog theme, specific dialog classes, and toast reminders. Finally, you learn how to change application property settings.
■ IntroduCtIon
xxv
Chapter 11This chapter introduces the basic principles of performance optimization, optimization methods, and related tools for Android application development.
Chapter 12This chapter introduces the Android NDK for C/C++ application development, along with related optimization methods and optimization tools. It talks about how the Intel mobile hardware and software provide a basis for low-power design and how the Intel Atom processor provides hardware support for low power, which is a major feature of the Android operating system.
Chapter 13This chapter provides an overview of and introduction to low-power design, followed by a discussion of Android power-control mechanisms. Finally, it covers how to achieve the goal of low-power application design.
The hope is that this book will help developers to create amazing Android applications that are optimized for the Intel platform. You can find further information on developing applications for Intel architecture at the Intel Developer Zone web site (https://software.intel.com/en-us/android).