Android programming /
Saved in:
Author / Creator: | Sills, Bryan, author. |
---|---|
Edition: | Fifth edition. |
Imprint: | [Boston, Massachusetts] : Addison-Wesley Professional, 2022. |
Description: | 1 online resource (688 pages) : illustrations |
Language: | English |
Series: | The Big Nerd Ranch guide Big Nerd Ranch guide. |
Subject: | |
Format: | E-Resource Book |
URL for this record: | http://pi.lib.uchicago.edu/1001/cat/bib/13699795 |
Table of Contents:
- Learning Android
- Prerequisites
- What's New in the Fifth Edition?
- Kotlin vs Java
- How to Use This Book
- How This Book Is Organized
- Challenges
- Are you more curious?
- Typographical Conventions
- Android Versions
- The Necessary Tools
- Downloading and Installing Android Studio
- Downloading Earlier SDK Versions
- A Hardware Device
- 1. Your First Android Application
- App Basics
- Creating an Android Project
- Navigating in Android Studio
- Laying Out the UI
- The view hierarchy
- View attributes
- Creating string resources
- Previewing the layout
- From Layout XML to View Objects
- Resources and resource IDs
- Wiring Up Views
- Getting references to views
- Setting listeners
- Making Toasts
- Running on the Emulator
- For the More Curious: The Android Build Process
- Android build tools
- Challenges
- Challenge: Switching Your Toast for a Snackbar
- 2. Interactive User Interfaces
- Creating a New Class
- Updating the Layout
- Wiring Up the User Interface
- Adding an Icon
- Referencing resources in XML
- Screen Pixel Densities
- Running on a Device
- Challenge: Add a Listener to the TextView
- Challenge: Add a Previous Button
- 3. The Activity Lifecycle
- Rotating GeoQuiz
- Activity States and Lifecycle Callbacks
- Logging the Activity Lifecycle
- Making log messages
- Using Logcat
- Exploring How the Activity Lifecycle Responds to User Actions
- Temporarily leaving an activity
- Finishing an activity
- Rotating an activity
- Device Configuration Changes and the Activity Lifecycle
- For the More Curious: Creating a Landscape Layout
- For the More Curious: UI Updates and Multi-Window Mode
- For the More Curious: Log Levels
- Challenge: Preventing Repeat Answers
- Challenge: Graded Quiz
- 4. Persisting UI State
- Including the ViewModel Dependency
- Adding a ViewModel
- ViewModel lifecycle
- Add data to your ViewModel
- Saving Data Across Process Death
- For the More Curious: Jetpack, AndroidX, and Architecture Components
- For the More Curious: Avoiding a Half-Baked Solution
- For the More Curious: Activity and Instance State
- 5. Debugging Android Apps
- Exceptions and Stack Traces
- Diagnosing misbehaviors
- Logging stack traces
- Setting breakpoints
- Android-Specific Debugging
- Using Android Lint
- Build issues
- Challenge: Using Conditional Breakpoints
- Challenge: Exploring the Layout Inspector
- Challenge: Exploring the Profiler
- 6. Testing
- Two Types of Tests
- JVM Tests
- Instrumented Tests with Espresso and ActivityScenario
- Challenge: Asserting Yourself
- 7. Your Second Activity
- Setting Up a Second Activity
- Creating a new activity
- A new activity subclass
- Declaring activities in the manifest
- Adding a cheat button to Main Activity
- Starting an Activity
- Communicating with intents
- Passing Data Between Activities
- Using intent extras
- Getting a result back from a child activity
- How Android Sees Your Activities
- For the More Curious: startActivityForResult
- For the More Curious: The Back Button and the Activity Lifecycle
- Challenge: Closing Loopholes for Cheaters
- Challenge: Tracking Cheat Status by Question
- 8. Android SDK Versions and Compatibility
- Android SDK Versions
- A sane minimum
- Minimum SDK version
- Target SDK version
- Compile SDK version
- Compatibility and Android Programming
- Jetpack libraries
- Safely adding code from later APIs
- Using the Android Developer Documentation
- Challenge: Reporting the Device's Android Version
- Challenge: Limited Cheats
- 9. Fragments
- The Need for UI Flexibility
- Introducing Fragments
- Starting Criminallntent
- Creating a new project
- Creating a Data Class
- Creating a Fragment
- Defining CrimeDetailFragment's layout
- Creating the CrimeDetailFragment class
- Hosting a Fragment
- Defining a FragmentContainerView
- The FragmentManager
- The fragment lifecycle
- Fragments and memory management
- Challenge: Testing with FragmentScenario
- 10. Displaying Lists with RecyclerView
- Adding a New Fragment and ViewModel
- ViewModel lifecycle with fragments
- Adding a RecyclerView
- Implementing a LayoutManager
- Creating an Item View Layout
- Implementing a ViewHolder
- Implementing an Adapter to Populate the RecyclerView
- Setting the RecyclerView's adapter
- Recycling Views
- Cleaning Up Binding List Items
- Responding to Presses
- Lists and Grids: Past, Present, and Future
- For the More Curious: A Smarter Adapter with ListAdapter
- Challenge: RecyclerView View Types
- 11. Creating User Interfaces with Layouts and Views
- Introducing ConstraintLayout
- Introducing the Layout Editor
- Using ConstraintLayout
- Making room
- Adding views
- ConstraintLayout's inner workings
- Editing properties
- Making list items dynamic
- Styles, Themes, and Theme Attributes
- For the More Curious: Margins vs Padding
- For the More Curious: Advanced Features in ConstraintLayout
- Challenge: Formatting the Date
- 12. Coroutines and Databases
- An Introduction to Asynchronous Code on Android
- Using coroutines
- Consuming data from coroutines
- Creating a Database
- Room architecture component library
- Defining entities
- Creating a database class
- Creating a type converter
- Defining a Data Access Object
- Accessing the Database Using the Repository Pattern
- Importing Prepopulated Data
- Querying the Database
- Keeping the Changes Flowing
- Challenge: Addressing the Schema Warning
- For the More Curious: Singletons
- 13. Fragment Navigation
- Performing Navigation
- Implementing the Navigation component library
- Navigating to the detail screen
- Passing data to a fragment
- Unidirectional Data Flow
- Updating the Database
- For the More Curious: A Better List Preview
- Challenge: No Untitled Crimes
- 14. Dialogs and DialogFragment
- Creating a DialogFragment
- Showing a DialogFragment
- Passing Data Between Two Fragments
- Passing data to DatePickerFragment
- Returning data to CrimeDetailFragment
- Challenge: More Dialogs
- 15. The App Bar
- The Default App Bar
- Menus
- Defining a menu in XML
- Creating the menu
- Responding to menu selections
- For the More Curious: App Bar vs Action Bar vs Toolbar
- For the More Curious: Accessing the AppCompat App Bar
- Challenge: An Empty View for the RecyclerView
- Challenge: Deleting Crimes
- 16. Implicit Intents
- Adding Buttons
- Adding a Suspect Property
- Using a Format String
- Using Implicit Intents
- Parts of an implicit intent
- Sending a crime report
- Asking Android for a contact
- Checking for responding activities
- Challenge: Another Implicit Intent
- 17. Taking Pictures with Intents
- A Place for Your Photo
- File Storage
- Using FileProvider
- Designating a picture location
- Using a Camera Intent
- Scaling and Displaying Bitmaps
- Declaring Features
- Challenge: Detail Display
- 18. Localization
- Localizing Resources
- Default resources
- Checking string coverage using the Translations Editor
- Targeting a region
- Configuration Qualifiers
- Prioritizing alternative resources
- Multiple qualifiers
- Finding the best-matching resources
- Testing Alternative Resources
- For the More Curious: More on Determining Device Size
- Challenge: Localizing Dates
- 19. Accessibility
- TalkBack
- Explore by Touch
- Linear navigation by swiping
- Making Non-Text Elements Readable by TalkBack
- Adding content descriptions
- Making a view focusable
- Creating a Comparable Experience
- For the More Curious: Using TalkBack with an Emulator
- For the More Curious: Using Accessibility Scanner
- Challenge: Improving the List
- Challenge: Providing Enough Context for Data Entry
- Challenge: Announcing Events
- 20. Making Network Requests and Displaying Images
- Creating PhotoGallery
- Networking Basics with Retrofit
- Defining an API interface
- Building the Retrofit object and creating an API instance
- Executing a web request
- Asking permission to network
- Moving toward the repository pattern
- Fetching JSON from Flickr
- Deserializing JSON text into model objects
- Handling errors
- Networking Across Configuration Changes
- Displaying Results in RecyclerView
- Displaying images
- For the More Curious: Managing Dependencies
- Challenge: Paging
- 21. Search View and DataStore
- Searching Flickr
- Using Search View
- Responding to Search View user interactions
- Simple Persistence with DataStore
- Defining UI State
- Challenge: Polishing Your App Some More
- 22. WorkManager
- Creating a Worker
- Scheduling Work
- Checking for New Photos
- Notifying the User
- Providing User Control over Polling
- 23. Browsing the Web and WebView
- One Last Bit of Flickr Data
- The Easy Way: Implicit Intents
- The Harder Way: WebView
- WebChromeClient
- WebView vs a Custom UI
- For the More Curious: WebView Updates
- For the More Curious: Chrome Custom Tabs (Another Easy Way)
- Challenge: Using the Back Button for Browser History
- 24. Custom Views and Touch Events
- Setting Up the DragAndDraw Project
- Creating a Custom View
- Creating BoxDrawing View
- Handling Touch Events
- Tracking across motion events
- Rendering Inside onDraw(Canvas)
- For the More Curious; Detecting Gestures
- Challenge: Saving State
- Challenge: Rotating Boxes
- Challenge: Accessibility Support
- 25. Property Animation
- Building the Scene
- Simple Property Animation
- View transformation properties
- Using different interpolators
- Color evaluation
- Playing Animators Together
- For the More Curious: Other Animation APIs
- Legacy animation tools
- Transitions
- Challenges
- 26. Introduction to Jetpack Compose
- Creating a Compose Project
- Composing Your First UI
- Layouts in Compose
- Composable Functions
- Previewing Composables
- Customizing Composables
- Declaring inputs on a composable function
- Aligning elements in a row
- Specifying text styles
- The Compose Modifier
- The padding modifier
- Chaining modifiers and modifier ordering
- The clickable modifier
- Sizing composables
- Specifying a modifier parameter
- Building Screens with Composables
- Scrollable Lists with LazyColumn
- For the More Curious: Live Literals
- 27. UI State in Jetpack Compose
- Philosophies of State
- Defining Your UI State
- Updating UIs with MutableState
- Recomposition
- Remember
- State Hoisting
- State and Configuration Changes
- Parcelable and Parcelize
- For the More Curious: Coroutines, Flow, and Compose
- For the More Curious: Scrolling State
- For the More Curious: Inspecting Compose Layouts
- 28. Showing Dialogs with Jetpack Compose
- Your First Dialog in Compose
- Dismissing the Dialog
- Setting the Dialog's Content
- Sending Results from a Dialog
- Challenge: Pizza Sizes and Drop-Down Menus
- 29. Theming Compose UIs
- Images
- Image's contentDescription
- Adding more images
- Customizing the Image composable
- Adding a header to LazyColumn
- MaterialTheme
- Scaffold and TopAppBar
- CompositionLocal
- Removing AppCompat
- For the More Curious: Accompanist
- For the More Curious: Creating Your Own CompositionLocals
- Challenge: Animations
- 30. Afterword
- The Final Challenge
- Shameless Plugs
- Thank You
- Index