Home > Store

Advanced Android Application Development, 4th Edition

Register your product to gain access to bonus material or receive a coupon.

Advanced Android Application Development, 4th Edition

eBook

  • Your Price: $46.39
  • List Price: $57.99
  • About Watermarked eBooks
  • This PDF will be accessible from your Account page after purchase and requires PDF reading software, such as Acrobat® Reader®.

    The eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.

    Watermarked eBook FAQ

Description

  • Copyright 2015
  • Dimensions: 7" x 9"
  • Pages: 624
  • Edition: 4th
  • eBook
  • ISBN-10: 0-13-389244-1
  • ISBN-13: 978-0-13-389244-4

Advanced Android™ Application Development, Fourth Edition, is the definitive guide to building robust, commercial-grade Android apps. Systematically revised and updated, this guide brings together powerful, advanced techniques for the entire app development cycle, including design, coding, testing, debugging, and distribution. With the addition of quizzes and exercises in every chapter, it is ideal for both professional and classroom use.

An outstanding practical reference for the newest Android APIs, this guide provides in-depth explanations of code utilizing key API features and includes downloadable sample apps for nearly every chapter. Together, they provide a solid foundation for any modern app project.

Throughout, the authors draw on decades of in-the-trenches experience as professional mobile developers to provide tips and best practices for highly efficient development. They show you how to break through traditional app boundaries with optional features, including the Android NDK, Google Analytics and Android Wear APIs, and Google Play Game Services.

New coverage in this edition includes

  • Integrating Google Cloud Messaging into your apps
  • Utilizing the new Google location and Google Maps Android APIs
  • Leveraging in-app billing from Google Play, as well as third-party providers
  • Getting started with the Android Studio IDE
  • Localizing language and using Google Play App Translation services
  • Extending your app’s reach with Lockscreen widgets and DayDreams
  • Leveraging improvements to Notification, Web, SMS, and other APIs 

Annuzzi has released new source code samples for use with Android Studio. The code updates are posted to the associated blog site: http://advancedandroidbook.blogspot.com/

This title is an indispensable resource for intermediate- to advanced-level Java programmers who are now developing for Android, and for seasoned mobile developers who want to make the most of the new Android platform and hardware.

This revamped, newly titled edition is a complete update of Android™ Wireless Application Development, Volume II: Advanced Topics, Third Edition.

Sample Content

Table of Contents

Acknowledgments xxxiii

About the Authors xxxv

Introduction 1

Who Should Read This Book? 1

How This Book Is Structured 1

Key Questions Answered in This Book 3

An Overview of Changes in This Edition 4

The Development Environment Used in This Book 5

Supplementary Materials Available 6

Where to Find More Information 6

Conventions Used in This Book 7

Contacting the Authors 8

Part I: Advanced Android Application Design Principles 9

Chapter 1: Threading and Asynchronous Processing 11

The Importance of Processing Asynchronously 11

Working with the AsyncTask Class 12

Working with the Thread Class 15

Working with Loaders 16

Understanding StrictMode 17

Summary 17

Quiz Questions 17

Exercises 18

References and More Information 18

Chapter 2: Working with Services 19

Determining When to Use Services 19

Understanding the Service Lifecycle 20

Creating a Service 20

Controlling a Service 25

Implementing a Remote Interface 26

Implementing a Parcelable Class 28

Using the IntentService Class 30

Summary 33

Quiz Questions 34

Exercises 34

References and More Information 34

Chapter 3: Leveraging SQLite Application Databases 35

Storing Structured Data Using SQLite Databases 35

Querying SQLite Databases 40

Closing and Deleting a SQLite Database 45

Designing Persistent Databases 46

Binding Data to the Application User Interface 48

Summary 53

Quiz Questions 54

Exercises 54

References and More Information 54

Chapter 4: Building Android Content Providers 55

Acting as a Content Provider 55

Enhancing Applications Using Content Providers 62

Summary 65

Quiz Questions 65

Exercises 65

References and More Information 65

Chapter 5: Broadcasting and Receiving Intents 67

Sending Broadcasts 67

Receiving Broadcasts 69

Securing Application Broadcasts 73

Summary 74

Quiz Questions 74

Exercises 75

References and More Information 75

Chapter 6: Working with Notifications 77

Notifying the User 77

A Word on Compatibility 78

Notifying with the Status Bar 78

Vibrating the Phone 84

Blinking the Lights 84

Making Noise 86

Customizing the Notification 86

Expandable and Contractible Notifications 88

Notification Priority 90

Introducing the Notification Listener 91

Designing Useful Notifications 91

Summary 92

Quiz Questions 92

Exercises 92

References and More Information 92

Part II: Advanced Android User Interface Design Principles 95

Chapter 7: Designing Powerful User Interfaces 97

Following Android User Interface Guidelines 97

Enabling Action Bars 98

Working with Styles 106

Working with Themes 111

Summary 113

Quiz Questions 113

Exercises 113

References and More Information 114

Chapter 8: Handling Advanced User Input 115

Working with Textual Input Methods 115

Handling User Events 119

Working with Gestures 123

Handling Screen Orientation Changes 134

Summary 137

Quiz Questions 137

Exercises 137

References and More Information 137

Chapter 9: Designing Accessible Applications 139

Exploring the Accessibility Framework 139

Leveraging Speech Recognition Services 141

Leveraging Text-to-Speech Services 145

Testing Application Accessibility 147

Summary 147

Quiz Questions 148

Exercises 148

References and More Information 148

Chapter 10: Development Best Practices for Tablets, TVs, and Wearables 151

Understanding Device Diversity 151

Developing Applications for Tablets 154

Developing Applications for TV 155

Developing Applications for Wearables 158

Summary 159

Quiz Questions 159

Exercises 159

References and More Information 160

Part III: Leveraging Common Android APIs 161

Chapter 11: Using Android Networking APIs 163

Understanding Mobile Networking Fundamentals 163

Understanding StrictMode with Networking 164

Accessing the Internet (HTTP) 164

Summary 173

Quiz Questions 173

Exercises 174

References and More Information 174

Chapter 12: Using Android Web APIs 175

Browsing the Web with WebView 175

Building Web Extensions 182

Debugging WebViews with Chrome DevTools 187

Working with Adobe AIR and Flash 187

Summary 188

Quiz Questions 188

Exercises 189

References and More Information 189

Chapter 13: Using Android Multimedia APIs 191

Working with Multimedia 191

Working with the Camera 192

Working with Video 200

Working with Face Detection 203

Working with Audio 204

Searching for Multimedia 207

Working with Ringtones 208

Introducing the Media Router 209

Summary 209

Quiz Questions 209

Exercises 210

References and More Information 210

Chapter 14: Using Android Telephony APIs 211

Working with Telephony Utilities 211

Using SMS 216

Making and Receiving Phone Calls 220

Working with SIP 222

Summary 223

Quiz Questions 223

Exercises 223

References and More Information 224

Chapter 15: Accessing Android’s Hardware Sensors 225

Interacting with Device Hardware 225

Using the Device Sensors 226

Sensor Event Batching 230

Monitoring the Battery 231

Summary 232

Quiz Questions 233

Exercises 234

References and More Information 234

Chapter 16: Using Android’s Optional Hardware APIs 235

Working with Bluetooth 235

Working with USB 239

Working with Android Beam 241

Working with Wi-Fi 245

Summary 248

Quiz Questions 248

Exercises 249

References and More Information 249

Part IV: Leveraging Google APIs 251

Chapter 17: Using Location and Map APIs 253

Incorporating Android Location APIs 253

Incorporating Google Location Services APIs 260

Incorporating Google Maps Android API v2 262

Summary 268

Quiz Questions 268

Exercises 269

References and More Information 269

Chapter 18: Working with Google Cloud Messaging 271

An Overview of GCM 271

What Alternatives to GCM Exist? 274

Summary 275

Quiz Questions 275

Exercises 275

References and More Information 276

Chapter 19: An Overview of In-App Billing APIs for Android 277

What Is In-App Billing? 277

Using In-App Billing 278

Leveraging Google Play In-App Billing APIs 279

Leveraging Amazon Appstore for Android In-App

Purchasing APIs 280

Leveraging PayPal Billing APIs 280

Leveraging Other Billing APIs 280

Summary 280

Quiz Questions 281

Exercises 281

References and More Information 281

Chapter 20: Enabling Application Statistics with Google Analytics 283

Creating a Google Account for Analytics 283

Adding the Library to Your Android IDE Project 286

Collecting Data from Your Applications 287

Logging Different Events 287

Using the Google Analytics Dashboard 288

Gathering E-commerce Information 290

Tracking Ad and Market Referrals 292

Gathering Statistics 292

Protecting Users’ Privacy 293

Summary 293

Quiz Questions 293

Exercises 294

References and More Information 294

Chapter 21: An Overview of Google Play Game Services 295

Getting Up and Running with Google Play Game Services 295

Incorporating Google Play Game Services into Your Applications 296

Understanding Achievements 297

Understanding Leaderboards 298

Saving Game Data with Cloud Save 299

Introducing Multiplayer Gaming 299

Understanding Antipiracy 299

Summary 300

Quiz Questions 300

Exercises 300

References and More Information 301

Part V: Drawing, Animations, and Graphics Programming with Android 303

Chapter 22: Developing Android 2D Graphics Applications 305

Drawing on the Screen 305

Working with Text 310

Working with Bitmaps 312

Working with Shapes 315

Leveraging Hardware Acceleration Features 324

Summary 326

Quiz Questions 326

Exercises 326

References and More Information 327

Chapter 23: Working with Animation 329

Animating Your Applications 329

Working with Different Interpolators 341

Animating Activity Launch 341

State Animations with Scenes and Transitions 342

Summary 342

Quiz Questions 342

Exercises 343

References and More Information 343

Chapter 24: Developing Android 3D Graphics Applications 345

Working with OpenGL ES 345

Using OpenGL ES APIs in the Android SDK 347

Handling OpenGL ES Tasks Manually 347

Drawing 3D Objects 353

Interacting with Android Views and Events 362

Cleaning Up OpenGL ES 365

Using GLSurfaceView (Easy OpenGL ES) 366

Using OpenGL ES 2.0 369

Exploring OpenGL ES 3.0 373

Summary 374

Quiz Questions 374

Exercises 374

References and More Information 375

Chapter 25: Using the Android NDK 377

Determining When to Use the Android NDK 377

Installing the Android NDK 378

Exploring the Android NDK Sample Application 379

Creating Your Own NDK Project 379

Improving Graphics Performance 384

Comparing RenderScript to the NDK 385

Summary 386

Quiz Questions 386

Exercises 386

References and More Information 386

Part VI: Maximizing Android’s Unique Features 389

Chapter 26: Extending Android Application Reach 391

Enhancing Your Applications 391

Working with App Widgets 392

Working with Live Wallpapers 404

Creating a Live Wallpaper 404

Introducing Daydream 408

Acting as a Content Type Handler 410

Determining Intent Actions and MIME Types 411

Summary 413

Quiz Questions 413

Exercises 414

References and More Information 414

Chapter 27: Enabling Application Search 415

Making Application Content Searchable 415

Enabling Searches in Your Application 416

Enabling Global Search 424

Summary 426

Quiz Questions 426

Exercises 426

References and More Information 426

Chapter 28: Managing User Accounts and Synchronizing User Data 427

Managing Accounts with the Account Manager 427

Synchronizing Data with Sync Adapters 429

Using Backup Services 430

Summary 435

Quiz Questions 436

Exercises 436

References and More Information 436

Part VII: Advanced Topics in Application Publication and Distribution 437

Chapter 29: Internationalizing Your Applications 439

Localizing Your Application’s Language 439

Right-to-Left Language Localization 445

Translation Services through Google Play 445

Publishing Applications for Foreign Users 446

Summary 446

Quiz Questions 446

Exercises 447

References and More Information 447

Chapter 30: Protecting Applications from Software Piracy 449

All Applications Are Vulnerable 449

Using Secure Coding Practices 450

Obfuscating with ProGuard 450

Leveraging the License Verification Library 452

Other Antipiracy Tips 453

Summary 454

Quiz Questions 454

Exercises 455

References and More Information 455

Part VIII: Preparing for Future Android Releases 457

Chapter 31: Introducing the L Developer Preview 459

Exploring the L Developer Preview 459

Introducing Android TV 464

Summary 465

Quiz Questions 465

Exercises 466

References and More Information 466

Part IX: Appendixes 467

Appendix A: Quick-Start Guide: Android Debug Bridge 469

Listing Connected Devices and Emulators 469

Directing ADB Commands to Specific Devices 470

Starting and Stopping the ADB Server 470

Listing ADB Commands 470

Issuing Shell Commands 471

Copying Files 472

Installing and Uninstalling Applications 473

Working with LogCat Logging 474

Controlling the Backup Service 476

Generating Bug Reports 477

Using the Shell to Inspect SQLite Databases 478

Using the Shell to Stress Test Applications 478

Installing Custom Binaries via the Shell 481

Summary 482

Quiz Questions 482

Exercises 483

References and More Information 483

Appendix B: Quick-Start Guide: SQLite 485

Exploring Common Tasks with SQLite 485

Using the sqlite3 Command-Line Interface 486

Learning by Example: A Student Grade Database 491

Summary 497

Quiz Questions 498

Exercises 498

References and More Information 498

Appendix C: Java for Android Developers 499

Learning the Java Programming Language 499

Learning the Java Development Tools 499

Familiarizing Yourself with Java Documentation 500

Understanding Java Shorthand 500

Summary 505

Quiz Questions 505

Exercises 505

References and More Information 505

Appendix D: Quick-Start Guide: Android Studio 507

Getting Up and Running with Android Studio 507

Understanding the Android Studio Project Structure 512

Learning about the Gradle Build System 513

Overview of the Android Studio User Interface 513

Introducing the Layout Editor 513

Debugging Your Android Studio Applications 515

Useful Keyboard Shortcuts 517

Summary 517

Quiz Questions 517

Exercises 518

References and More Information 518

Appendix E: Answers to Quiz Questions 519

Index 527

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020