Index

A B C D E F G H I J K L M N O P Q R S T U V W X

Symbols

%1$s, %2$s, etc. syntax, Using a Format String
.apk file, For the More Curious: The Android Build Process
<meta-data> tag, Using FileProvider
<uses-feature> tag, Declaring Features
?attr/ syntax, Styles, Themes, and Theme Attributes
@+id, Resources and resource IDs
@After annotation (JUnit), Instrumented Tests with Espresso and ActivityScenario
@Before annotation (JUnit), Instrumented Tests with Espresso and ActivityScenario
@Composable annotation (Jetpack Compose), Composable Functions
@Dao annotation (Room), Defining a Data Access Object
@Database annotation (Room), Creating a database class
@drawable/ syntax, Referencing resources in XML
@Entity annotation (Room), Defining entities
@GET annotation (Retrofit), Defining an API interface
@Insert annotation (Room), Responding to menu selections
@Json annotation (Moshi), Deserializing JSON text into model objects
@JsonClass annotation (Moshi), Deserializing JSON text into model objects
@Preview annotation (Jetpack Compose), Previewing Composables
@PrimaryKey annotation (Room), Defining entities
@Query annotation

in Retrofit, Searching Flickr

in Room, Defining a Data Access Object

@RequiresApi annotation, Safely adding code from later APIs
@RunWith(AndroidJUnit4::class) annotation (JUnit), Instrumented Tests with Espresso and ActivityScenario
@string/ syntax, android:text
@StringRes annotation, Creating a New Class
@style/ syntax, Styles, Themes, and Theme Attributes
@Test annotation (JUnit), JVM Tests
@TypeConverter annotation (Room), Creating a type converter
@TypeConverters annotation (Room), Creating a type converter
@Update annotation (Room), Updating the Database

A

aapt2 (Android Asset Packing tool), For the More Curious: The Android Build Process
abstract classes, Creating a database class
AccelerateInterpolator class, Using different interpolators
accessibility

(see also TalkBack)

about, Accessibility, Creating a Comparable Experience

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

View.contentDescription, Creating a Comparable Experience

Accompanist library (Jetpack Compose), For the More Curious: Accompanist
action items (see menus)
action views, Using SearchView
ActionBar class, For the More Curious: App Bar vs Action Bar vs Toolbar
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
activities

(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

stack, How Android Sees Your Activities

starting, defined, Your Second Activity

starting, in another application, Implicit Intents

starting, with startActivity(Intent), Starting an Activity

states, Activity States and Lifecycle Callbacks

UI flexibility and, The Need for UI Flexibility

Activity class

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

startActivity(Intent), Starting an Activity, Sending a crime report

ActivityManager class

back stack, How Android Sees Your Activities

starting activities, Starting an Activity, Sending back an intent

ActivityNotFoundException class, Communicating with intents
ActivityResultContracts class

about, Getting a result back from a child activity

PickContact, Asking Android for a contact

StartActivityForResult, Getting a result back from a child activity

TakePicture, Using a Camera Intent

ActivityScenario class, Instrumented Tests with Espresso and ActivityScenario
Adapter class (RecyclerView)

about, Implementing an Adapter to Populate the RecyclerView

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

onCreateViewHolder(…), Implementing an Adapter to Populate the RecyclerView

adb (Android Debug Bridge) driver, Running on a Device
add(…) function (FragmentTransaction), The FragmentManager
addMigrations(…) function (Room), Adding a Suspect Property
@After annotation (JUnit), Instrumented Tests with Espresso and ActivityScenario
Alignment interface (Jetpack Compose)

.Center, Image alignment

.TopEnd, Image alignment

.TopStart, Image alignment

Android Asset Packing tool (aapt), For the More Curious: The Android Build Process
Android Debug Bridge (adb) driver, Running on a Device
Android developer documentation, Using the Android Developer Documentation
Android Lint

as code inspector, Creating a New Class

as static analyzer, Using Android Lint

compatibility and, Safely adding code from later APIs

running, Using Android Lint

Android manifest (see manifest)
Android SDK Manager, Downloading Earlier SDK Versions
Android Studio

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

(see also Logcat, logging)

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

variables view, Setting breakpoints

Android Virtual Device Manager, Running on the Emulator
Android Virtual Devices (AVDs), creating, Running on the Emulator
Android XML namespace, The view hierarchy
android.text.format.DateFormat class, Challenge: Formatting the Date
android.util.Log class (see Log class)
android.view.animation package, Legacy animation tools
android:authorities attribute, Using FileProvider
android:contentDescription attribute, Adding content descriptions
android:exported attribute, Using FileProvider
android:focusable attribute, Making a view focusable
android:grantUriPermissions attribute, Using FileProvider
android:id attribute, Resources and resource IDs
android:labelFor attribute, Challenge: Providing Enough Context for Data Entry
android:layout_gravity attribute, Displaying Results in RecyclerView
android:layout_height attribute, android:layout_width and android:layout_height
android:layout_margin attribute, For the More Curious: Margins vs Padding
android:layout_width attribute, android:layout_width and android:layout_height
android:name attribute, Declaring activities in the manifest, Defining a FragmentContainerView, The FragmentManager
android:orientation attribute, android:orientation
android:padding attribute, For the More Curious: Margins vs Padding
android:required attribute, Declaring Features
android:scaleType attribute, Displaying Results in RecyclerView
android:text attribute, android:text
AndroidManifest.xml (see manifest)
AndroidX (see Jetpack libraries)
androidx.activity:activity-ktx architecture component library (androidx.lifecycle), Including the ViewModel Dependency
androidx.lifecycle:lifecycle-viewmodel-ktx architecture component library (androidx.lifecycle), Including the ViewModel Dependency
animation

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

translation, Simple Property Animation

AnimatorListener class, Playing Animators Together
AnimatorSet class

about, Playing Animators Together

play(Animator), Playing Animators Together

.apk file, For the More Curious: The Android Build Process
app bar

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

themes and, The Default App Bar

app features, declaring in manifest, Declaring Features
app namespace, The app namespace
app/build.gradle file, Including the ViewModel Dependency
app/java directory, From Layout XML to View Objects
app:actionViewClass attribute, Using SearchView
app:showAsAction attribute, Defining a menu in XML
AppCompat foundation library

about, The Default App Bar

app namespace, The app namespace

Jetpack Compose and, Removing AppCompat

AppCompatActivity class

about, From Layout XML to View Objects

Activity and ComponentActivity vs, Removing AppCompat

application architecture

Google Guide to App Architecture, Accessing the Database Using the Repository Pattern

single activity architecture, Performing Navigation

Application class

onCreate(), Accessing the Database Using the Repository Pattern

registering in manifest, Accessing the Database Using the Repository Pattern

subclassing, Accessing the Database Using the Repository Pattern

application lifecycle, accessing, Accessing the Database Using the Repository Pattern
assertions, JVM Tests
assets, Importing Prepopulated Data
assistant tool window (Android Studio), Navigating in Android Studio
asynchronous code

about, An Introduction to Asynchronous Code on Android

Jetpack Compose and, For the More Curious: Coroutines, Flow, and Compose

?attr/ syntax, Styles, Themes, and Theme Attributes
attributes

(see also layout attributes, individual attribute names)

AttributeSet class, Creating BoxDrawingView
autocompletion, Making Toasts
AVDs (Android Virtual Devices), creating, Running on the Emulator

B

Back button, For the More Curious: The Back Button and the Activity Lifecycle, Challenge: Using the Back Button for Browser History
back stack, How Android Sees Your Activities
background threads

(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

Worker and, Creating a Worker

@Before annotation (JUnit), Instrumented Tests with Espresso and ActivityScenario
beginTransaction() function (FragmentManager), The FragmentManager
Bitmap class, Scaling and Displaying Bitmaps
BitmapFactory class, decodeFile(photoFile.getPath()), Scaling and Displaying Bitmaps
bitmaps

(see also images)

resizing, Scaling and Displaying Bitmaps

scaling and displaying, Scaling and Displaying Bitmaps

bottom property (View), Simple Property Animation
Box composable (Jetpack Compose)

about, Adding more images

aligning children, The align modifier

breakpoints, setting

(see also debugging)

build errors, Build issues

(see also debugging)

build process, For the More Curious: The Android Build Process
build tool window (Android Studio), Navigating in Android Studio
Build.VERSION.SDK_INT, Safely adding code from later APIs
Bundle class, State and Configuration Changes
buttons

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

TextButton composable, Setting the Dialog’s Content

by keyword, Updating UIs with MutableState

C

Calendar class, Passing data to DatePickerFragment
camera, Taking Pictures with Intents
cancelUniqueWork(…) (WorkManager), Providing User Control over Polling
Canvas class, Rendering Inside onDraw(Canvas)
Card composable (Jetpack Compose), Setting the Dialog’s Content
Channel class, Notifying the User
CheckBox class, Defining CrimeDetailFragment’s layout
Checkbox composable (Jetpack Compose)

about, Layouts in Compose

implementing state changes, Updating UIs with MutableState

choosers, creating, Sending a crime report
Chrome Custom Tabs, For the More Curious: Chrome Custom Tabs (Another Easy Way)
Class class, explicit intents and, Communicating with intents
classes

(see also singletons)

abstract classes, Creating a database class

dependencies, For the More Curious: Managing Dependencies

importing, Getting references to views

code completion, Making Toasts
Coil library, Displaying images
color

ArgbEvaluator and, Color evaluation

resources, Building the Scene

Column composable (Jetpack Compose)

about, Layouts in Compose

Alignment parameter, Aligning elements in a row

Arrangement parameter, Aligning elements in a row

companion objects, Using intent extras
compatibility

Android Lint and, Safely adding code from later APIs

configuration qualifiers and, Configuration Qualifiers

fragments and, Different types of fragments

issues, Compatibility and Android Programming

Jetpack libraries and, Different types of fragments

minimum SDK version and, Minimum SDK version

using conditional code for, Safely adding code from later APIs

compile SDK version, Compile SDK version
ComponentActivity class, Activity and AppCompatActivity vs, Removing AppCompat
components, Communicating with intents
@Composable annotation, Composable Functions
composables

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

trailing lambda syntax and, Dismissing the Dialog

Compose (see Jetpack Compose)
CompositionLocal class (Jetpack Compose)

about, CompositionLocal

accessing CompositionLocal variables, CompositionLocal

creating CompositionLocal variables, For the More Curious: Creating Your Own CompositionLocals

LocalContext, CompositionLocal

MaterialTheme and, CompositionLocal

configuration changes

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

ViewModel and, Persisting UI State

configuration qualifiers

Android versions and, Configuration Qualifiers

for language, Localizing Resources

listed, Configuration Qualifiers

multiple, Multiple qualifiers

order of precedence, Prioritizing alternative resources

for screen size, For the More Curious: More on Determining Device Size

ConstraintLayout class

about, Introducing ConstraintLayout

converting layout to use, Introducing the Layout Editor

Guideline, For the More Curious: Advanced Features in ConstraintLayout

MotionLayout, For the More Curious: Advanced Features in ConstraintLayout

constraints

about, Introducing ConstraintLayout

adding in layout editor, Adding views

in XML, ConstraintLayout’s inner workings

removing, Using ConstraintLayout

warnings when insufficient, Using ConstraintLayout

Constraints class, WorkRequest and, Scheduling Work
contacts

getting data from, Getting data from the contacts list

permissions for, Contacts permissions

container view IDs, The FragmentManager
ContentProvider class

about, Getting data from the contacts list

FileProvider convenience class, Using FileProvider

for storing files shared among apps, File Storage

ContentResolver class, Getting data from the contacts list
ContentScale interface (Jetpack Compose)

.Crop, contentScale

.Fit, contentScale

Context class

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

resource IDs and, Making Toasts

contracts

(see also ActivityResultContracts class)

conventions (see naming conventions)
Converter.Factory class (Retrofit), Adding a String converter
converters

converter factories, Adding a String converter

scalars converter, Adding a String converter

coroutines

(see also Flow class, flows)

about, An Introduction to Asynchronous Code on Android

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

ViewModel class and, Using coroutines

createChooser(…) function (Intent), Sending a crime report
created activity state, Activity States and Lifecycle Callbacks
Cursor class, Getting data from the contacts list

D

d(…) function (Log), Making log messages, For the More Curious: Log Levels, Logging stack traces
@Dao annotation (Room), Defining a Data Access Object
data access objects (DAOs), Defining a Data Access Object
data classes, Creating a New Class
data persistence

using saved instance state, Saving Data Across Process Death

using ViewModel, ViewModel lifecycle

with shared preferences, Simple Persistence with DataStore

@Database annotation (Room), Creating a database class
databases

(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

schemas, Challenge: Addressing the Schema Warning

Structured Query Language (SQL), Defining a Data Access Object

type conversion, Creating a type converter

DataStore library, Simple Persistence with DataStore, Defining UI State
Date class, Passing data to DatePickerFragment
DateFormat class, Challenge: Formatting the Date
DatePickerDialog class

about, Dialogs and DialogFragment, Passing data to DatePickerFragment

configuration changes and, Creating a DialogFragment

wrapping in DialogFragment, Creating a DialogFragment

debug key, For the More Curious: The Android Build Process
debugging

(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

using breakpoints, Setting breakpoints

declarative UI toolkit, defined, Philosophies of State
default resources, Default resources
delegation, using by keyword, Updating UIs with MutableState
density-independent pixel (dp), Screen Pixel Densities
dependencies

adding, Including the ViewModel Dependency

deleting, MaterialTheme

dependency injection (DI) design pattern

about, For the More Curious: Managing Dependencies

injectors, For the More Curious: Singletons

design patterns

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

unidirectional data flow pattern, Unidirectional Data Flow

developer documentation, Using the Android Developer Documentation
devices

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

virtual, Running on the Emulator

devices view (Android Studio), Running on a Device
Dialog class, Dialogs and DialogFragment
Dialog composable (Jetpack Compose), Your First Dialog in Compose
DialogFragment class

about, Creating a DialogFragment

onCreateDialog(Bundle?), Creating a DialogFragment

dialogs

adding to navigation graphs, Showing a DialogFragment

in framework UI toolkit, Dialogs and DialogFragment

in Jetpack Compose, Showing Dialogs with Jetpack Compose

passing data to, Passing Data Between Two Fragments

DiffUtil class, For the More Curious: A Smarter Adapter with ListAdapter
dip (density-independent pixel, dp), Screen Pixel Densities
documentation, Using the Android Developer Documentation
doOnLayout() function (View), Scaling and Displaying Bitmaps
dp (density-independent pixel), Screen Pixel Densities
draw() function (View), Rendering Inside onDraw(Canvas)
@drawable/ syntax, Referencing resources in XML
drawables, Referencing resources in XML
drawing

Canvas, Rendering Inside onDraw(Canvas)

in onDraw(Canvas), Rendering Inside onDraw(Canvas)

Paint, Rendering Inside onDraw(Canvas)

E

e(…) function (Log), For the More Curious: Log Levels
editor (Android Studio)

about, Navigating in Android Studio

layout editor, Introducing the Layout Editor

EditText class, Defining CrimeDetailFragment’s layout
emulator

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

simulating network types, Scheduling Work

enqueue(…) function (WorkManager), Scheduling Work
enqueueUniquePeriodicWork(…) (WorkManager), Providing User Control over Polling
@Entity annotation (Room), Defining entities
errors

(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

WARNING log level, For the More Curious: Log Levels

escape sequence (in strings), Updating the Layout
event-driven applications, Setting listeners
Exception class, Logging stack traces
exceptions

(see also debugging, errors)

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

UninitializedPropertyAccessException, Exceptions and Stack Traces, Deserializing JSON text into model objects

explicit intents

about, Explicit and implicit intents, Implicit Intents

creating, Communicating with intents

implicit intents vs, Explicit and implicit intents, Implicit Intents, Using Implicit Intents

Explore by Touch, Explore by Touch
extras

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

F

factory software design pattern, Unidirectional Data Flow
file storage

authorities, Using FileProvider

granting write permission, Using FileProvider

private, File Storage

shared between apps, File Storage

file types, for images, Images
fileList(…) function (Context), File Storage
FileProvider convenience class

about, Using FileProvider

getUriForFile(…), Using a Camera Intent

findNavController function (Activity, Fragment), Navigating to the detail screen
Flow class

(see also flows)

collect {} function, Keeping the Changes Flowing

MutableStateFlow, Keeping the Changes Flowing

StateFlow, Keeping the Changes Flowing

flows

about, Keeping the Changes Flowing

databases and, Keeping the Changes Flowing

fluent interface, defined, The FragmentManager
format strings, Using a Format String
Fragment class

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

visibility of lifecycle functions, Implementing fragment lifecycle functions

Fragment Results API, Passing Data Between Two Fragments
fragment transactions

(see also FragmentTransaction class)

FragmentContainerView class, Defining a FragmentContainerView
FragmentManager class

adding fragments, The FragmentManager

beginTransaction(), The FragmentManager

fragment lifecycle functions and, The fragment lifecycle

responsibilities, The FragmentManager

fragments

(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

views and, Wiring up views in a fragment

FragmentTransaction class

about, The FragmentManager

add(…), The FragmentManager

functions

assertions, JVM Tests

pure, Recomposition

side effects, Recomposition

suspending with coroutines, An Introduction to Asynchronous Code on Android, Using coroutines

G

GestureDetector class, For the More Curious: Detecting Gestures
@GET annotation (Retrofit), Defining an API interface
getAction() function (MotionEvent), Handling Touch Events
getBooleanExtra(…) function (Intent), Using intent extras
getCacheDir(…) function (Context), File Storage
getDir(…) function (Context), File Storage
getFilesDir() function (Context), File Storage
getIntent() function (Activity), Using intent extras
getUriForFile(…) function (FileProvider), Using a Camera Intent
GlobalScope class, Updating the Database
Gradle source sets, Two Types of Tests
GridView class, Lists and Grids: Past, Present, and Future
Guideline class, For the More Curious: Advanced Features in ConstraintLayout

H

hardware devices, Running on the Emulator
height property (View), Simple Property Animation
Home gesture, Temporarily leaving an activity
HTTP networking (see networking)
HTTP request method annotations, Defining an API interface

I

i(…) function (Log), For the More Curious: Log Levels
IllegalStateException class, ViewModel lifecycle, Accessing the Database Using the Repository Pattern
Image composable (Jetpack Compose)

about, Images

alignment property, Image alignment

contentDescription, Image’s contentDescription

contentScale property, contentScale

ImageButton class, A Place for Your Photo
images

displaying with Coil library, Displaying images

image types, Images

scaling and displaying bitmaps, Scaling and Displaying Bitmaps

implicit intents

about, Explicit and implicit intents, Implicit Intents

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

data, 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

parts of, Parts of an implicit intent

inflating layouts, From Layout XML to View Objects, Implementing fragment lifecycle functions
@Insert annotation (Room), Responding to menu selections
instrumented tests

about, Two Types of Tests

ActivityScenario, Instrumented Tests with Espresso and ActivityScenario

creating, Instrumented Tests with Espresso and ActivityScenario

JUnit framework, JVM Tests

Intent class

about, Using Implicit Intents

constructors, Communicating with intents, Sending a crime report

createChooser(…), Sending a crime report

getBooleanExtra(…), Using intent extras

putExtra(…), Using intent extras

intent filters

about, How Android Sees Your Activities

explained, Parts of an implicit intent

Intent.FLAG_GRANT_READ_URI_PERMISSION flag, Contacts permissions
intents

(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

setting results, Setting a result

Interceptor interface (OkHttp library), Searching Flickr
interceptors, Searching Flickr
interfaces, with a single abstract method (SAMs), Setting listeners
interpolators, Using different interpolators
invalidate() function (View), Tracking across motion events

J

Java Virtual Machine (JVM) tests

about, Two Types of Tests

creating, JVM Tests

JUnit framework, JVM Tests

JavaScript Object Notation (JSON) (see JSON (JavaScript Object Notation))
JavaScript, enabling, The Harder Way: WebView
javaScriptEnabled property (WebSettings), The Harder Way: WebView
Jetpack Compose

about, Introduction to Jetpack Compose

@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

trailing lambda syntax and, Dismissing the Dialog

Jetpack libraries

(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

for backward compatibility, Jetpack libraries

Job class, Consuming data from coroutines
JSON (JavaScript Object Notation)

about, Fetching JSON from Flickr

arrays, Deserializing JSON text into model objects

deserializing, Deserializing JSON text into model objects

Moshi library and, Deserializing JSON text into model objects

objects, Deserializing JSON text into model objects

@Json annotation, Deserializing JSON text into model objects
@JsonClass annotation, Deserializing JSON text into model objects
JUnit testing framework (see testing, instrumented tests, Java Virtual Machine (JVM) tests)

K

Kotlin

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

single abstract method interfaces (SAMs) and, Setting listeners

kotlin.RuntimeException class, Exceptions and Stack Traces

L

language qualifiers, Localizing Resources
language settings, device, Localizing Resources
language-region qualifiers, Targeting a region
launcher activities, How Android Sees Your Activities
LAUNCHER category (Intent), How Android Sees Your Activities
layout attributes

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

android:text, android:text

layout constraints (see constraints)
layout editor (Android Studio), Introducing the Layout Editor, Testing Alternative Resources
layout parameters, ConstraintLayout’s inner workings
LayoutInflater class, For the More Curious: The Android Build Process
LayoutManager class, Implementing a LayoutManager
layouts

(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

view hierarchy and, The view hierarchy

LazyColumn composable (Jetpack Compose)

about, Scrollable Lists with LazyColumn

item, Scrollable Lists with LazyColumn

items, Scrollable Lists with LazyColumn

itemsIndexed, Scrollable Lists with LazyColumn

RecyclerView vs, Scrollable Lists with LazyColumn

state in, For the More Curious: Scrolling State

LazyRow composable (Jetpack Compose)

about, Scrollable Lists with LazyColumn

item, Scrollable Lists with LazyColumn

items, Scrollable Lists with LazyColumn

itemsIndexed, Scrollable Lists with LazyColumn

RecyclerView vs, Scrollable Lists with LazyColumn

left property (View), Simple Property Animation
libraries

adding to projects, Including the ViewModel Dependency

removing from project, MaterialTheme

lifecycle callbacks, Activity States and Lifecycle Callbacks
Lifecycle class, repeatOnLifecycle(…), Consuming data from coroutines
LinearLayout class, Laying Out the UI, The view hierarchy
Lint (see Android Lint)
list-detail interfaces, Fragments
ListAdapter class

about, For the More Curious: A Smarter Adapter with ListAdapter

DiffUtil and, For the More Curious: A Smarter Adapter with ListAdapter

listeners

about, Setting listeners

as interfaces, Setting listeners

setting in fragments, Wiring up views in a fragment

setting up, Setting listeners

lists

displaying, Displaying Lists with RecyclerView

getting item data, Implementing an Adapter to Populate the RecyclerView

in Jetpack Compose, Scrollable Lists with LazyColumn

ListView class, Lists and Grids: Past, Present, and Future
live literals, For the More Curious: Live Literals
local layout rect, Simple Property Animation
LocalContext property (CompositionLocal), CompositionLocal
localization

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

Translations Editor, Checking string coverage using the Translations Editor

Log class

d(…), Making log messages, For the More Curious: Log Levels, Logging stack traces

e(…), For the More Curious: Log Levels

i(…), For the More Curious: Log Levels

levels, For the More Curious: Log Levels

logging messages, Making log messages

v(…), For the More Curious: Log Levels

w(…), For the More Curious: Log Levels

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

wrapping output, Fetching JSON from Flickr

logging

exceptions, Logging stack traces

messages, Making log messages

stack traces, Logging stack traces

TAG constant, Making log messages

M

MAIN category (Intent), How Android Sees Your Activities
makeText(…) function (Toast), Making Toasts
manifest

about, Declaring activities in the manifest

<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

disclosing queries, Disclosing queries

margins, For the More Curious: Margins vs Padding
master-detail interfaces, Fragments
match_parent, android:layout_width and android:layout_height
Material Components library, The Default App Bar
MaterialTheme composable (Jetpack Compose)

about, MaterialTheme

CompositionLocal and, CompositionLocal

nested, CompositionLocal

scope, CompositionLocal

MaterialTheme object (Jetpack Compose)

about, Specifying text styles, MaterialTheme

text styles, Specifying text styles

memory leaks, ViewModel lifecycle
MenuItem class, Responding to menu selections
menus

(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

responding to selections, Responding to menu selections

<meta-data> tag, Using FileProvider
Migration classes (Room), Adding a Suspect Property
model classes, using data keyword, Creating a New Class
Modifier type (Jetpack Compose)

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

weight, Sizing composables

Moshi library

about, Deserializing JSON text into model objects

@Json annotation, Deserializing JSON text into model objects

@JsonClass annotation, Deserializing JSON text into model objects

motion events, handling, Handling Touch Events
MotionEvent class

about, Handling Touch Events

actions, Handling Touch Events

getAction(), Handling Touch Events

MotionLayout class, For the More Curious: Advanced Features in ConstraintLayout
multi-window (split screen) mode

activity states and, For the More Curious: UI Updates and Multi-Window Mode

multi-resume support, For the More Curious: UI Updates and Multi-Window Mode

MutableState interface (Jetpack Compose)

about, Updating UIs with MutableState

mutableStateOf, Updating UIs with MutableState

mutableStateOf function (MutableState), Updating UIs with MutableState

N

namespaces

Android resource XML, The view hierarchy

app, The app namespace

tools, Updating the Layout, Implementing the Navigation component library

naming conventions

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

unused parameters, Wiring up views in a fragment

NavController class, Navigating to the detail screen
NavHostFragment class, Implementing the Navigation component library, Navigating to the detail screen
navigation

(see also Navigation Jetpack component library)

Activity lifecycle and, For the More Curious: The Back Button and the Activity Lifecycle

Back button, For the More Curious: The Back Button and the Activity Lifecycle

navigation graphs (Navigation Jetpack component library)

about, Performing Navigation

adding destinations, Implementing the Navigation component library

adding dialogs, Showing a DialogFragment

creating, Implementing the Navigation component library

defining actions, Navigating to the detail screen

hosting, Implementing the Navigation component library

previews, Implementing the Navigation component library, For the More Curious: A Better List Preview

Navigation Jetpack component library

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

Safe Args Gradle plugin and, Passing data to a fragment

networking

about, Making Network Requests and Displaying Images

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

scheduling, Scheduling Work, Providing User Control over Polling

nonexistent activity state, Activity States and Lifecycle Callbacks
Notification class

(see also notifications)

about, Notifying the User

NotificationManager and, Notifying the User

NotificationCompat class, Notifying the User
NotificationManager class

Notification and, Notifying the User

notify(…), Notifying the User

notifications

about, Notifying the User

configuring, Notifying the User

notification channels, Notifying the User

notify(…) function (NotificationManager), Notifying the User

O

ObjectAnimator class, Simple Property Animation
OkHttp HTTP client library, Adding a String converter, Searching Flickr
onActivityCreated(Bundle?) function (Fragment), The fragment lifecycle
onAttach(Context?) function (Fragment), The fragment lifecycle
OnCheckedChangeListener interface, Wiring up views in a fragment
onCleared() function (ViewModel), Adding a ViewModel
OnClickListener interface, Setting listeners
onCreate() function (Application), overriding, Accessing the Database Using the Repository Pattern
onCreate(Bundle?) function (Activity), From Layout XML to View Objects, Activity States and Lifecycle Callbacks
onCreate(Bundle?) function (Fragment), Implementing fragment lifecycle functions, The fragment lifecycle
onCreateDialog(Bundle?) function (DialogFragment), Creating a DialogFragment
onCreateOptionsMenu(Menu) function (Activity), Creating the menu
onCreateOptionsMenu(…) function (Fragment), Creating the menu
onCreateView(…) function (Fragment), Implementing fragment lifecycle functions, The fragment lifecycle
onDestroy() function (Activity), Activity States and Lifecycle Callbacks
onDestroy() function (Fragment), The fragment lifecycle
onDestroyView() function (Fragment), The fragment lifecycle
onDetach() function (Fragment), The fragment lifecycle
onDraw(Canvas) function (View), Rendering Inside onDraw(Canvas)
OneTimeWorkRequest class (WorkRequest), Scheduling Work
onOptionsItemSelected(MenuItem) function (Fragment), Creating the menu, Responding to menu selections
onPause() function (Activity), Activity States and Lifecycle Callbacks
onPause() function (Fragment), The fragment lifecycle
onProgressChanged(…) function (WebChromeClient), WebChromeClient
OnQueryTextListener(…) interface (SearchView), Responding to SearchView user interactions
onReceivedTitle(…) function (WebChromeClient), WebChromeClient
onRestoreInstanceState(Parcelable) function (View), Challenge: Saving State
onResume() function (Activity), Activity States and Lifecycle Callbacks
onResume() function (Fragment), The fragment lifecycle
onSaveInstanceState() function (View), Challenge: Saving State
onSaveInstanceState(Bundle) function (Activity), For the More Curious: Activity and Instance State
onStart() function (Activity), Activity States and Lifecycle Callbacks
onStart() function (Fragment), The fragment lifecycle
onStop() function (Activity), Activity States and Lifecycle Callbacks
onStop() function (Fragment), The fragment lifecycle
onTouchEvent(MotionEvent) function (View), Handling Touch Events
OnTouchListener interface (View), Handling Touch Events
onViewCreated(…) function (Fragment), The fragment lifecycle
openFileInput(…) function (Context), File Storage
openFileOutput(…) function (Context), File Storage
overflow menu, Defining a menu in XML
override keyword, Making log messages
overriding functions, Android Studio shortcut, Implementing fragment lifecycle functions
overview screen, Temporarily leaving an activity, Finishing an activity

P

PackageManager class

about, Querying the PackageManager

resolveActivity(…), Querying the PackageManager

packages

creating, Creating a database class

naming, Creating an Android Project

padding, For the More Curious: Margins vs Padding
Paint class, Rendering Inside onDraw(Canvas)
Painter class (Jetpack Compose)

about, Images

painterResource, Images

painterResource function (Painter), Images
parameters, _ to denote unused, Wiring up views in a fragment
Parcelable interface

about, Challenge: Saving State, State and Configuration Changes

implementing with Parcelize plugin, Parcelable and Parcelize

PeriodicWorkRequest class (WorkRequest), Scheduling Work, Providing User Control over Polling
permissions

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

runtime, Challenge: Another Implicit Intent

PhotoView class, Scaling and Displaying Bitmaps
PickContact (ActivityResultContracts), Asking Android for a contact
placeholders (in format strings), Using a Format String
play(Animator) function (AnimatorSet), Playing Animators Together
PointF class, Handling Touch Events
presses (see touch events)
@Preview annotation, Previewing Composables
@PrimaryKey annotation (Room), Defining entities
process death, Saving Data Across Process Death
progress indicator, hiding, WebChromeClient
ProgressBar class, WebChromeClient
project tool window (Android Studio), Navigating in Android Studio
project window (Android Studio), Navigating in Android Studio
projects

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

setting project name, Creating an Android Project

property animation (see animation)
property delegates, Adding a ViewModel
protocol buffers, Simple Persistence with DataStore

Q

queries

disclosing, Disclosing queries

for apps, Checking for responding activities

@Query annotation

in Retrofit, Searching Flickr

in Room, Defining a Data Access Object

R

race conditions, Consuming data from coroutines
Recents gesture, Temporarily leaving an activity
recomposition, Recomposition
RecyclerView class

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

ViewHolder and, Implementing a ViewHolder

RecyclerView.Adapter class

about, Implementing an Adapter to Populate the RecyclerView

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

onCreateViewHolder(…), Implementing an Adapter to Populate the RecyclerView

release key, For the More Curious: The Android Build Process
remember composable (Jetpack Compose), remember
rememberSaveable composable (Jetpack Compose), State and Configuration Changes
repeatOnLifecycle(…) function (Lifecycle), Consuming data from coroutines
repositories, Accessing the Database Using the Repository Pattern, Moving toward the repository pattern
repository design pattern, Accessing the Database Using the Repository Pattern, Moving toward the repository pattern
@RequiresApi annotation, Safely adding code from later APIs
res/layout directory, Resources and resource IDs
res/menu directory, Defining a menu in XML
res/values directory, Creating string resources, Resources and resource IDs
resolveActivity(…) function (PackageManager), Querying the PackageManager
resource IDs

about, Resources and resource IDs

+ prefix in, Resources and resource IDs

resources

(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

referencing in XML, Referencing resources in XML

Resources.NotFoundException class, Default resources
result code (Activity), Setting a result
resumed activity state, Activity States and Lifecycle Callbacks, For the More Curious: UI Updates and Multi-Window Mode
Retrofit library

@GET annotation, Defining an API interface

about, Networking Basics with Retrofit

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

scalars converter, Adding a String converter

Retrofit.Builder() class (Retrofit)

about, Building the Retrofit object and creating an API instance

baseUrl(…), Building the Retrofit object and creating an API instance

build(), Building the Retrofit object and creating an API instance

right property (View), Simple Property Animation
Room architecture component library

@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

updating database version, Adding a Suspect Property

rotation (see configuration changes)
Row composable (Jetpack Compose)

about, Layouts in Compose

Alignment parameter, Aligning elements in a row

Arrangement parameter, Aligning elements in a row

running on device, Running on a Device
@RunWith(AndroidJUnit4::class) annotation (JUnit), Instrumented Tests with Espresso and ActivityScenario

S

Safe Args Gradle plugin, Passing data to a fragment
SAMs (single abstract method interfaces), Setting listeners
sandbox, device, File Storage
saved instance state, Saving Data Across Process Death
SavedStateHandle class, Saving Data Across Process Death
Scaffold composable (Jetpack Compose)

about, Scaffold and TopAppBar

content, Scaffold and TopAppBar

topBar, Scaffold and TopAppBar

scale-independent pixel (sp), Screen Pixel Densities
scope, ViewModel lifecycle
screen pixel density, Screen Pixel Densities
screen size, determining, For the More Curious: More on Determining Device Size
SDK versions

(see also compatibility)

about, Compile SDK version

configuration qualifiers and, Configuration Qualifiers

installing, Downloading Earlier SDK Versions

updating, Downloading Earlier SDK Versions

search

about, SearchView and DataStore

integrating into app, SearchView and DataStore

user-initiated, Using SearchView

SearchView class

about, Using SearchView

bug, Responding to SearchView user interactions

OnQueryTextListener(…), Responding to SearchView user interactions

responding to user interactions, Responding to SearchView user interactions

setContent function (Jetpack Compose), Composing Your First UI
setContentView(…) function (Activity), From Layout XML to View Objects
setFragmentResultListener function (Fragment), Setting a fragment result
setHasOptionsMenu(Boolean) function (Fragment), Creating the menu
setOnClickListener(OnClickListener) function (View), Setting listeners
setOnItemClickListener(…) function (RecyclerView), The Easy Way: Implicit Intents
setOnTouchListener(…) function (View), Handling Touch Events
setResult(…) function (Activity), Setting a result
setText(Int) function (TextView), Using intent extras
shared preferences, Simple Persistence with DataStore
shouldOverrideUrlLoading(…) function (WebViewClient), The Harder Way: WebView
show() function (Toast), Making Toasts
simulator (see emulator)
single abstract method interfaces (SAMs), Setting listeners
single activity architecture, Performing Navigation
singletons

about, Accessing the Database Using the Repository Pattern

activity/fragment lifecycles and, Accessing the Database Using the Repository Pattern

benefits and drawbacks, For the More Curious: Singletons

source sets, Two Types of Tests
sp (scale-independent pixel), Screen Pixel Densities
stack traces

in Logcat, Exceptions and Stack Traces

logging, Logging stack traces

startActivity(Intent) function (Activity), Starting an Activity, Sending a crime report
startActivity(Intent) function (Fragment), Sending a crime report
StartActivityForResult (ActivityResultContracts), Getting a result back from a child activity
started activity state, Activity States and Lifecycle Callbacks, For the More Curious: UI Updates and Multi-Window Mode
state in Jetpack Compose

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

responding to changes in application state, Updating UIs with MutableState

@string/ syntax, android:text
string resources

about, android:text

@StringRes annotation, Creating a New Class

about, android:text

creating, Creating string resources

referencing, Referencing resources in XML

res/values/strings.xml, Creating string resources

@StringRes annotation, Creating a New Class
stringResource(Int) function (Jetpack Compose), Resources in Compose
strings, format, Using a Format String
Structured Query Language (SQL), Defining a Data Access Object
@style/ syntax, Styles, Themes, and Theme Attributes
styles

/res/values/themes.xml file, Styles, Themes, and Theme Attributes

creating custom styles, Styles, Themes, and Theme Attributes

Material Design and, Styles, Themes, and Theme Attributes

suspend modifier, Using coroutines

T

TAG constant, Making log messages
TakePicture (ActivityResultContracts), Using a Camera Intent
TalkBack

about, TalkBack

Android views’ inherent support, Explore by Touch

enabling, TalkBack

linear navigation by swiping, Linear navigation by swiping

non-text elements and, Adding content descriptions

target SDK version, Target SDK version
@Test annotation (JUnit), JVM Tests
testing

@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

using ActivityScenario, Instrumented Tests with Espresso and ActivityScenario

Text composable (Jetpack Compose)

about, Composing Your First UI

style parameter, Specifying text styles

styles set by, CompositionLocal

TextButton composable (Jetpack Compose), Setting the Dialog’s Content
TextView class

example, Laying Out the UI

setText(Int), Using intent extras

tools:text and, Updating the Layout

themes

(see also styles)

about, Styles, Themes, and Theme Attributes

?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

theme attributes, Styles, Themes, and Theme Attributes

threads

about, An Introduction to Asynchronous Code on Android

background, An Introduction to Asynchronous Code on Android

(see also background threads)

blocking, An Introduction to Asynchronous Code on Android

coroutines and, An Introduction to Asynchronous Code on Android

main (UI), An Introduction to Asynchronous Code on Android, Executing a web request

ticker text, Notifying the User
TimeInterpolator class, Using different interpolators
Toast class

makeText(…), Making Toasts

show(), Making Toasts

toasts, Making Toasts
tool windows (Android Studio), Navigating in Android Studio
toolbar (see app bar)
Toolbar class, For the More Curious: App Bar vs Action Bar vs Toolbar
tools:layout attribute, Implementing the Navigation component library
tools:listitem attribute, For the More Curious: A Better List Preview
tools:text attribute, Updating the Layout
top property (View), Simple Property Animation
TopAppBar composable (Jetpack Compose), Scaffold and TopAppBar
touch events

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

recommended minimum size for touch targets, For the More Curious: Using Accessibility Scanner

transformation properties

pivotX, View transformation properties

pivotY, View transformation properties

rotation, View transformation properties

scaleX, View transformation properties

scaleY, View transformation properties

translationX, View transformation properties

translationY, View transformation properties

transitions framework, for animation, Transitions
Translations Editor, Checking string coverage using the Translations Editor
@TypeConverter annotation (Room), Creating a type converter
@TypeConverters annotation (Room), Creating a type converter
TypeEvaluator class, Color evaluation

U

unidirectional data flow pattern, Unidirectional Data Flow
UninitializedPropertyAccessException class, Exceptions and Stack Traces, Deserializing JSON text into model objects
unit testing, Testing
@Update annotation (Room), Updating the Database
Uri class

creating shareable instances, Using a Camera Intent

FileProvider.getUriForFile(…) and, Using a Camera Intent

user interfaces

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

laying out, Laying Out the UI

<uses-feature> tag, Declaring Features

V

v(…) function (Log), For the More Curious: Log Levels
variables view (Android Studio), Setting breakpoints
vector drawables, Adding an Icon
VectorDrawable class, Adding an Icon
View Binding

about, Wiring Up the User Interface

memory management and, Fragments and memory management

View class

(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

left, Simple Property Animation

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

top, Simple Property Animation

ViewGroup class, Laying Out the UI, The view hierarchy
ViewHolder class

about, Implementing a ViewHolder

itemView property, Implementing a ViewHolder

ViewModel class

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

viewModelScope, Using coroutines

views

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)

margins, For the More Curious: Margins vs Padding

padding, For the More Curious: Margins vs Padding

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

wiring up in fragments, Wiring up views in a fragment

virtual devices (see emulator)

W

w(…) function (Log), For the More Curious: Log Levels
web content

browsing via implicit intent, The Easy Way: Implicit Intents

displaying within an activity, The Harder Way: WebView

enabling JavaScript, The Harder Way: WebView

in Chrome Custom Tabs, For the More Curious: Chrome Custom Tabs (Another Easy Way)

web rendering events, responding to, The Harder Way: WebView
WebChromeClient interface

about, WebChromeClient

for enhancing appearance of WebView, WebChromeClient

onProgressChanged(…), WebChromeClient

onReceivedTitle(…), WebChromeClient

WebSettings class, The Harder Way: WebView
WebView class

custom UI vs, WebView vs a Custom UI

for presenting web content, The Harder Way: WebView

WebViewClient and, The Harder Way: WebView

WebViewClient class

about, The Harder Way: WebView

shouldOverrideUrlLoading(…), The Harder Way: WebView

WebView and, The Harder Way: WebView

work requests

about, Scheduling Work, Providing User Control over Polling

constraints for, Scheduling Work

Worker class

about, Creating a Worker

doWork(), Creating a Worker

enabling and disabling, Providing User Control over Polling

scheduling with WorkRequest, Scheduling Work, Providing User Control over Polling

WorkManager architecture component library

about, WorkManager

Constraints, Scheduling Work

Worker, Creating a Worker

WorkRequest, Creating a Worker

WorkManager class, enqueue(…), Scheduling Work
WorkRequest class

about, Creating a Worker

Constraints and, Scheduling Work

scheduling a Worker, Scheduling Work, Providing User Control over Polling

subclasses, Scheduling Work

wrap_content, android:layout_width and android:layout_height

X

XML

Android namespace, The view hierarchy

referencing resources in, Referencing resources in XML

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset