Skip to main content

2016 | Buch

Android Recipes

A Problem-Solution Approach

insite
SUCHEN

Über dieses Buch

Discover more than 100 down-to-earth code recipes, covering a wide range of useful topics using complete and real-world working code examples. This book is updated to include the Android N SDK (7.0), as well as earlier releases.

Crammed with insightful instruction and helpful examples, this fifth 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.

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 and then modifying them for your own customization needs.

What You'll Learn

Code for Android smartphones and tablets

Use external libraries to save time and effort

Boost app performance by using the Android NDK and RenderScript

Design apps for performance, responsiveness, and seamlessness

Send data between devices and other external hardware

Persist application data and share it between applications

Capture and play back various device media items

Communicate with web services

Get the most out of your user interfaceWho This Book Is For

All Android app developers.

Inhaltsverzeichnis

Frontmatter
Chapter 1. Layouts and Views
Abstract
The Android platform is designed to operate on a variety of 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 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, Erik Hellman
Chapter 2. User Interaction Recipes
Abstract
Afz great-looking application design means nothing if users do not find the application easy to use and its features easy to discover. The user interaction patterns found in most Android applications are designed to engineer experiences that are consistent for users from one application to another. By maintaining consistency with the platform, users will feel familiar with your application’s functionality even if they have never used it before. In this chapter, you’ll investigate some of the common implementation patterns for presenting information to users and retrieving their input.
Dave Smith, Erik Hellman
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, Erik Hellman
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 by 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, Erik Hellman
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 data.
Dave Smith, Erik Hellman
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, Erik Hellman
Chapter 7. Graphics and Drawing
Abstract
Android's UI toolkit is squarely focused on flexibility, and the ability to create content that flawlessly scales across all possible device types. We've already looked at how the view system helps developers adapt to this requirement. In this chapter, we will discuss additional techniques for enhancing your application's user interface using Android's extensible graphics object, the drawable. You will see how we can leverage drawables to make flexible and animated graphic elements that can be associated with any view. It's all about doing more work with fewer image resources in your application.
Dave Smith, Erik Hellman
Chapter 8. Working with Android NDK and RenderScript
Abstract
Developers predominantly write Android applications in Java. However, in some situations, it’s desirable (or even necessary) to express at least part of the code in another language (notably C or C++). This may come from a need to access resources only available in native code (such as kernel drivers), or to obtain better performance from critical sections of code. Google addresses these situations by providing the Android Native Development Kit (NDK) and RenderScript.
Dave Smith, Erik Hellman
Backmatter
Metadaten
Titel
Android Recipes
verfasst von
Dave Smith
Erik Hellman
Copyright-Jahr
2016
Verlag
Apress
Electronic ISBN
978-1-4842-2259-1
Print ISBN
978-1-4842-2258-4
DOI
https://doi.org/10.1007/978-1-4842-2259-1