Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Foreword
About the Authors
About the Technical Reviewer
Acknowledgments
Preface
Chapter 1: Getting Started with Android
What Is Android?
History of Android
Android Architecture
App Architecture
Components
Resources
Manifest
App Package
Installing the Android SDK
Installing an Android Platform
Creating an Android Virtual Device
Starting the AVD
Introducing Univerter
Creating Univerter
Installing and Running Univerter
Preparing Univerter for Publication on Google Play
Migrating to Eclipse
Creating and Running Univerter with Eclipse
Summary
Chapter 2: User Interface Recipes
2-1. Customizing the Window
Problem
Solution
How It Works
2-2. Creating and Displaying Views
Problem
Solution
How It Works
2-3. Monitoring Click Actions
Problem
Solution
How It Works
2-4. Resolution-Independent Assets
Problem
Solution
How It Works
2-5. Locking Activity Orientation
Problem
Solution
How It Works
2-6. Dynamic Orientation Locking
Problem
Solution
How It Works
2-7. Manually Handling Rotation
Problem
Solution
How It Works
2-8. Creating Pop-Up Menu Actions
Problem
Solution
How It Works
2-9. Displaying A User Dialog
Problem
Solution
How It Works
2-10. Customizing Options Menu
Problem
Solution
How It Works
2-11. Customizing Back Behavior
Problem
Solution
How It Works
2-12. Emulating the HOME Button
Problem
Solution
How It Works
2-13. Monitoring TextView Changes
Problem
Solution
How It Works
2-14. Scrolling TextView Ticker
Problem
Solution
How It Works
2-15. Animating a View
Problem
Solution
How It Works
2-16. Animating Layout Changes
Problem
Solution
How It Works
2-17. Creating Drawables as Backgrounds
Problem
Solution
How It Works
2-18. Creating Custom State Drawables
Problem
Solution
How It Works
2-19. Applying Masks to Images
Problem
Solution
How It Works
2-20. Creating Dialogs That Persist
Problem
Solution
How It Works
2-21. Implementing Situation-Specific Layouts
Problem
Solution
How It Works
2-22. Customizing Keyboard Actions
Problem
Solution
How It Works
2-23. Dismissing Soft Keyboard
Problem
Solution
How It Works
2-24. Customizing AdapterView Empty Views
Problem
Solution
How It Works
2-25. Customizing ListView Rows
Problem
Solution
How It Works
2-26. Making ListView Section Headers
Problem
Solution
How It Works
2-27. Creating Compound Controls
Problem
Solution
How It Works
2–28. Handling Complex Touch Events
Problem
Solution
How It Works
2-29. Forwarding Touch Events
Problem
Solution
How It Works
2-30. Making Drag-and-Drop Views
Problem
Solution
How It Works
2-31. Customizing Transition Animations
Problem
Solution
How It Works
2-32. Creating View Transformations
Problem
Solution
How It Works
2-33. Swiping Between Views
Problem
Solution
How It Works
2-34. Creating Modular Interfaces
Problem
Solution
How It Works
2-35. High-Performance Drawing
Problem
Solution
How It Works
Useful Tools to Know: Hierarchy Viewer and Lint
Hierarchy Viewer
Running Hierarchy Viewer
Exploring the View Hierarchy Window
Working with an Individual View in Tree View
Debugging with View Hierarchy
Optimizing 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
Problem
Solution
How It Works
3–2. Intercepting WebView Events
Problem
Solution
How It Works
3–3. Accessing WebView with JavaScript
Problem
Solution
How It Works
3–4. Downloading an Image File
Problem
Solution
How It Works
3–5. Downloading Completely in the Background
Problem
Solution
How It Works
3–6. Accessing a REST API
Problem
Solution
How It Works
3–7. Parsing JSON
Problem
Solution
How It Works
3–8. Parsing XML
Problem
Solution
How It Works
3–9. Receiving SMS
Problem
Solution
How It Works
3–10. Sending an SMS Message
Problem
Solution
How It Works
3–11. Communicating over Bluetooth
Problem
Solution
How It Works
3–12. Querying Network Reachability
Problem
Solution
How It Works
3-13. Transferring Data with NFC
Problem
Solution
How It Works
3-14. Connecting over USB
Problem
Solution
How It Works
Summary
Chapter 4: Interacting with Device Hardware and Media
4-1. Integrating Device Location
Problem
Solution
How It Works
4-2. Mapping Locations
Problem
Solution
How It Works
4-3. Annotating Maps
Problem
Solution
How It Works
4-4. Capturing Images and Video
Problem
Solution
How It Works
4-5. Making a Custom Camera Overlay
Problem
Solution
How It Works
4-6. Recording Audio
Problem
Solution
How It Works
4-7. Custom Video Capture
Problems
Solution
How It Works
4-8. Adding Speech Recognition
Problem
Solution
How It Works
4-9. Playing Back Audio/Video
Problem
Solution
How It Works
4-10. Playing Sound Effects
Problem
Solution
How It Works
4-11. Creating a Tilt Monitor
Problem
Solution
How It Works
4-12. Monitoring Compass Orientation
Problem
Solution
How It Works
4-13. Retrieving Metadata from Media Content
Problem
Solution
How It Works
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
Problem
Solution
How It Works
5–2. Persisting Simple Data
Problem
Solution
How It Works
5–3. Reading and Writing Files
Problem
Solution
How It Works
5–4. Using Files as Resources
Problem
Solution
How It Works
5–5. Managing a Database
Problem
Solution
How It Works
5–6. Querying a Database
Problem
Solution
How It Works
5–7. Backing Up Data
Problem
Solution
How It Works
5–8. Sharing Your Database
Problem
Solution
How It Works
5–9. Sharing Your SharedPreferences
Problem
Solution
How It Works
5–10. Sharing Your Other Data
Problem
Solution
How It Works
Useful Tools to Know: SQLite3
Univerter and SQLite3
Creating the Database
Extending the Category and Conversion Classes
Introducing the DBHelper Class
Extending the Univerter Class
Running the Enhanced Univerter App
Summary
Chapter 6: Interacting with the System
6–1. Notifying from the Background
Problem
Solution
How It Works
6–2. Creating Timed and Periodic Tasks
Problem
Solution
How It Works
6–3. Scheduling a Periodic Task
Problem
Solution
How It Works
6–4. Creating Sticky Operations
Problem
Solution
How It Works
6–5. Running Persistent Background Operations
Problem
Solution
How It Works
6–6. Launching Other Applications
Problem
Solution
How It Works
6–7. Launching System Applications
Problem
Solution
How It Works
6–8. Letting Other Applications Launch Your Application
Problem
Solution
How It Works
6–9. Interacting with Contacts
Problem
Solution
How It Works
6–10. Picking Device Media
Problem
Solution
How It Works
6–11. Saving to the MediaStore
Problem
Solution
How It Works
6-12. Interacting with the Calendar
Problem
Solution
How It Works
6-13. Logging Code Execution
Problem
Solution
How It Works
6-14. Creating a Background Worker
Problem
Solution
How It Works
6-15. Customizing the Task Stack
Problem
Solution
How It Works
6-16. Implementing AppWidgets
Problem
Solution
How It Works
Summary
Chapter 7: Working with Libraries
7-1. Creating Java Library JARs
Problem
Solution
How It Works
7-2. Using Java Library JARs
Problem
Solution
How It Works
7-3. Creating Android Library Projects
Problem
Solution
How It Works
7-4. Using Android Library Projects
Problem
Solution
How It Works
7-5. Charting
Problem
Solution
How It Works
7-6. Practical Push Messaging
Problem
Solution
How It Works
7-7. Using Google’s Support Package
Problem
Solution
How It Works
Summary
Chapter 8: Working with Android NDK and Renderscript
Android NDK
Installing the NDK
Exploring the NDK
Greetings from the NDK
Sampling the NDK
8-1. Discovering Native Activities
Problem
Solution
How It Works
8-2. Developing Low-Level Native Activities
Problem
Solution
How It Works
8-3. Developing High-Level Native Activities
Problem
Solution
How It Works
Renderscript
Exploring Renderscript Architecture
Grayscaling Images with Renderscript
8-4. Learning More About Renderscript
Problem
Solution
How It Works
Summary
Appendix A: Scripting Layer for Android
Installing SL4A
Exploring SL4A
Adding a Shell Script
Accessing the Linux Shell
Installing the Python Interpreter
Scripting with Python
Appendix B: Android Tools Overview
SDK Tools
android
apkbuilder
ddms
dmtracedump
draw9patch
emulator
etc1tool
hierarchyviewer
hprof-conv
lint
mksdcard
monitor
monkeyrunner
sqlite3
systrace
traceview
Tracer for OpenGL ES
zipalign
Platform Tools
aapt
adb
aidl
dexdump
dx
fastboot
llvm-rs-cc
Appendix C: App Design Guidelines
Designing Filtered Apps
Designing High-Performance Apps
Designing Responsive Apps
Designing Seamless Apps
Designing Secure Apps
Appendix D: Univerter Architecture
Exploring the Source Code
Exploring the Converter Interface
Exploring the Conversion Class
Exploring the Category Class
Exploring the Univerter Class
Exploring the Resource Files
Exploring the App Launcher Icon Drawable Resources
Exploring the Background Drawable Resource
Exploring the Main Layout Resource
Exploring the List Row Layout Resource
Exploring the Options Menu Resource
Exploring the Help Dialog Box Layout Resource
Exploring the Info Dialog Box Layout Resource
Exploring the Color Resources
Exploring the String Resources
Exploring the Style Resources
Exploring the Manifest
Index
← Prev
Back
Next →
← Prev
Back
Next →