Introduction to Android Application Development: Android Essentials

Introduction to Android Application Development: Android Essentials

NOOK Book(eBook)

$23.49 $39.99 Save 41% Current price is $23.49, Original price is $39.99. You Save 41%.
View All Available Formats & Editions

Available on Compatible NOOK Devices and the free NOOK Apps.
WANT A NOOK?  Explore Now

Product Details

ISBN-13: 9780133477337
Publisher: Pearson Education
Publication date: 11/21/2013
Series: Developer's Library
Sold by: Barnes & Noble
Format: NOOK Book
Pages: 672
File size: 44 MB
Note: This product may take a few minutes to download.

About the Author

Joseph Annuzzi, Jr., is a freelance software architect, graphic artist, writer, and technical reviewer. He usually can be found mastering the Android platform, implementing cutting-edge HTML5 capabilities, leveraging various cloud technologies, speaking in different programming languages, working with diverse frameworks, integrating with various social APIs, tinkering with peer-to-peer, cryptography, and computer vision algorithms, or creating stunningly realistic 3D renders. He is always on the lookout for disruptive Internet and mobile technologies and has multiple patent applications in process. He graduated from the University of California, Davis, with a B.S. in Managerial Economics and a minor in Computer Science and lives where much of the action is, Silicon Valley. When he is not working with technology, he has been known to lounge in the sun on the beaches of the Black Sea with international movie stars; he has trekked through the Bavarian forest in winter, has immersed himself in the culture of the Italian Mediterranean, and has narrowly escaped the wrath of an organized crime ring in Eastern Europe after his taxi dropped him off in front of the bank ATM they were liquidating. He also lives an active and healthy lifestyle, designs and performs custom fitness training routines to stay in shape, and adores his loyal Beagle, Cleopatra.

 

Lauren Darcey is responsible for the technical leadership and direction of a small software company specializing in mobile technologies, including Android, iOS, BlackBerry, Palm Pre, BREW, and J2ME, and consulting services. With more than two decades of experience in professional software production, Lauren is a recognized authority in application architecture and the development of commercial-grade mobile applications. Lauren received a B.S. in Computer Science from the University of California, Santa Cruz. She spends her copious free time traveling the world with her geeky mobile-minded husband and is an avid nature photographer. Her work has been published in books and newspapers around the world. In South Africa, she dove with 4-meter-long great white sharks and got stuck between a herd of rampaging hippopotami and an irritated bull elephant. She’s been attacked by monkeys in Japan, gotten stuck in a ravine with two hungry lions in Kenya, gotten thirsty in Egypt, narrowly avoided a coup d état in Thailand, geocached her way through the Swiss Alps, drank her way through the beer halls of Germany, slept in the crumbling castles of Europe, and gotten her tongue stuck to an iceberg in Iceland (while being watched by a herd of suspicious wild reindeer).

 

Shane Conder has extensive development experience and has focused his attention on mobile and embedded development for the past decade. He has designed and developed many commercial applications for Android, iOS, BREW, BlackBerry, J2ME, Palm, and Windows Mobile—some of which have been installed on millions of phones worldwide. Shane has written extensively about the mobile industry and evaluated mobile development platforms on his tech blogs and is well known within the blogosphere. Shane received a B.S. in Computer Science from the University of California. A self-admitted gadget freak, Shane always has the latest smartphone, tablet, or other mobile device. He can often be found fiddling with the latest technologies, such as cloud services and mobile platforms, and other exciting, state-of-the-art technologies that activate the creative part of his brain. He also enjoys traveling the world with his geeky wife, even if she did make him dive with 4-meter-long great white sharks and almost get eaten by a lion in Kenya. He admits that he has to take at least two phones with him when backpacking—even though there is no coverage—and that he snickered and whipped out his Android phone to take a picture when Laurie got her tongue stuck to that iceberg in Iceland, and that he is catching on that he should be writing his own bio.

Table of Contents

Acknowledgments xxxi

About the Authors xxxiii

 

Introduction 1

Who Should Read This Book 1

Key Questions Answered in This Book 2

How This Book Is Structured 2

An Overview of Changes in This Edition 3

Development Environments Used in This Book 5

Supplementary Materials Available 6

Where to Find More Information 6

Conventions Used in This Book 7

Contacting the Authors 7

 

Part I: An Overview of the Android Platform

 

Chapter 1: Introducing Android 11

A Brief History of Mobile Software Development 11

The Open Handset Alliance 18

Android Platform Differences 23

The Android Platform 29

Summary 36

Quiz Questions 36

Exercises 36

References and More Information 36

 

Chapter 2: Setting Up Your Android Development Environment 37

Configuring Your Development Environment 37

Exploring the Android SDK 43

Summary 52

Quiz Questions 52

Exercises 53

References and More Information 53

 

Chapter 3: Writing Your First Android Application 55

Testing Your Development Environment 55

Building Your First Android Application 68

Summary 92

Quiz Questions 93

Exercises 94

References and More Information 94

 

Part II: Android Application Basics

 

Chapter 4: Understanding the Anatomy of an Android Application 97

Mastering Important Android Terminology 97

The Application Context 98

Performing Application Tasks with Activities 99

Organizing Activity Components with Fragments 105

Managing Activity Transitions with Intents 106

Working with Services 110

Receiving and Broadcasting Intents 111

Summary 112

Quiz Questions 112

Exercises 112

References and More Information 113

 

Chapter 5: Defining Your Application Using the Android Manifest File 115

Configuring Android Applications Using the Android Manifest File 115

Managing Your Application’s Identity 122

Enforcing Application System Requirements 123

Registering Activities in the Android Manifest 129

Working with Permissions 131

Exploring Other Manifest File Settings 133

Summary 133

Quiz Questions 134

Exercises 134

References and More Information 135

 

Chapter 6: Managing Application Resources 137

What Are Resources? 137

Setting Simple Resource Values Using the Android IDE 143

Working with Different Types of Resources 146

Working with Layouts 166

Referencing System Resources 171

Summary 172

Quiz Questions 173

Exercises 173

References and More Information 173

 

Part III: Android User Interface Design Essentials

 

Chapter 7: Exploring User Interface Building Blocks 177

Introducing Android Views and Layouts 177

Displaying Text to Users with TextView 179

Retrieving Data from Users with Text Fields 183

Giving Users Choices Using Spinner Controls 188

Allowing Simple User Selections with Buttons and Switches 190

Retrieving Dates, Times, and Numbers from Users with Pickers 197

Using Indicators to Display Progress and Activity to Users 199

Adjusting Progress with Seek Bars 202

Other Valuable User Interface Controls 203

Summary 207

Quiz Questions 207

Exercises 207

References and More Information 208

 

Chapter 8: Designing with Layouts 209

Creating User Interfaces in Android 209

Organizing Your User Interface 214

Using Built-in Layout Classes 215

Using Container Control Classes 232

Summary 239

Quiz Questions 239

Exercises 240

References and More Information 240

 

Chapter 9: Partitioning the User Interface with Fragments 243

Understanding Fragments 243

Using the Android Support Package 258

Exploring Nested Fragments 261

Summary 261

Quiz Questions 262

Exercises 262

References and More Information 263

 

Chapter 10: Displaying Dialogs 265

Choosing Your Dialog Implementation 265

Exploring the Different Types of Dialogs 266

Working with Dialogs and Dialog Fragments 267

Working with Support Package Dialog Fragments 271

Summary 275

Quiz Questions 276

Exercises 276

References and More Information 276

 

Part IV: Android Application Design Essentials

 

Chapter 11: Using Android Preferences 281

Working with Application Preferences 281

Finding Preferences Data on the Android File System 285

Creating Manageable User Preferences 286

Learning about Cloud Save for Android Applications 296

Summary 298

Quiz Questions 298

Exercises 299

References and More Information 299

 

Chapter 12: Working with Files and Directories 301

Working with Application Data on a Device 301

Practicing Good File Management 302

Understanding Android File Permissions 303

Working with Files and Directories 303

Summary 312

Quiz Questions 312

Exercises 313

References and More Information 313

 

Chapter 13: Leveraging Content Providers 315

Exploring Android’s Content Providers 315

Modifying Content Provider Data 324

Using Third-Party Content Providers 328

Summary 328

Quiz Questions 328

Exercises 329

References and More Information 329

 

Chapter 14: Designing Compatible Applications 331

Maximizing Application Compatibility 331

Designing User Interfaces for Compatibility 333

Providing Alternative Application Resources 338

Targeting Tablets, TVs, and Other New Devices 347

Targeting Google Chromecast Devices 350

Summary 350

Quiz Questions 350

Exercises 351

References and More Information 351

 

Part V: Publishing and Distributing Android Applications

 

Chapter 15: Learning the Android Software Development Process 355

An Overview of the Mobile Development Process 355

Choosing a Software Methodology 356

Gathering Application Requirements 357

Assessing Project Risks 364

Writing Essential Project Documentation 368

Leveraging Configuration Management Systems 369

Designing Mobile Applications 370

Developing Mobile Applications 373

Testing Mobile Applications 373

Deploying Mobile Applications 374

Supporting and Maintaining Mobile Applications 375

Summary 377

Quiz Questions 377

Exercises 377

References and More Information 378

 

Chapter 16: Designing and Developing Bulletproof Android Applications 379

Best Practices in Designing Bulletproof Mobile Applications 379

Avoiding Silly Mistakes in Android Application Design 388

Best Practices in Developing Bulletproof Mobile Applications 388

Summary 393

Quiz Questions 394

Exercises 394

References and More Information 394

 

Chapter 17: Planning the Android Application Experience 395

Thinking about Objectives 395

Techniques for Focusing Your Product Efforts 397

Charting Your Application’s Navigation 400

Encouraging Action 408

Communicating Your Application’s Identity 416

Designing Screen Layouts 417

Reacting Properly with Visual Feedback 418

Observing Target Users for Usability 418

Summary 419

Quiz Questions 420

Exercises 420

References and More Information 420

 

Chapter 18: Testing Android Applications 423

Best Practices in Testing Mobile Applications 423

Android Application Testing Essentials 435

More Android Automated Testing Programs and APIs 455

Summary 457

Quiz Questions 457

Exercises 457

References and More Information 458

 

Chapter 19: Publishing Your Android Application 459

Choosing the Right Distribution Model 459

Packaging Your Application for Publication 462

Publishing to Google Play 468

Google Play Staged Rollouts 478

Publishing to the Google Play Private Channel 478

Translating Your Application 478

Publishing Using Other Alternatives 479

Self-Publishing Your Application 479

Summary 480

Quiz Questions 481

Exercises 481

References and More Information 481

 

Part VI: Appendixes

 

Appendix A: Mastering the Android Development Tools 485

Using the Android Documentation 485

Leveraging the Android Emulator 489

Viewing Application Log Data with LogCat 490

Debugging Applications with DDMS 490

Using Android Debug Bridge (ADB) 490

Using the Resource Editors and UI Designer 491

Using the Android Hierarchy Viewer 493

Working with Nine-Patch Stretchable Graphics 497

Working with Other Android Tools 500

Summary 502

Quiz Questions 503

Exercises 503

References and More Information 503

 

Appendix B: Quick-Start Guide: The Android Emulator 505

Simulating Reality: The Emulator’s Purpose 505

Working with Android Virtual Devices 507

Launching the Emulator with a Specific AVD 512

Configuring the GPS Location of the Emulator 516

Calling between Two Emulator Instances 517

Messaging between Two Emulator Instances 518

Interacting with the Emulator through the Console 520

Enjoying the Emulator 524

Understanding Emulator Limitations 525

Summary 526

Quiz Questions 526

Exercises 527

References and More Information 527

 

Appendix C: Quick-Start Guide: Android DDMS 529

Using DDMS with the Android IDE and as a Standalone Application 529

Getting Up to Speed Using Key Features of DDMS 530

Working with Processes, Threads, and the Heap 531

Using the Allocation Tracker 534

Viewing Network Statistics 535

Working with the File Explorer 536

Working with the Emulator Control 539

Working with the System Information Pane 541

Taking Screen Captures of the Emulator and Device Screens 542

Working with Application Logging 543

Summary 544

Quiz Questions 545

Exercises 545

References and More Information 545

 

Appendix D: Android IDE and Eclipse Tips and Tricks 547

Organizing Your Android IDE Workspace 547

Writing Code in Java 552

Resolving Mysterious Build Errors 556

Summary 557

Quiz Questions 557

Exercises 557

References and More Information 557

 

Appendix E: Answers to Quiz Questions 559

 

Index 567

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews