Skip to main content
main-content

Über dieses Buch

Android continues to be one of the leading mobile OS and development platforms driving today's mobile innovations and the apps ecosystem. Android appears complex, but offers a variety of organized development kits to those coming into Android with differing programming language skill sets.

Android Recipes: A Problem-Solution Approach, Second Edition offers more than 100 down-to-earth code recipes, and guides you step-by-step through a wide range of useful topics using complete and real-world working code examples. It's updated to include the Jelly Bean Android SDK as well as earlier releases.

Instead of abstract descriptions of complex concepts, in Android Recipes, you'll find live code examples. When you start a new project, you can consider copying and pasting the code and configuration files from this book, then modifying them for your own customization needs.

Crammed with insightful instruction and helpful examples, this second edition of Android Recipes is your guide to writing apps for one of today’s hottest mobile platforms. It offers pragmatic advice that will help you get the job done quickly and well. This can save you a great deal of work over creating a project from scratch!

Inhaltsverzeichnis

Frontmatter

Chapter 1. Getting Started with Android

Abstract
Android is hot, and many people are developing Android applications (apps for short). Perhaps you too would like to develop apps but are unsure about how to get started. Although you could study Google’s online Android Developer’s Guide (http://developer.android.com/index.html) to acquire the needed knowledge, you might be overwhelmed by the guide’s vast amount of information. In contrast, this chapter presents just enough theory to help you grasp the basics. Following this theory are recipes that teach you how to develop apps and prepare them for publication on Google Play (https://play.google.com/store).
Dave Smith, Jeff Friesen

Chapter 2. User Interface Recipes

Abstract
The Android platform is designed to operate on a variety of different device types, screen sizes, and screen resolutions. To assist developers in meeting this challenge, Android provides a rich toolkit of user interface (UI) components to utilize and customize to the needs of their specific applications. Android also relies very heavily on an extensible XML framework and set resource qualifiers to create liquid layouts that can adapt to these environmental changes. In this chapter, we take a look at some practical ways to shape this framework to fit your specific development needs.
Dave Smith, Jeff Friesen

Chapter 3. Communications and Networking

Abstract
The key to many successful mobile applications is their ability to connect and interact with remote data sources. Web services and APIs are abundant in today’s world, allowing an application to interact with just about any service, from weather forecasts to personal financial information. Bringing this data into the palm of a user’s hand and making it accessible from anywhere is one of the greatest powers of the mobile platform. Android builds on the Web foundations that Google is known for and provides a rich toolset for communicating with the outside world.
Dave Smith, Jeff Friesen

Chapter 4. Interacting with Device Hardware and Media

Abstract
Integrating application software with device hardware presents opportunities to create unique user experiences that only the mobile platform can provide. Capturing media using the microphone and camera allows applications to incorporate a personal touch through a photo or recorded greeting. Integration of sensor and location data can help you develop applications to answer relevant questions such as “Where am I?” and “What am I looking at?”
Dave Smith, Jeff Friesen

Chapter 5. Persisting Data

Abstract
Even in the midst of grand architectures designed to shift as much user data into the cloud as possible, the transient nature of mobile applications will always require that at least some user data be persisted locally on the device. This data may range from cached responses from a web service guaranteeing offline access to preferences that the user has set for specific application behaviors. Android provides a series of helpful frameworks to take the pain out of using files and databases to persist information.
Dave Smith, Jeff Friesen

Chapter 6. Interacting with the System

Abstract
The Android operating system provides a number of useful services that applications can leverage. Many of these services are designed to allow your application to function within the mobile system in ways beyond just interacting briefly with a user. Applications can schedule themselves for alarms, run background services, and send messages to each other; all of which allows an Android application to integrate to the fullest extent with the mobile device. In addition, Android provides a set of standard interfaces that are designed to expose all the data collected by its core applications to your software. Through these interfaces, any application may integrate with, add to, and improve upon the core functionality of the platform, thereby enhancing the experience for the user.
Dave Smith, Jeff Friesen

Chapter 7. Working with Libraries

Abstract
Smart Android developers deliver their apps to market faster by taking advantage of libraries, which reduce development time by providing previously created and tested code. Developers may create and use their own libraries, use libraries created by others, or do both.
Dave Smith, Jeff Friesen

Chapter 8. Working with Android NDK and Renderscript

Abstract
Developers typically write Android apps entirely in Java. However, situations arise where it’s desirable (or even necessary) to express at least part of the code in another language (notably C or C++). Google addresses these situations by providing the Android Native Development Kit (NDK) and Renderscript.
Dave Smith, Jeff Friesen

Backmatter

Weitere Informationen

Premium Partner

    Bildnachweise