Book description
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 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 latest Jelly Bean Android SDK as well as earlier releases.
In this expanded edition,
You'll start off with a recap of Android architecture and app fundamentals, and then get down to business and build an app with Android SDK 4.1 version or earlier release at the command line and Eclipse.
Next, you'll learn how to accomplish practical tasks pertaining to the user interface, communications with the cloud, device hardware, data persistence, communications between applications, and interacting with Android itself.
Finally, you'll learn how to leverage various libraries and Scripting Layer for Android (SL4A) to help you perform tasks more quickly, how to use the Android NDK to boost app performance, and how to design apps for performance, responsiveness, seamlessness, and more.
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. This can save you a great deal of work over creating a project from scratch!
What you'll learn
Discover Android architecture and various Android-specific APIs
How to develop a unit conversion app in the context of command-line/Android SDK and Eclipse/Android SDK environments
How to accomplish various tasks related to the user interface and more
How to use external libraries to save time and effort
How to quickly develop an app using the Scripting Layer for Android (SL4A) tool
How to boost app performance by using the Android NDK
Guidelines for designing filtered apps, performant apps, responsive apps, and seamless apps
Who this book is for
This book is a handy reference for all Android app developers. Newcomers may also find this of interest, too.
Table of contents
- Titlepage
- Contents at a Glance
- Contents
- Foreword
- About the Authors
- About the Technical Reviewer
- Acknowledgments
- Preface
- Chapter 1: Getting Started with Android
-
Chapter 2: User Interface Recipes
- 2-1. Customizing the Window
- 2-2. Creating and Displaying Views
- 2-3. Monitoring Click Actions
- 2-4. Resolution-Independent Assets
- 2-5. Locking Activity Orientation
- 2-6. Dynamic Orientation Locking
- 2-7. Manually Handling Rotation
- 2-8. Creating Pop-Up Menu Actions
- 2-9. Displaying A User Dialog
- 2-10. Customizing Options Menu
- 2-11. Customizing Back Behavior
- 2-12. Emulating the HOME Button
- 2-13. Monitoring TextView Changes
- 2-14. Scrolling TextView Ticker
- 2-15. Animating a View
- 2-16. Animating Layout Changes
- 2-17. Creating Drawables as Backgrounds
- 2-18. Creating Custom State Drawables
- 2-19. Applying Masks to Images
- 2-20. Creating Dialogs That Persist
- 2-21. Implementing Situation-Specific Layouts
- 2-22. Customizing Keyboard Actions
- 2-23. Dismissing Soft Keyboard
- 2-24. Customizing AdapterView Empty Views
- 2-25. Customizing ListView Rows
- 2-26. Making ListView Section Headers
- 2-27. Creating Compound Controls
- 2–28. Handling Complex Touch Events
- 2-29. Forwarding Touch Events
- 2-30. Making Drag-and-Drop Views
- 2-31. Customizing Transition Animations
- 2-32. Creating View Transformations
- 2-33. Swiping Between Views
- 2-34. Creating Modular Interfaces
- 2-35. High-Performance Drawing
- Useful Tools to Know: Hierarchy Viewer and Lint
- Hierarchy Viewer
- Exploring the View Hierarchy Window
- Working with an Individual View in Tree View
- Debugging with View Hierarchy
- Exploring the Pixel Perfect Window
- Working with Pixel Perfect Overlays
- Lint
- Running Lint
- Summary
-
Chapter 3: Communications and Networking
- 3–1. Displaying Web Information
- 3–2. Intercepting WebView Events
- 3–3. Accessing WebView with JavaScript
- 3–4. Downloading an Image File
- 3–5. Downloading Completely in the Background
- 3–6. Accessing a REST API
- 3–7. Parsing JSON
- 3–8. Parsing XML
- 3–9. Receiving SMS
- 3–10. Sending an SMS Message
- 3–11. Communicating over Bluetooth
- 3–12. Querying Network Reachability
- 3-13. Transferring Data with NFC
- 3-14. Connecting over USB
- Summary
-
Chapter 4: Interacting with Device Hardware and Media
- 4-1. Integrating Device Location
- 4-2. Mapping Locations
- 4-3. Annotating Maps
- 4-4. Capturing Images and Video
- 4-5. Making a Custom Camera Overlay
- 4-6. Recording Audio
- 4-7. Custom Video Capture
- 4-8. Adding Speech Recognition
- 4-9. Playing Back Audio/Video
- 4-10. Playing Sound Effects
- 4-11. Creating a Tilt Monitor
- 4-12. Monitoring Compass Orientation
- 4-13. Retrieving Metadata from Media Content
- Useful Tools to Know: Sensor Simulator
- Obtaining Sensor Simulator
- Launching Sensor Simulator Settings and Sensor Simulator
- Accessing Sensor Simulator from Your Apps
- Summary
-
Chapter 5: Persisting Data
- 5–1. Making a Preference Screen
- 5–2. Persisting Simple Data
- 5–3. Reading and Writing Files
- 5–4. Using Files as Resources
- 5–5. Managing a Database
- 5–6. Querying a Database
- 5–7. Backing Up Data
- 5–8. Sharing Your Database
- 5–9. Sharing Your SharedPreferences
- 5–10. Sharing Your Other Data
- Useful Tools to Know: SQLite3
- Univerter and SQLite3
- Summary
-
Chapter 6: Interacting with the System
- 6–1. Notifying from the Background
- 6–2. Creating Timed and Periodic Tasks
- 6–3. Scheduling a Periodic Task
- 6–4. Creating Sticky Operations
- 6–5. Running Persistent Background Operations
- 6–6. Launching Other Applications
- 6–7. Launching System Applications
- 6–8. Letting Other Applications Launch Your Application
- 6–9. Interacting with Contacts
- 6–10. Picking Device Media
- 6–11. Saving to the MediaStore
- 6-12. Interacting with the Calendar
- 6-13. Logging Code Execution
- 6-14. Creating a Background Worker
- 6-15. Customizing the Task Stack
- 6-16. Implementing AppWidgets
- Summary
- Chapter 7: Working with Libraries
- Chapter 8: Working with Android NDK and Renderscript
- Appendix A: Scripting Layer for Android
- Appendix B: Android Tools Overview
- Appendix C: App Design Guidelines
- Appendix D: Univerter Architecture
- Index
Product information
- Title: Android Recipes: A Problem-Solution Approach, Second Edition
- Author(s):
- Release date: December 2012
- Publisher(s): Apress
- ISBN: 9781430246145
You might also like
book
Android Recipes: A Problem-Solution Approach for Android 5.0, Fourth Edition
Android Recipes, Fourth Edition offers more than 100 down-to-earth code recipes, and guides you step-by-step through …
book
Android Application Development Cookbook - Second Edition
Over 100 recipes to help you solve the most common problems faced by Android Developers today …
book
Android 9 Development Cookbook - Third Edition
Build feature-rich, reliable Android Pie apps with the help of more than 100 proven industry standard …
book
Introducing SQLite for Mobile Developers
This brief book is a basic introduction to SQLite for iOS and Android developers. The book …