in Retrofit, Searching Flickr
@RequiresApi annotation, Safely adding code from later APIsin Room, Defining a Data Access Object
(see also TalkBack)
accessibility focus, TalkBack
Accessibility Scanner, For the More Curious: Using Accessibility Scanner
accessibility services, TalkBack
android:contentDescription attribute, Adding content descriptions
android:focusable attribute, Making a view focusable
android:labelFor attribute, Challenge: Providing Enough Context for Data Entry
contentDescription (Image) (Jetpack Compose), Image’s contentDescription
Explore by Touch, Explore by Touch
focusable modifier (Jetpack Compose), Adding more images
ticker text, Notifying the User
for touch targets, For the More Curious: Using Accessibility Scanner
Accompanist library (Jetpack Compose), For the More Curious: AccompanistView.contentDescription, Creating a Comparable Experience
(see also Activity class, fragments)
about, App Basics
adding to project, Creating an Android Project, Your Second Activity
back stack, How Android Sees Your Activities
child, Your Second Activity, Getting a result back from a child activity
configuration changes and, Rotating an activity
creating, Creating a new activity
declaring in manifest, Declaring activities in the manifest
finishing, Finishing an activity
hosting fragments, Starting CriminalIntent, The fragment lifecycle
launcher, How Android Sees Your Activities, For the More Curious: The Back Button and the Activity Lifecycle
lifecycle, Activity States and Lifecycle Callbacks, Rotating an activity
lifecycle, and hosted fragments, The fragment lifecycle
overriding functions in, Activity States and Lifecycle Callbacks, Making log messages
passing data between, Passing Data Between Activities
process death and, Saving Data Across Process Death
rotation and, Rotating an activity
starting, defined, Your Second Activity
starting, in another application, Implicit Intents
starting, with startActivity(Intent), Starting an Activity
Activity classUI flexibility and, The Need for UI Flexibility
about, App Basics
AppCompatActivity and ComponentActivity vs, Removing AppCompat
as Context subclass, Making Toasts
findNavController, Navigating to the detail screen
getIntent(), Using intent extras
lifecycle functions, Activity States and Lifecycle Callbacks
onCreate(Bundle?), From Layout XML to View Objects, Activity States and Lifecycle Callbacks
onCreateOptionsMenu(Menu), Creating the menu
onDestroy(), Activity States and Lifecycle Callbacks
onPause(), Activity States and Lifecycle Callbacks
onResume(), Activity States and Lifecycle Callbacks
onSaveInstanceState(Bundle), For the More Curious: Activity and Instance State
onStart(), Activity States and Lifecycle Callbacks
onStop(), Activity States and Lifecycle Callbacks
overriding superclass functions, Making log messages
result codes, Setting a result
setContentView(…), From Layout XML to View Objects
setResult(…), Setting a result
ActivityManager classstartActivity(Intent), Starting an Activity, Sending a crime report
back stack, How Android Sees Your Activities
ActivityNotFoundException class, Communicating with intentsstarting activities, Starting an Activity, Sending back an intent
PickContact, Asking Android for a contact
StartActivityForResult, Getting a result back from a child activity
ActivityScenario class, Instrumented Tests with Espresso and ActivityScenarioTakePicture, Using a Camera Intent
getItemCount(), Implementing an Adapter to Populate the RecyclerView
ListAdapter vs, For the More Curious: A Smarter Adapter with ListAdapter
notifyDataSetChanged(…), For the More Curious: A Smarter Adapter with ListAdapter
notifyItemInserted(…), For the More Curious: A Smarter Adapter with ListAdapter
notifyItemMoved(…), For the More Curious: A Smarter Adapter with ListAdapter
onBindViewHolder(…), Implementing an Adapter to Populate the RecyclerView
adb (Android Debug Bridge) driver, Running on a DeviceonCreateViewHolder(…), Implementing an Adapter to Populate the RecyclerView
.Center, Image alignment
.TopEnd, Image alignment
Android Asset Packing tool (aapt), For the More Curious: The Android Build Process.TopStart, Image alignment
as code inspector, Creating a New Class
as static analyzer, Using Android Lint
compatibility and, Safely adding code from later APIs
Android manifest (see manifest)running, Using Android Lint
adding Gradle plugins, Room architecture component library
Android Lint code inspector, Creating a New Class
assets, Importing Prepopulated Data
assistant tool window, Navigating in Android Studio
build process, For the More Curious: The Android Build Process
build tool window, Navigating in Android Studio
code completion, Making Toasts, Implementing fragment lifecycle functions
creating activities, Creating a new activity
creating classes, Creating a New Class
creating menu files, Defining a menu in XML
creating packages, Creating a database class
creating projects, Creating an Android Project
creating values resource files, Localizing Resources
debugger
(see also debugging)
devices view, Running on a Device
editor, Navigating in Android Studio
installing, Downloading and Installing Android Studio
layout editor, Testing Alternative Resources
(see also layouts)
Logcat
previewing layout decorations, Previewing the layout
project tool window, Navigating in Android Studio
project window, Navigating in Android Studio
shortcut for creating test classes, JVM Tests
shortcut to override functions, Implementing an Adapter to Populate the RecyclerView
tool windows, Navigating in Android Studio
Translations Editor, Checking string coverage using the Translations Editor
Android Virtual Device Manager, Running on the Emulatorvariables view, Setting breakpoints
about, Property Animation
android.view.animation package, Legacy animation tools
draw order of views, Simple Property Animation
interpolation, Simple Property Animation
property animation vs transitions framework, Transitions
property animators, Simple Property Animation
running multiple animators, Playing Animators Together
simple property animation, Simple Property Animation
transformation properties
(see also transformation properties)
transitions framework, Transitions
AnimatorListener class, Playing Animators Togethertranslation, Simple Property Animation
about, Playing Animators Together
.apk file, For the More Curious: The Android Build Processplay(Animator), Playing Animators Together
about, The App Bar
action views in, Using SearchView
app:showAsAction attribute, Defining a menu in XML
AppCompat vs Jetpack Compose, MaterialTheme
default from AppCompatActivity, The Default App Bar
menu (see menus)
previewing, Previewing the layout
terminology vs action bar, toolbar, For the More Curious: App Bar vs Action Bar vs Toolbar
app features, declaring in manifest, Declaring Featuresthemes and, The Default App Bar
about, The Default App Bar
app namespace, The app namespace
AppCompatActivity classJetpack Compose and, Removing AppCompat
application architectureActivity and ComponentActivity vs, Removing AppCompat
Google Guide to App Architecture, Accessing the Database Using the Repository Pattern
Application classsingle activity architecture, Performing Navigation
onCreate(), Accessing the Database Using the Repository Pattern
registering in manifest, Accessing the Database Using the Repository Pattern
application lifecycle, accessing, Accessing the Database Using the Repository Patternsubclassing, Accessing the Database Using the Repository Pattern
?attr/ syntax, Styles, Themes, and Theme AttributesJetpack Compose and, For the More Curious: Coroutines, Flow, and Compose
AttributeSet class, Creating BoxDrawingView(see also layout attributes, individual attribute names)
(see also threads)
doWork() and, Creating a Worker
for asynchronous network requests, Executing a web request
scheduling work on, Scheduling Work, Providing User Control over Polling
@Before annotation (JUnit), Instrumented Tests with Espresso and ActivityScenarioWorker and, Creating a Worker
(see also images)
resizing, Scaling and Displaying Bitmaps
bottom property (View), Simple Property Animationscaling and displaying, Scaling and Displaying Bitmaps
about, Adding more images
breakpoints, settingaligning children, The align modifier
build errors, Build issues(see also debugging)
build process, For the More Curious: The Android Build Process(see also debugging)
adding icons, Referencing resources in XML
adding IDs, Resources and resource IDs
Button class, Laying Out the UI
Button composable, Building Screens with Composables, CompositionLocal
ImageButton class, A Place for Your Photo
by keyword, Updating UIs with MutableStateTextButton composable, Setting the Dialog’s Content
about, Layouts in Compose
choosers, creating, Sending a crime reportimplementing state changes, Updating UIs with MutableState
(see also singletons)
abstract classes, Creating a database class
dependencies, For the More Curious: Managing Dependencies
code completion, Making Toastsimporting, Getting references to views
ArgbEvaluator and, Color evaluation
Column composable (Jetpack Compose)resources, Building the Scene
about, Layouts in Compose
Alignment parameter, Aligning elements in a row
companion objects, Using intent extrasArrangement parameter, Aligning elements in a row
Android Lint and, Safely adding code from later APIs
configuration qualifiers and, Configuration Qualifiers
fragments and, Different types of fragments
Jetpack libraries and, Different types of fragments
minimum SDK version and, Minimum SDK version
compile SDK version, Compile SDK versionusing conditional code for, Safely adding code from later APIs
about, Composing Your First UI
@Composable annotation, Composable Functions
@Preview annotation, Previewing Composables
accessing string resources in, Resources in Compose
adding background, Chaining modifiers and modifier ordering
adding padding, The padding modifier
aligning images in containers, Image alignment
alignment in nested layouts, Aligning elements in a row
alignment modifier, The align modifier
as functions, Composable Functions
as pure functions, Recomposition
aspectRatio modifier, aspectRatio
calling other functions, Composable Functions
composition hierarchy, CompositionLocal
control flow in, Control flow in a composable
creating, Composable Functions
fillMaxSize modifier, aspectRatio
focusable modifier, Adding more images
for app bars, Scaffold and TopAppBar
for checkboxes, Layouts in Compose
for column layouts, Layouts in Compose
for dialogs, Your First Dialog in Compose, Setting the Dialog’s Content
for images, Images
for layering content, Adding more images
for layouts, Scaffold and TopAppBar
for row layouts, Layouts in Compose
for scrollable lists, Scrollable Lists with LazyColumn
for text, Composing Your First UI
for text buttons, Setting the Dialog’s Content
making clickable, The clickable modifier
modifier parameter, The Compose Modifier
modifiers (see Modifier type (Jetpack Compose))
naming conventions, Composable Functions
nesting, Layouts in Compose
parameters for, Customizing Composables
positioning within a Box, The align modifier
previewing, Previewing Composables
recomposition, Recomposition
remembering state, remember
scaling images to containers, contentScale
size modifier, aspectRatio
sizing, Sizing composables
slotting, Scaffold and TopAppBar
state hoisting, State Hoisting
styles set by, CompositionLocal
styling text, Specifying text styles
Compose (see Jetpack Compose)trailing lambda syntax and, Dismissing the Dialog
about, CompositionLocal
accessing CompositionLocal variables, CompositionLocal
creating CompositionLocal variables, For the More Curious: Creating Your Own CompositionLocals
LocalContext, CompositionLocal
configuration changesMaterialTheme and, CompositionLocal
Application class and, Accessing the Database Using the Repository Pattern
effect on activities, Rotating an activity
effect on fragments, Implementing fragment lifecycle functions
networking and, Networking Across Configuration Changes
remember composable and, State and Configuration Changes
state in Jetpack Compose and, State and Configuration Changes
configuration qualifiersViewModel and, Persisting UI State
Android versions and, Configuration Qualifiers
for language, Localizing Resources
listed, Configuration Qualifiers
multiple, Multiple qualifiers
order of precedence, Prioritizing alternative resources
ConstraintLayout classfor screen size, For the More Curious: More on Determining Device Size
about, Introducing ConstraintLayout
converting layout to use, Introducing the Layout Editor
Guideline, For the More Curious: Advanced Features in ConstraintLayout
constraintsMotionLayout, For the More Curious: Advanced Features in ConstraintLayout
about, Introducing ConstraintLayout
adding in layout editor, Adding views
removing, Using ConstraintLayout
Constraints class, WorkRequest and, Scheduling Workwarnings when insufficient, Using ConstraintLayout
getting data from, Getting data from the contacts list
container view IDs, The FragmentManagerpermissions for, Contacts permissions
FileProvider convenience class, Using FileProvider
ContentResolver class, Getting data from the contacts listfor storing files shared among apps, File Storage
.Crop, contentScale
Context class.Fit, contentScale
explicit intents and, Communicating with intents
fileList(…), File Storage
functions for private files and directories, File Storage
getCacheDir(…), File Storage
getDir(…), File Storage
getFilesDir(), File Storage
MODE_WORLD_READABLE, File Storage
openFileInput(…), File Storage
openFileOutput(…), File Storage
contractsresource IDs and, Making Toasts
conventions (see naming conventions)(see also ActivityResultContracts class)
converter factories, Adding a String converter
coroutinesscalars converter, Adding a String converter
(see also Flow class, flows)
Activity class and, Using coroutines
builders, Using coroutines
Coroutines library, Using coroutines
CoroutineScope class, Using coroutines
enabling, Using coroutines
Fragment class and, Using coroutines, Consuming data from coroutines
Jetpack Compose and, For the More Curious: Coroutines, Flow, and Compose
launch function, Using coroutines
race conditions and, Consuming data from coroutines
Retrofit library and, Defining an API interface
scope, Using coroutines
suspending functions, An Introduction to Asynchronous Code on Android, Using coroutines
threads and, An Introduction to Asynchronous Code on Android
createChooser(…) function (Intent), Sending a crime reportViewModel class and, Using coroutines
using saved instance state, Saving Data Across Process Death
using ViewModel, ViewModel lifecycle
@Database annotation (Room), Creating a database classwith shared preferences, Simple Persistence with DataStore
(see also Room architecture component library)
accessing, Accessing the Database Using the Repository Pattern
data access objects (DAOs), Defining a Data Access Object
database classes, Creating a database class
entities, Defining entities
primary keys, Defining entities
repository pattern, Accessing the Database Using the Repository Pattern
saving changes to, Updating the Database
Structured Query Language (SQL), Defining a Data Access Object
DataStore library, Simple Persistence with DataStore, Defining UI Statetype conversion, Creating a type converter
about, Dialogs and DialogFragment, Passing data to DatePickerFragment
configuration changes and, Creating a DialogFragment
debug key, For the More Curious: The Android Build Processwrapping in DialogFragment, Creating a DialogFragment
(see also Android Lint, Android Studio)
about, Debugging Android Apps
build errors, Build issues
crashes, Exceptions and Stack Traces
logging stack traces vs setting breakpoints, Setting breakpoints
misbehaviors, Diagnosing misbehaviors
online help for, Build issues
running app with debugger, Setting breakpoints
stopping debugger, Setting breakpoints
declarative UI toolkit, defined, Philosophies of Stateusing breakpoints, Setting breakpoints
dependency injection (DI) design patterndeleting, MaterialTheme
design patternsinjectors, For the More Curious: Singletons
dependency injection (DI), For the More Curious: Singletons, For the More Curious: Managing Dependencies
factory software, Unidirectional Data Flow
repository, Accessing the Database Using the Repository Pattern, Moving toward the repository pattern
developer documentation, Using the Android Developer Documentationunidirectional data flow pattern, Unidirectional Data Flow
configurations
(see also configuration qualifiers)
configuring language settings, Localizing Resources
enabling developer options, Saving Data Across Process Death
hardware, Running on the Emulator
sandbox, File Storage
testing configurations, Testing Alternative Resources
devices view (Android Studio), Running on a Devicevirtual, Running on the Emulator
about, Creating a DialogFragment
dialogsonCreateDialog(Bundle?), Creating a DialogFragment
adding to navigation graphs, Showing a DialogFragment
in framework UI toolkit, Dialogs and DialogFragment
in Jetpack Compose, Showing Dialogs with Jetpack Compose
DiffUtil class, For the More Curious: A Smarter Adapter with ListAdapterpassing data to, Passing Data Between Two Fragments
Canvas, Rendering Inside onDraw(Canvas)
in onDraw(Canvas), Rendering Inside onDraw(Canvas)
about, Navigating in Android Studio
EditText class, Defining CrimeDetailFragment’s layoutlayout editor, Introducing the Layout Editor
creating a virtual device for, Running on the Emulator
enabling developer options, Saving Data Across Process Death
installing, Downloading Earlier SDK Versions
Quick Settings, Rotating GeoQuiz
rotating, Referencing resources in XML, Rotating GeoQuiz
running on, Running on the Emulator
search queries on, Responding to SearchView user interactions
enqueue(…) function (WorkManager), Scheduling Worksimulating network types, Scheduling Work
(see also debugging, exceptions)
Android Studio indicators, Getting references to views
DEBUG log level, For the More Curious: Log Levels
ERROR log level, For the More Curious: Log Levels
INFO log level, For the More Curious: Log Levels
VERBOSE log level, For the More Curious: Log Levels
escape sequence (in strings), Updating the LayoutWARNING log level, For the More Curious: Log Levels
about, Logging stack traces
ActivityNotFoundException, Communicating with intents
creating, Logging stack traces
IllegalStateException, ViewModel lifecycle, Accessing the Database Using the Repository Pattern
in Logcat, Running on the Emulator, Exceptions and Stack Traces
java.lang exceptions in Kotlin code, Exceptions and Stack Traces
kotlin.RuntimeException, Exceptions and Stack Traces
logging, For the More Curious: Log Levels
Resources.NotFoundException, Default resources
type-aliasing and, Exceptions and Stack Traces
explicit intentsUninitializedPropertyAccessException, Exceptions and Stack Traces, Deserializing JSON text into model objects
creating, Communicating with intents
Explore by Touch, Explore by Touchimplicit intents vs, Explicit and implicit intents, Implicit Intents, Using Implicit Intents
about, Using intent extras
as key-value pairs, Using intent extras
naming, Using intent extras
putting, Using intent extras
retrieving, Using intent extras
structure, Using intent extras
authorities, Using FileProvider
granting write permission, Using FileProvider
private, File Storage
file types, for images, Imagesshared between apps, File Storage
about, Using FileProvider
findNavController function (Activity, Fragment), Navigating to the detail screengetUriForFile(…), Using a Camera Intent
(see also flows)
collect {} function, Keeping the Changes Flowing
MutableStateFlow, Keeping the Changes Flowing
flowsStateFlow, Keeping the Changes Flowing
about, Keeping the Changes Flowing
fluent interface, defined, The FragmentManagerdatabases and, Keeping the Changes Flowing
findNavController, Navigating to the detail screen
lifecycleScope, Consuming data from coroutines
onActivityCreated(Bundle?), The fragment lifecycle
onAttach(Context?), The fragment lifecycle
onCreate(Bundle?), Implementing fragment lifecycle functions, The fragment lifecycle
onCreateOptionsMenu(…), Creating the menu
onCreateView(…), Implementing fragment lifecycle functions, The fragment lifecycle
onDestroy(), The fragment lifecycle
onDestroyView(), The fragment lifecycle
onDetach(), The fragment lifecycle
onOptionsItemSelected(MenuItem), Creating the menu, Responding to menu selections
onPause(), The fragment lifecycle
onResume(), The fragment lifecycle
onStart(), The fragment lifecycle
onStop(), The fragment lifecycle
onViewCreated(…), The fragment lifecycle
setFragmentResultListener, Setting a fragment result
setHasOptionsMenu(Boolean), Creating the menu
startActivity(Intent), Sending a crime report
versions, Different types of fragments
viewLifecycleScope, Consuming data from coroutines
Fragment Results API, Passing Data Between Two Fragmentsvisibility of lifecycle functions, Implementing fragment lifecycle functions
FragmentContainerView class, Defining a FragmentContainerView(see also FragmentTransaction class)
adding fragments, The FragmentManager
beginTransaction(), The FragmentManager
fragment lifecycle functions and, The fragment lifecycle
fragmentsresponsibilities, The FragmentManager
(see also Fragment class, FragmentContainerView class, FragmentManager class, FragmentTransaction class)
activities vs, The Need for UI Flexibility
activity lifecycle and, The fragment lifecycle
adding a fragment to an activity, The FragmentManager
adding to FragmentManager, The FragmentManager
as composable units, The Need for UI Flexibility
compatibility and, Different types of fragments
container view IDs, The FragmentManager
creating, Creating a Fragment
hosting, Starting CriminalIntent, Defining a FragmentContainerView
implementing lifecycle functions, Implementing fragment lifecycle functions
inflating layouts for, Implementing fragment lifecycle functions
Jetpack libraries and, Different types of fragments
lifecycle, Implementing fragment lifecycle functions, The fragment lifecycle
lifecycle functions, The fragment lifecycle
memory management and, Fragments and memory management
reasons for, The Need for UI Flexibility
setting listeners in, Wiring up views in a fragment
transactions, The FragmentManager
UI flexibility and, The Need for UI Flexibility
using Jetpack (androidx) version, Creating the CrimeDetailFragment class
FragmentTransaction classviews and, Wiring up views in a fragment
about, The FragmentManager
functionsadd(…), The FragmentManager
assertions, JVM Tests
pure, Recomposition
side effects, Recomposition
suspending with coroutines, An Introduction to Asynchronous Code on Android, Using coroutines
about, Images
alignment property, Image alignment
contentDescription, Image’s contentDescription
ImageButton class, A Place for Your PhotocontentScale property, contentScale
displaying with Coil library, Displaying images
image types, Images
implicit intentsscaling and displaying bitmaps, Scaling and Displaying Bitmaps
action, Parts of an implicit intent
ACTION_CALL category, Challenge: Another Implicit Intent
ACTION_DIAL category, Challenge: Another Implicit Intent
ACTION_PICK category, Asking Android for a contact
ACTION_SEND category, Sending a crime report
benefits of using, Implicit Intents
categories, Parts of an implicit intent
explicit intents vs, Explicit and implicit intents, Implicit Intents, Using Implicit Intents
extras, Parts of an implicit intent
FLAG_GRANT_READ_URI_PERMISSION flag, Contacts permissions
for browsing web content, The Easy Way: Implicit Intents
LAUNCHER category, How Android Sees Your Activities
MAIN category, How Android Sees Your Activities
inflating layouts, From Layout XML to View Objects, Implementing fragment lifecycle functionsparts of, Parts of an implicit intent
about, Two Types of Tests
ActivityScenario, Instrumented Tests with Espresso and ActivityScenario
creating, Instrumented Tests with Espresso and ActivityScenario
Intent classJUnit framework, JVM Tests
about, Using Implicit Intents
constructors, Communicating with intents, Sending a crime report
createChooser(…), Sending a crime report
getBooleanExtra(…), Using intent extras
intent filtersputExtra(…), Using intent extras
Intent.FLAG_GRANT_READ_URI_PERMISSION flag, Contacts permissionsexplained, Parts of an implicit intent
(see also explicit intents, extras, implicit intents, Intent class, intent filters)
about, Communicating with intents
checking for responding activities, Checking for responding activities
communicating with, Communicating with intents
companion objects and, Using intent extras
extras, Using intent extras
implicit vs explicit, Explicit and implicit intents, Implicit Intents, Using Implicit Intents
permissions and, Contacts permissions
Interceptor interface (OkHttp library), Searching Flickrsetting results, Setting a result
about, Two Types of Tests
creating, JVM Tests
JavaScript Object Notation (JSON) (see JSON (JavaScript Object Notation))JUnit framework, JVM Tests
@Composable annotation, Composable Functions
@Preview annotation, Previewing Composables
accessibility in, Explore by Touch, Image’s contentDescription, Adding more images
Accompanist library, For the More Curious: Accompanist
adding to a project, Creating a Compose Project
AppCompat foundation library and, Removing AppCompat
AppCompat themes vs, MaterialTheme
as a declarative toolkit, Philosophies of State
asynchronous code and, For the More Curious: Coroutines, Flow, and Compose
Checkbox composable, Layouts in Compose
Column composable, Layouts in Compose, Aligning elements in a row
composable modifiers (see Modifier type (Jetpack Compose))
composables (see composables, individual composable names)
composition hierarchy, CompositionLocal
CompositionLocal class
(see also CompositionLocal class (Jetpack Compose))
coroutines and, For the More Curious: Coroutines, Flow, and Compose
displaying images, Images
Kotlin versions and, Creating a Compose Project
LazyColumn composable, Scrollable Lists with LazyColumn
LazyRow composable, Scrollable Lists with LazyColumn
live literals, For the More Curious: Live Literals
MaterialTheme composable, MaterialTheme
MaterialTheme object, Specifying text styles, MaterialTheme
Modifier type
(see also Modifier type (Jetpack Compose))
previewing layouts, Previewing Composables
recomposition, Recomposition
remember composable, remember
rememberSaveable composable, State and Configuration Changes
Row composable, Layouts in Compose, Aligning elements in a row
Scaffold composable, Scaffold and TopAppBar
scrollable lists in, Scrollable Lists with LazyColumn
setContent, Composing Your First UI
sizing UI elements, Sizing composables
state hoisting, State Hoisting
state in
(see also state in Jetpack Compose)
stringResource(Int), Resources in Compose
styles set by composables, CompositionLocal
Text composable, Composing Your First UI, Specifying text styles
themes, MaterialTheme
TopAppBar composable, Scaffold and TopAppBar
Jetpack librariestrailing lambda syntax and, Dismissing the Dialog
(see also libraries, individual library names)
about, For the More Curious: Jetpack, AndroidX, and Architecture Components
androidx.activity package, Including the ViewModel Dependency
androidx.lifecycle package, Including the ViewModel Dependency
Job class, Consuming data from coroutinesfor backward compatibility, Jetpack libraries
about, Fetching JSON from Flickr
deserializing, Deserializing JSON text into model objects
Moshi library and, Deserializing JSON text into model objects
@Json annotation, Deserializing JSON text into model objects
coroutines (see coroutines)
enabling in an Android Studio project, Creating an Android Project
exceptions, compiled to java.lang exceptions, Exceptions and Stack Traces
functions public by default, Implementing fragment lifecycle functions
Kotlin annotation processing tool (kapt), Room architecture component library
Kotlin files in java directory, From Layout XML to View Objects
kotlin.RuntimeException class, Exceptions and Stack Tracessingle abstract method interfaces (SAMs) and, Setting listeners
android:id, Resources and resource IDs
android:layout_height, android:layout_width and android:layout_height
android:layout_margin, For the More Curious: Margins vs Padding
android:layout_width, android:layout_width and android:layout_height
android:orientation, android:orientation
android:padding, For the More Curious: Margins vs Padding
layout constraints (see constraints)android:text, android:text
(see also constraints, layout attributes, layout editor (Android Studio))
about, App Basics
animating, For the More Curious: Advanced Features in ConstraintLayout
defining in XML, Laying Out the UI
design guidelines, Editing properties
inflating, From Layout XML to View Objects, Implementing fragment lifecycle functions
naming, Laying Out the UI
nested vs flat, Creating User Interfaces with Layouts and Views
previewing (Jetpack Compose), Previewing Composables
previewing (XML layouts), Previewing the layout
previewing device configurations, Testing Alternative Resources
for property animation, Building the Scene
root element, The view hierarchy
testing, Testing Alternative Resources
using guidelines, For the More Curious: Advanced Features in ConstraintLayout
view groups and, Laying Out the UI
LazyColumn composable (Jetpack Compose)view hierarchy and, The view hierarchy
itemsIndexed, Scrollable Lists with LazyColumn
RecyclerView vs, Scrollable Lists with LazyColumn
LazyRow composable (Jetpack Compose)state in, For the More Curious: Scrolling State
itemsIndexed, Scrollable Lists with LazyColumn
left property (View), Simple Property AnimationRecyclerView vs, Scrollable Lists with LazyColumn
adding to projects, Including the ViewModel Dependency
lifecycle callbacks, Activity States and Lifecycle Callbacksremoving from project, MaterialTheme
about, For the More Curious: A Smarter Adapter with ListAdapter
listenersDiffUtil and, For the More Curious: A Smarter Adapter with ListAdapter
about, Setting listeners
as interfaces, Setting listeners
setting in fragments, Wiring up views in a fragment
listssetting up, Setting listeners
displaying, Displaying Lists with RecyclerView
getting item data, Implementing an Adapter to Populate the RecyclerView
ListView class, Lists and Grids: Past, Present, and Futurein Jetpack Compose, Scrollable Lists with LazyColumn
about, Localization
creating values resource files, Localizing Resources
default resources and, Default resources
language qualifiers, Localizing Resources
language-region qualifiers, Targeting a region
other configuration qualifiers and, Prioritizing alternative resources
testing, Testing Alternative Resources
Log classTranslations Editor, Checking string coverage using the Translations Editor
d(…), Making log messages, For the More Curious: Log Levels, Logging stack traces
levels, For the More Curious: Log Levels
logging messages, Making log messages
Logcat
(see also logging)
about, Using Logcat
filtering, Running on the Emulator, Using Logcat, ViewModel lifecycle
logging messages, Making log messages
setting log level, Exceptions and Stack Traces
loggingwrapping output, Fetching JSON from Flickr
exceptions, Logging stack traces
messages, Making log messages
stack traces, Logging stack traces
TAG constant, Making log messages
<meta-data> tag, Using FileProvider
<uses-feature> tag, Declaring Features
adding network permissions, Asking permission to network
adding uses-permission, Asking permission to network
build process and, For the More Curious: The Android Build Process
declaring Activity in, Declaring activities in the manifest
margins, For the More Curious: Margins vs Paddingdisclosing queries, Disclosing queries
about, MaterialTheme
CompositionLocal and, CompositionLocal
nested, CompositionLocal
MaterialTheme object (Jetpack Compose)scope, CompositionLocal
about, Specifying text styles, MaterialTheme
memory leaks, ViewModel lifecycletext styles, Specifying text styles
(see also app bar)
about, Menus
action items, Menus
app:showAsAction attribute, Defining a menu in XML
creating, Creating the menu
creating XML file for, Defining a menu in XML
defining in XML, Defining a menu in XML
determining selected item, Responding to menu selections
overflow menu, Defining a menu in XML
populating with items, Creating the menu
as resources, Defining a menu in XML
<meta-data> tag, Using FileProviderresponding to selections, Responding to menu selections
about, The Compose Modifier
alignment, The align modifier
aspectRatio, aspectRatio
background, Chaining modifiers and modifier ordering
clickable, The clickable modifier
fillMaxSize, aspectRatio
focusable, Adding more images
ordering modifiers, Chaining modifiers and modifier ordering
padding, The padding modifier
size, aspectRatio
Moshi libraryweight, Sizing composables
@Json annotation, Deserializing JSON text into model objects
motion events, handling, Handling Touch Events@JsonClass annotation, Deserializing JSON text into model objects
about, Handling Touch Events
actions, Handling Touch Events
MotionLayout class, For the More Curious: Advanced Features in ConstraintLayoutgetAction(), Handling Touch Events
activity states and, For the More Curious: UI Updates and Multi-Window Mode
MutableState interface (Jetpack Compose)multi-resume support, For the More Curious: UI Updates and Multi-Window Mode
mutableStateOf function (MutableState), Updating UIs with MutableStatemutableStateOf, Updating UIs with MutableState
Android resource XML, The view hierarchy
app, The app namespace
naming conventionstools, Updating the Layout, Implementing the Navigation component library
classes, Navigating in Android Studio
composables, Composable Functions
extras, Using intent extras
file sharing authorities, Using FileProvider
icons, Adding views
layouts, Laying Out the UI
menu files, Defining a menu in XML
packages, Creating an Android Project
screens in Jetpack Compose, Building Screens with Composables
test classes, JVM Tests
test functions, JVM Tests
NavController class, Navigating to the detail screenunused parameters, Wiring up views in a fragment
(see also Navigation Jetpack component library)
Activity lifecycle and, For the More Curious: The Back Button and the Activity Lifecycle
navigation graphs (Navigation Jetpack component library)Back button, For the More Curious: The Back Button and the Activity Lifecycle
about, Performing Navigation
adding destinations, Implementing the Navigation component library
adding dialogs, Showing a DialogFragment
defining actions, Navigating to the detail screen
Navigation Jetpack component librarypreviews, Implementing the Navigation component library, For the More Curious: A Better List Preview
about, Performing Navigation
findNavController, Navigating to the detail screen
NavController, Navigating to the detail screen
NavHostFragment, Navigating to the detail screen
navigation graphs
(see also navigation graphs (Navigation Jetpack component library))
performing navigations, Navigating to the detail screen
networkingSafe Args Gradle plugin and, Passing data to a fragment
configuration changes and, Networking Across Configuration Changes
limiting by network type, Scheduling Work
permissions, Asking permission to network
providing user control, Providing User Control over Polling
nonexistent activity state, Activity States and Lifecycle Callbacksscheduling, Scheduling Work, Providing User Control over Polling
(see also notifications)
about, Notifying the User
NotificationCompat class, Notifying the UserNotificationManager and, Notifying the User
Notification and, Notifying the User
notificationsnotify(…), Notifying the User
about, Notifying the User
configuring, Notifying the User
notify(…) function (NotificationManager), Notifying the Usernotification channels, Notifying the User
about, Querying the PackageManager
packagesresolveActivity(…), Querying the PackageManager
creating, Creating a database class
padding, For the More Curious: Margins vs Paddingnaming, Creating an Android Project
about, Images
painterResource function (Painter), ImagespainterResource, Images
about, Challenge: Saving State, State and Configuration Changes
PeriodicWorkRequest class (WorkRequest), Scheduling Work, Providing User Control over Pollingimplementing with Parcelize plugin, Parcelable and Parcelize
adding to manifest, Asking permission to network
android:authorities attribute, Using FileProvider
android:exported attribute, Using FileProvider
android:grantUriPermissions attribute, Using FileProvider
for contacts database, Contacts permissions
Intent.FLAG_GRANT_READ_URI_PERMISSION flag, Contacts permissions
INTERNET, Asking permission to network
normal, Asking permission to network
Request App Permissions guide, Challenge: Another Implicit Intent
PhotoView class, Scaling and Displaying Bitmapsruntime, Challenge: Another Implicit Intent
adding dependencies, Including the ViewModel Dependency
adding resources, Adding an Icon
app/java directory, From Layout XML to View Objects
configuring, Creating an Android Project
creating, Creating an Android Project
deleting dependencies, MaterialTheme
layout, Laying Out the UI
res/layout directory, Resources and resource IDs
res/menu directory, Defining a menu in XML
res/values directory, Resources and resource IDs
setting package name, Creating an Android Project
property animation (see animation)setting project name, Creating an Android Project
disclosing, Disclosing queries
@Query annotationfor apps, Checking for responding activities
in Retrofit, Searching Flickr
in Room, Defining a Data Access Object
about, Adding a RecyclerView
animations, Lists and Grids: Past, Present, and Future
as a ViewGroup, Creating an Item View Layout
creating views, Recycling Views
item views, Creating an Item View Layout
LayoutManager and, Implementing a LayoutManager
LazyColumn or LazyRow vs, Scrollable Lists with LazyColumn
ListAdapter and, For the More Curious: A Smarter Adapter with ListAdapter
ListView and GridView vs, Lists and Grids: Past, Present, and Future
setOnItemClickListener(…), The Easy Way: Implicit Intents
RecyclerView.Adapter classViewHolder and, Implementing a ViewHolder
getItemCount(), Implementing an Adapter to Populate the RecyclerView
ListAdapter vs, For the More Curious: A Smarter Adapter with ListAdapter
notifyDataSetChanged(…), For the More Curious: A Smarter Adapter with ListAdapter
notifyItemInserted(…), For the More Curious: A Smarter Adapter with ListAdapter
notifyItemMoved(…), For the More Curious: A Smarter Adapter with ListAdapter
onBindViewHolder(…), Implementing an Adapter to Populate the RecyclerView
release key, For the More Curious: The Android Build ProcessonCreateViewHolder(…), Implementing an Adapter to Populate the RecyclerView
about, Resources and resource IDs
resources+ prefix in, Resources and resource IDs
(see also color, configuration qualifiers, drawables, layouts, menus, string resources)
about, Resources and resource IDs
adding, Adding an Icon
alternative, Prioritizing alternative resources
assets vs, Importing Prepopulated Data
default, Default resources
directories, Resources and resource IDs
localizing, Localization
Resources.NotFoundException class, Default resourcesreferencing in XML, Referencing resources in XML
@GET annotation, Defining an API interface
baseUrl(…) function, Building the Retrofit object and creating an API instance
build() function, Building the Retrofit object and creating an API instance
Converter.Factory class, Adding a String converter
coroutines and, Defining an API interface
create() function, Building the Retrofit object and creating an API instance
defining an API interface, Defining an API interface
HTTP request method annotations, Defining an API interface
Retrofit.Builder() class, Building the Retrofit object and creating an API instance
Retrofit.Builder() class (Retrofit)scalars converter, Adding a String converter
about, Building the Retrofit object and creating an API instance
baseUrl(…), Building the Retrofit object and creating an API instance
right property (View), Simple Property Animationbuild(), Building the Retrofit object and creating an API instance
@Dao annotation, Defining a Data Access Object
@Database annotation, Creating a database class
@Entity annotation, Defining entities
@Insert annotation, Responding to menu selections
@PrimaryKey annotation, Defining entities
@Query annotation, Defining a Data Access Object
@TypeConverter annotation, Creating a type converter
@TypeConverters annotation, Creating a type converter
@Update annotation, Updating the Database
accessing a database, Accessing the Database Using the Repository Pattern
adding database properties, Adding a Suspect Property
addMigrations(…), Adding a Suspect Property
defining a data access object (DAO), Defining a Data Access Object
defining a database class, Creating a database class
defining database entities, Defining entities
defining database primary key, Defining entities
instantiating a database, Accessing the Database Using the Repository Pattern
Migration classes, Adding a Suspect Property
Room.databaseBuilder(), Accessing the Database Using the Repository Pattern
setting up a database, Creating a Database
specifying type converters, Creating a type converter
SQL commands, Defining a Data Access Object
SQLite in, Creating a type converter
rotation (see configuration changes)updating database version, Adding a Suspect Property
about, Layouts in Compose
Alignment parameter, Aligning elements in a row
running on device, Running on a DeviceArrangement parameter, Aligning elements in a row
about, Scaffold and TopAppBar
content, Scaffold and TopAppBar
scale-independent pixel (sp), Screen Pixel DensitiestopBar, Scaffold and TopAppBar
(see also compatibility)
about, Compile SDK version
configuration qualifiers and, Configuration Qualifiers
installing, Downloading Earlier SDK Versions
searchupdating, Downloading Earlier SDK Versions
about, SearchView and DataStore
integrating into app, SearchView and DataStore
SearchView classuser-initiated, Using SearchView
about, Using SearchView
OnQueryTextListener(…), Responding to SearchView user interactions
setContent function (Jetpack Compose), Composing Your First UIresponding to user interactions, Responding to SearchView user interactions
activity/fragment lifecycles and, Accessing the Database Using the Repository Pattern
source sets, Two Types of Testsbenefits and drawbacks, For the More Curious: Singletons
in Logcat, Exceptions and Stack Traces
startActivity(Intent) function (Activity), Starting an Activity, Sending a crime reportlogging, Logging stack traces
about, Philosophies of State, Showing Dialogs with Jetpack Compose
changes to state objects vs properties, Updating UIs with MutableState
configuration changes and, State and Configuration Changes
delegation and, Updating UIs with MutableState
dialogs and UI state, Showing Dialogs with Jetpack Compose
MutableState and, Updating UIs with MutableState
@string/ syntax, android:textresponding to changes in application state, Updating UIs with MutableState
about, android:text
@StringRes annotation, Creating a New Class
about, android:text
creating, Creating string resources
referencing, Referencing resources in XML
@StringRes annotation, Creating a New Classres/values/strings.xml, Creating string resources
/res/values/themes.xml file, Styles, Themes, and Theme Attributes
creating custom styles, Styles, Themes, and Theme Attributes
suspend modifier, Using coroutinesMaterial Design and, Styles, Themes, and Theme Attributes
about, TalkBack
Android views’ inherent support, Explore by Touch
enabling, TalkBack
linear navigation by swiping, Linear navigation by swiping
target SDK version, Target SDK versionnon-text elements and, Adding content descriptions
@After annotation (JUnit), Instrumented Tests with Espresso and ActivityScenario
@Before annotation (JUnit), Instrumented Tests with Espresso and ActivityScenario
@RunWith(AndroidJUnit4::class) annotation (JUnit), Instrumented Tests with Espresso and ActivityScenario
@Test annotation (JUnit), JVM Tests
creating tests, JVM Tests
instrumented
(see also instrumented tests)
Java Virtual Machine (JVM)
(see also Java Virtual Machine (JVM) tests)
JUnit framework, JVM Tests
running tests, JVM Tests
setup, test, verify pattern, JVM Tests
unit, Testing
Text composable (Jetpack Compose)using ActivityScenario, Instrumented Tests with Espresso and ActivityScenario
about, Composing Your First UI
style parameter, Specifying text styles
TextButton composable (Jetpack Compose), Setting the Dialog’s Contentstyles set by, CompositionLocal
example, Laying Out the UI
setText(Int), Using intent extras
themestools:text and, Updating the Layout
(see also styles)
?attr/ syntax for attributes, Styles, Themes, and Theme Attributes
app bar and, The Default App Bar
AppCompat vs Jetpack Compose, MaterialTheme
default, The Default App Bar
in Jetpack Compose, MaterialTheme
referencing theme attributes, Styles, Themes, and Theme Attributes
threadstheme attributes, Styles, Themes, and Theme Attributes
background, An Introduction to Asynchronous Code on Android
(see also background threads)
coroutines and, An Introduction to Asynchronous Code on Android
ticker text, Notifying the Usermain (UI), An Introduction to Asynchronous Code on Android, Executing a web request
makeText(…), Making Toasts
toasts, Making Toastsshow(), Making Toasts
action constants, Handling Touch Events
handling, Responding to Presses, Handling Touch Events
handling with GestureDetectorCompat, For the More Curious: Detecting Gestures
MotionEvent and, Handling Touch Events
transformation propertiesrecommended minimum size for touch targets, For the More Curious: Using Accessibility Scanner
pivotX, View transformation properties
pivotY, View transformation properties
rotation, View transformation properties
scaleX, View transformation properties
scaleY, View transformation properties
translationX, View transformation properties
transitions framework, for animation, TransitionstranslationY, View transformation properties
creating shareable instances, Using a Camera Intent
user interfacesFileProvider.getUriForFile(…) and, Using a Camera Intent
activities vs fragments in, The Need for UI Flexibility
declarative vs imperative, Introduction to Jetpack Compose
defined by layout, App Basics
flexibility in, The Need for UI Flexibility
framework UI toolkit vs Jetpack Compose, Introduction to Jetpack Compose
<uses-feature> tag, Declaring Featureslaying out, Laying Out the UI
about, Wiring Up the User Interface
View classmemory management and, Fragments and memory management
(see also views)
bottom, Simple Property Animation
Button, Laying Out the UI
CheckBox, Defining CrimeDetailFragment’s layout
doOnLayout(), Scaling and Displaying Bitmaps
draw(), Rendering Inside onDraw(Canvas)
EditText, Defining CrimeDetailFragment’s layout
height, Simple Property Animation
invalidate(), Tracking across motion events
LinearLayout, Laying Out the UI, The view hierarchy
OnClickListener interface, Setting listeners
onDraw(Canvas), Rendering Inside onDraw(Canvas)
onRestoreInstanceState(Parcelable), Challenge: Saving State
onSaveInstanceState(), Challenge: Saving State
onTouchEvent(MotionEvent), Handling Touch Events
OnTouchListener interface, Handling Touch Events
right, Simple Property Animation
setOnClickListener(OnClickListener), Setting listeners
setOnTouchListener(…), Handling Touch Events
subclasses, Laying Out the UI
tag property, Scaling and Displaying Bitmaps
TextView, Laying Out the UI, Updating the Layout
ViewGroup class, Laying Out the UI, The view hierarchy
about, Implementing a ViewHolder
ViewModel classitemView property, Implementing a ViewHolder
about, Persisting UI State
activity lifecycle and, ViewModel lifecycle
constructors, Unidirectional Data Flow
fragment lifecycle and, ViewModel lifecycle with fragments, Networking Across Configuration Changes
onCleared(), Adding a ViewModel
for storage, Adding a New Fragment and ViewModel
ViewModelProvider.Factory interface, Unidirectional Data Flow
viewModels() property delegate, Adding a ViewModel
viewsviewModelScope, Using coroutines
about, Laying Out the UI
action, Using SearchView
adding in layout editor, Adding views
attributes, Laying Out the UI
creating custom views, Creating a Custom View
creation by RecyclerView, Recycling Views
custom, Creating a Custom View
defining in XML, Laying Out the UI
downsides of framework UI toolkit, Introduction to Jetpack Compose
draw order, Simple Property Animation
for buttons, Laying Out the UI
for checkboxes, Defining CrimeDetailFragment’s layout
for displaying text, Laying Out the UI, Updating the Layout
for laying out other views, Laying Out the UI
for text entry, Defining CrimeDetailFragment’s layout
hierarchy, The view hierarchy
invalid, Rendering Inside onDraw(Canvas)
persisting, Challenge: Saving State
references, Getting references to views
simple vs composite, Creating a Custom View
size settings, Making room
TalkBack and, Explore by Touch
title attribute and accessibility, Linear navigation by swiping
touch events and, Handling Touch Events
UI state in framework views, Philosophies of State
using fully qualified name in layout, Creating BoxDrawingView
view groups, Laying Out the UI
wiring up, Wiring Up Views
virtual devices (see emulator)wiring up in fragments, Wiring up views in a fragment
browsing via implicit intent, The Easy Way: Implicit Intents
displaying within an activity, The Harder Way: WebView
enabling JavaScript, The Harder Way: WebView
web rendering events, responding to, The Harder Way: WebViewin Chrome Custom Tabs, For the More Curious: Chrome Custom Tabs (Another Easy Way)
about, WebChromeClient
for enhancing appearance of WebView, WebChromeClient
onProgressChanged(…), WebChromeClient
WebSettings class, The Harder Way: WebViewonReceivedTitle(…), WebChromeClient
custom UI vs, WebView vs a Custom UI
for presenting web content, The Harder Way: WebView
WebViewClient classWebViewClient and, The Harder Way: WebView
about, The Harder Way: WebView
shouldOverrideUrlLoading(…), The Harder Way: WebView
work requestsWebView and, The Harder Way: WebView
Worker classconstraints for, Scheduling Work
about, Creating a Worker
doWork(), Creating a Worker
enabling and disabling, Providing User Control over Polling
WorkManager architecture component libraryscheduling with WorkRequest, Scheduling Work, Providing User Control over Polling
about, WorkManager
Constraints, Scheduling Work
Worker, Creating a Worker
WorkManager class, enqueue(…), Scheduling WorkWorkRequest, Creating a Worker
about, Creating a Worker
Constraints and, Scheduling Work
scheduling a Worker, Scheduling Work, Providing User Control over Polling
wrap_content, android:layout_width and android:layout_heightsubclasses, Scheduling Work