O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Professional Android, 4th Edition

Book Description

The comprehensive developer guide to the latest Android features and capabilities

Professional Android, 4th Edition shows developers how to leverage the latest features of Android to create robust and compelling mobile apps. This hands-on approach provides in-depth coverage through a series of projects, each introducing a new Android platform feature and highlighting the techniques and best practices that exploit its utmost functionality. The exercises begin simply, and gradually build into advanced Android development. Clear, concise examples show you how to quickly construct real-world mobile applications.

This book is your guide to smart, efficient, effective Android development.

  • Learn the best practices that get more out of Android
  • Understand the anatomy, lifecycle, and UI metaphor of Android apps
  • Design for all mobile platforms, including tablets
  • Utilize both the Android framework and Google Play services

Table of Contents

  1. Cover
  2. Introduction
  3. 1 Hello, Android
    1. ANDROID APPLICATION DEVELOPMENT
    2. A LITTLE BACKGROUND
    3. THE ANDROID ECOSYSTEM
    4. PRE-INSTALLED ANDROID APPLICATIONS
    5. ANDROID SDK FEATURES
    6. WHAT DOES ANDROID RUN ON?
    7. WHY DEVELOP FOR MOBILE?
    8. WHY DEVELOP FOR ANDROID?
    9. INTRODUCING THE DEVELOPMENT FRAMEWORK
  4. 2 Getting Started
    1. GETTING STARTED DEVELOPING ANDROID APPS
    2. DEVELOPING FOR ANDROID
    3. DEVELOPING FOR MOBILE AND EMBEDDED DEVICES
    4. ANDROID DEVELOPMENT TOOLS
  5. 3 Applications and Activities and Fragments, Oh My!
    1. APPLICATIONS, ACTIVITIES, AND FRAGMENTS
    2. THE COMPONENTS OF AN ANDROID APPLICATION
    3. THE ANDROID APPLICATION LIFE CYCLE, PRIORITY, AND PROCESS STATES
    4. INTRODUCING THE ANDROID APPLICATION CLASS
    5. A CLOSER LOOK AT ANDROID ACTIVITIES
    6. INTRODUCING FRAGMENTS
    7. BUILDING AN EARTHQUAKE VIEWER APPLICATION
  6. 4 Defining the Android Manifest and Gradle Build Files, and Externalizing Resources
    1. THE MANIFEST, BUILD FILES, AND RESOURCES
    2. INTRODUCING THE ANDROID MANIFEST
    3. CONFIGURING THE GRADLE BUILD
    4. EXTERNALIZING RESOURCES
  7. 5 Building User Interfaces
    1. FUNDAMENTAL ANDROID DESIGN
    2. DENSITY-INDEPENDENT DESIGN
    3. ANDROID USER INTERFACE FUNDAMENTALS
    4. INTRODUCING LAYOUTS
    5. THE ANDROID WIDGET TOOLBOX
    6. WORKING WITH LISTS AND GRIDS
    7. INTRODUCING DATA BINDING
    8. CREATING NEW VIEWS
  8. 6 Intents and Broadcast Receivers
    1. USING INTENTS AND BROADCAST RECEIVERS
    2. USING INTENTS TO LAUNCH ACTIVITIES
    3. CREATING INTENT FILTERS TO RECEIVE IMPLICIT INTENTS
    4. INTRODUCING LINKIFY
    5. USING INTENTS TO BROADCAST EVENTS
    6. INTRODUCING THE LOCAL BROADCAST MANAGER
    7. INTRODUCING PENDING INTENTS
  9. 7 Using Internet Resources
    1. CONNECTING TO THE INTERNET
    2. CONNECTING, DOWNLOADING, AND PARSING INTERNET RESOURCES
    3. USING THE DOWNLOAD MANAGER
    4. BEST PRACTICES FOR DOWNLOADING DATA WITHOUT DRAINING THE BATTERY
    5. AN INTRODUCTION TO INTERNET SERVICES AND CLOUD COMPUTING
  10. 8 Files, Saving State, and User Preferences
    1. SAVING FILES, STATES, AND PREFERENCES
    2. SAVING AND RESTORING ACTIVITY AND FRAGMENT INSTANCE STATE USING THE LIFECYCLE HANDLERS
    3. RETAINING INSTANCE STATE WITH HEADLESS FRAGMENTS AND VIEW MODELS
    4. CREATING AND SAVING SHARED PREFERENCES
    5. RETRIEVING SHARED PREFERENCES
    6. INTRODUCING ON SHARED PREFERENCE CHANGE LISTENERS
    7. CONFIGURING AUTO BACKUP OF APPLICATION FILES AND SHARED PREFERENCES
    8. BUILDING A PREFERENCE UI
    9. CREATING A SETTINGS ACTIVITY FOR THE EARTHQUAKE MONITOR
    10. INCLUDING STATIC FILES AS RESOURCES
    11. WORKING WITH THE FILESYSTEM
    12. SHARING FILES USING FILE PROVIDER
    13. ACCESSING FILES FROM OTHER APPLICATIONS USING THE STORAGE ACCESS FRAMEWORK
    14. USING URI-BASED PERMISSIONS
  11. 9 Creating and Using Databases
    1. INTRODUCING STRUCTURED DATA STORAGE IN ANDROID
    2. STORING DATA USING THE ROOM PERSISTENCE LIBRARY
    3. PERSISTING EARTHQUAKES TO A DATABASE WITH ROOM
    4. WORKING WITH SQLITE DATABASES
    5. INTRODUCING THE FIREBASE REALTIME DATABASE
  12. 10 Content Providers and Search
    1. INTRODUCING CONTENT PROVIDERS
    2. WHY SHOULD I USE CONTENT PROVIDERS?
    3. CREATING CONTENT PROVIDERS
    4. ACCESSING CONTENT PROVIDERS WITH CONTENT RESOLVERS
    5. USING NATIVE ANDROID CONTENT PROVIDERS
    6. ADDING SEARCH TO YOUR APPLICATION
  13. 11 Working in the Background
    1. WORKING IN THE BACKGROUND
    2. USING BACKGROUND THREADS
    3. SCHEDULING BACKGROUND JOBS
    4. USING NOTIFICATIONS TO NOTIFY USERS
    5. USING FIREBASE CLOUD MESSAGING
    6. USING ALARMS
    7. INTRODUCING SERVICES
  14. 12 Implementing the Android Design Philosophy
    1. INTRODUCING THE ANDROID DESIGN PHILOSOPHY
    2. DESIGNING FOR EVERY SCREEN
    3. INTRODUCING MATERIAL DESIGN
    4. MATERIAL DESIGN UI ELEMENTS
  15. 13 Implementing a Modern Android User Experience
    1. THE MODERN ANDROID UI
    2. CREATING CONSISTENT, MODERN USER INTERFACES USING APPCOMPAT
    3. ADDING A MENU AND ACTIONS TO THE APP BAR
    4. GOING BEYOND THE DEFAULT APP BAR
    5. IMPROVING THE EARTHQUAKE MONITOR’S APP BAR
    6. APP NAVIGATION PATTERNS
    7. ADDING TABS TO THE EARTHQUAKE MONITOR
    8. CHOOSING THE RIGHT LEVEL OF INTERRUPTION
  16. 14 Advanced Customization of Your User Interface
    1. EXPANDING THE USER EXPERIENCE
    2. SUPPORTING ACCESSIBILITY
    3. INTRODUCING ANDROID TEXT-TO-SPEECH
    4. USING SPEECH RECOGNITION
    5. CONTROLLING DEVICE VIBRATION
    6. GOING FULL SCREEN
    7. WORKING WITH PROPERTY ANIMATIONS
    8. ENHANCING YOUR VIEWS
    9. ADVANCED CANVAS DRAWING
    10. COMPOSITE DRAWABLE RESOURCES
    11. COPY, PASTE, AND THE CLIPBOARD
  17. 15 Location, Contextual Awareness, and Mapping
    1. ADDING LOCATION, MAPS, AND CONTEXTUAL AWARENESS TO YOUR APPLICATIONS
    2. INTRODUCING GOOGLE PLAY SERVICES
    3. FINDING DEVICE LOCATION USING GOOGLE LOCATION SERVICES
    4. SETTING AND MANAGING GEOFENCES
    5. USING THE LEGACY PLATFORM LOCATION-BASED SERVICES
    6. USING THE GEOCODER
    7. CREATING MAP-BASED ACTIVITIES
    8. MAPPING THE EARTHQUAKE EXAMPLE
    9. ADDING CONTEXTUAL AWARENESS
  18. 16 Hardware Sensors
    1. INTRODUCING ANDROID SENSORS
    2. TESTING SENSORS WITH THE ANDROID VIRTUAL DEVICE AND EMULATOR
    3. BEST PRACTICES FOR WORKING WITH SENSORS
    4. MONITORING A DEVICE’S MOVEMENT AND ORIENTATION
    5. USING THE ENVIRONMENTAL SENSORS
    6. USING BODY SENSORS
    7. USER ACTIVITY RECOGNITION
  19. 17 Audio, Video, and Using the Camera
    1. PLAYING AUDIO AND VIDEO, AND USING THE CAMERA
    2. PLAYING AUDIO AND VIDEO
    3. USING THE MEDIA ROUTER AND CAST APPLICATION FRAMEWORK
    4. BACKGROUND AUDIO PLAYBACK
    5. USING THE MEDIA RECORDER TO RECORD AUDIO
    6. USING THE CAMERA FOR TAKING PICTURES
    7. RECORDING VIDEO
    8. ADDING MEDIA TO THE MEDIA STORE
  20. 18 Communicating with Bluetooth, NFC, and Wi-Fi Peer-to-Peer
    1. NETWORKING AND PEER-TO-PEER COMMUNICATION
    2. TRANSFERRING DATA USING BLUETOOTH
    3. TRANSFERRING DATA USING WI-FI PEER-TO-PEER
    4. USING NEAR FIELD COMMUNICATION
    5. USING ANDROID BEAM
  21. 19 Invading the Home Screen
    1. CUSTOMIZING THE HOME SCREEN
    2. INTRODUCING HOME SCREEN WIDGETS
    3. CREATING AN EARTHQUAKE WIDGET
    4. INTRODUCING COLLECTION VIEW WIDGETS
    5. CREATING LIVE WALLPAPER
    6. CREATING APP SHORTCUTS
  22. 20 Advanced Android Development
    1. ADVANCED ANDROID
    2. PARANOID ANDROID
    3. DEALING WITH DIFFERENT HARDWARE AND SOFTWARE AVAILABILITY
    4. OPTIMIZING UI PERFORMANCE WITH STRICT MODE
    5. TELEPHONY AND SMS
  23. 21 Releasing, Distributing, and Monitoring Applications
    1. PREPARING FOR RELEASE
    2. UPDATING APPLICATION METADATA IN YOUR APPLICATION MANIFEST
    3. SIGNING PRODUCTION BUILDS OF YOUR APPLICATION
    4. DISTRIBUTING YOUR APPLICATION ON THE GOOGLE PLAY STORE
    5. AN INTRODUCTION TO MONETIZING APPLICATIONS
    6. APPLICATION MARKETING, PROMOTION, AND DISTRIBUTION STRATEGIES
    7. USING FIREBASE TO MONITOR YOUR APPLICATION
  24. Index
  25. End User License Agreement