parameterless, Preparing to Download Bytes from a URL
@Insert annotation, Updating the Databasewith parameters, Defining an API interface
in Retrofit, Searching Flickr
@string/ syntax, android:textin 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 widget focusable
android:labelFor attribute, Challenge: Providing Enough Context for Data Entry
Explore by Touch, Explore by Touch
setContentDescription(…), Creating a Comparable Experience
ticker text, Notifying the User
Accessibility Scanner, For the More Curious: Using Accessibility Scannerfor touch targets, For the More Curious: Using Accessibility Scanner
(see also Activity class, fragments)
about, App Basics
adding to project, Creating an Android Project, Your Second Activity
as controllers, Model-View-Controller and Android
back stack, How Android Sees Your Activities, Tasks and the Back Stack
base, Tasks and the Back Stack
child, Your Second Activity, Getting a result back from a child activity
configuration changes and, Rotating an activity, Proper Rotation with WebView
creating, Creating a new activity
declaring in manifest, Declaring activities in the manifest
finishing, Finishing an activity
fragment transactions and, Single Activity: Fragment Boss
hosting fragments, Starting CriminalIntent, Hosting a UI Fragment, The FragmentManager and the fragment lifecycle
keeping thin, Deciding to use MVC
label (display name), Resolving an Implicit Intent
launcher, How Android Sees Your Activities
lifecycle, Activity States and Lifecycle Callbacks, Rotating an activity
lifecycle diagram, Saved instance state and activity records
lifecycle, and hosted fragments, The FragmentManager and 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
single activity architecture, Single Activity: Fragment Boss
starting, defined, Your Second Activity
starting, in another application, Implicit Intents
starting, in current task, Tasks and the Back Stack
starting, in new task, Starting a new task
starting, with startActivity(Intent), Starting an Activity
states, Activity States and Lifecycle Callbacks, Saved instance state and activity records
tasks and, Tasks and the Back Stack
Activity classUI flexibility and, The Need for UI Flexibility
about, App Basics
as Context subclass, Making Toasts
getIntent(), Using intent extras
lifecycle functions, Activity States and Lifecycle Callbacks
onActivityResult(…), Sending back an intent
onCreate(Bundle?), 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), Saving Data Across Process Death
onStart(), Activity States and Lifecycle Callbacks
onStop(), Activity States and Lifecycle Callbacks
overriding superclass functions, Making log messages
setContentView(…), From Layout XML to View Objects
setResult(…), Setting a result
startActivity(Intent), Starting an Activity, Sending a crime report
activity record, Saved instance state and activity recordsstartActivityForResult(…), Getting a result back from a child activity
back stack, How Android Sees Your Activities
ActivityNotFoundException class, Communicating with intentsstarting activities, Starting an Activity, Sending back an intent
getItemCount(), Implementing an Adapter to Populate the RecyclerView
onBindViewHolder(…), Implementing an Adapter to Populate the RecyclerView
adb (Android Debug Bridge) driver, Running on a DeviceonCreateViewHolder(…), Implementing an Adapter to Populate the RecyclerView
as code inspector, Creating a New Class
as static analyzer, Using Android Lint
compatibility and, Adding code from later APIs safely
running, Using Android Lint
Android SDK Manager, Downloading Earlier SDK Versionssuppressing warnings, Using handlers
Android Asset Studio, Using the Android Asset Studio
Android Lint code inspector, Creating a New Class
AppCompat theme default, Modifying the theme
assets (see assets)
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 layout files, Creating a landscape layout
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
graphical layout tool, Testing Alternative Resources
(see also layouts)
installing, Downloading and Installing Android Studio
Instant Run, Creating an Android Project
Logcat
9-patch editor, For the More Curious: 9-Patch Images
plug-ins, Room Architecture Component Library
previewing layout decorations, Previewing the layout
project tool window, Navigating in Android Studio
project window, Navigating in Android Studio
run configurations, Data Binding Callbacks
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 versions (see SDK versions)variables view, Setting breakpoints
(see also transformation properties)
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
running multiple animators, Playing Animators Together
simple property animation, Simple Property Animation
transitions framework, Transitions
AnimatorListener class, Playing Animators Togethertranslation, Simple Property Animation
about, Playing Animators Together
API levels (see SDK versions)play(Animator), Playing Animators Together
about, The App Bar
action views in, Using SearchView
app:showAsAction attribute, Defining a menu in XML
colorPrimary theme attribute and, Adding Theme Colors
default from AppCompatActivity, AppCompat Default App Bar
menu (see menus)
previewing, Previewing the layout
app featuresterminology vs action bar, toolbar, For the More Curious: App Bar vs Action Bar vs Toolbar
app bar, The App Bar
app namespace, The app namespacedeclaring in manifest, Declaring Features
about, AppCompat Default App Bar
app namespace, The app namespace
AppCompatActivity class, From Layout XML to View Objectsthemes in, Modifying the theme
data binding and, Binding to Data
Google Guide to App Architecture, Accessing the Database Using the Repository Pattern
Model-View-Controller (MVC), Model-View-Controller and Android
Model-View-View Model (MVVM), Different Architectures: Why Bother?
repository pattern, Accessing the Database Using the Repository Pattern, Moving toward the repository pattern
single activity architecture, Single Activity: Fragment Boss
Single Responsibility Principle, Binding to Data
Application classwith fragments, Application Architecture with Fragments
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
about, Accessing Assets
assetslist(String), Accessing Assets
about, Importing Assets
accessing, Accessing Assets
importing, Importing Assets
managing, Accessing Assets
presenting to user, Wiring Up Assets for Use
attributesvs resources, Importing Assets
AttributeSet class, Creating BoxDrawingView(see also layout attributes, individual attribute names)
about, Background threads
@WorkerThread annotation, Preparing to Download Bytes from a URL
Call.enqueue(…) (Retrofit) and, Executing a web request
communication with main thread, Messages and Message Handlers
dedicated, Downloading Lots of Small Things
doWork() and, Creating a Worker
Executor and, Using an executor
for asynchronous network requests, Executing a web request
for long-running tasks, Background threads
HandlerThread and, Assembling a Background Thread
lifecycle aware, Making your thread lifecycle aware
LiveData and, Using LiveData
scheduling work on, Scheduling Work
scheduling work on main thread from, Passing handlers
BaseObservable class, Observable dataWorker and, Creating a Worker
decodeFile(photoFile.getPath()), Scaling and Displaying Bitmaps
bitmapsdecodeStream(InputStream), Preparing to Download Bytes from a URL
caching, Challenge: Preloading and Caching
downloading, Preparing to Download Bytes from a URL
resizing, Scaling and Displaying Bitmaps
bottom property (View), Simple Property Animationscaling and displaying, Scaling and Displaying Bitmaps
broadcast intents(see also debugging)
permissions and, Limiting broadcasts to your app using private permissions
registered in code, Creating and registering a dynamic receiver
regular intents vs, Regular Intents vs Broadcast Intents
broadcast receiverssending, Sending broadcast intents
implementing, Creating and registering a standalone receiver
intent filters and, Regular Intents vs Broadcast Intents
limitations, For the More Curious: Limitations on Broadcast Receivers
long-running tasks and, Receivers and Long-Running Tasks
permissions and, Limiting broadcasts to your app using private permissions
broadcasts, system vs custom, Regular Intents vs Broadcast Intentsstandalone, Creating and registering a standalone receiver
build process, For the More Curious: The Android Build Process(see also debugging)
in onCreate(Bundle?), Saving Data Across Process Death
in onSaveInstanceState(Bundle), Saving Data Across Process Death
putCharSequence(…), Fragment Arguments
putInt(…), Fragment Arguments
Button classputSerializable(…), Fragment Arguments
example, Laying Out the UI
vs ImageButton, Challenge: From Button to ImageButton
buttonsinheritance, Challenge: From Button to ImageButton
(see also Button class, ImageButton class)
adding icons, Referencing resources in XML
adding IDs, Resources and resource IDs
drawables for, XML Drawables
modifying attributes, Modifying Button Attributes
by lazy, Add data to your ViewModel9-patch images for, For the More Curious: 9-Patch Images
Calendar class, Passing data to DatePickerFragmentLRU (least recently used) strategy, Challenge: Preloading and Caching
about, Taking Pictures with Intents
firing intent, Firing the intent
Canvas class, Rendering Inside onDraw(Canvas)taking pictures with intents, Using a Camera Intent
(see also singletons)
abstract classes, Creating a database class
dependencies, For the More Curious: Managing Dependencies
importing, Getting references to widgets
code completion, Making Toastsinner classes, Using handlers
colorAccent theme attribute, Adding Theme Colors
colorPrimary theme attribute, Adding Theme Colors
colorPrimaryDark theme attribute, Adding Theme Colors
for animation, Color evaluation
res/values/colors.xml, Color Resources
resources, Color Resources
companion objects, Using intent extrasthemes and, Adding Theme Colors
Android Lint and, Adding code from later APIs safely
fragments and, Different types of fragments
importance, Android SDK Versions
Jetpack libraries and, Different types of fragments
minimum SDK version and, Minimum SDK version
using conditional code for, Adding code from later APIs safely
compile SDK version, Compile SDK versionwrapping code for, Adding code from later APIs safely
activity/fragment lifecycles and, Wiring up widgets in a fragment
android:configChanges attribute and, Proper Rotation with WebView
effect on activities, Rotating an activity
configuration qualifierseffect on fragments, Rotation and retained fragments
about, Creating a landscape layout
for language, Localizing Resources
listed, Configuration Qualifiers
multiple, Multiple qualifiers
order of precedence, Prioritizing alternative resources
for screen density, Adding an Icon, Screen density works differently
for screen orientation, Creating a landscape layout
ConstraintLayout classfor screen size, For the More Curious: More on Determining Device Size
about, Introducing ConstraintLayout
converting layout to use, Introducing the Graphical Layout Editor
Guideline, For the More Curious: New Developments in ConstraintLayout
constraintsMotionLayout, For the More Curious: New Developments in ConstraintLayout
about, Introducing ConstraintLayout
adding in graphical layout editor, Adding widgets
removing, Using ConstraintLayout
Constraints class, and WorkRequest, Scheduling Workwarnings when insufficient, Using ConstraintLayout
getting data from, Getting data from the contacts list
container viewspermissions for, Contacts permissions
about, Defining a container view
ContentProvider class, Getting data from the contacts list
ContentResolver class, Getting data from the contacts list(see also FileProvider convenience class)
AssetManager, Accessing Assets
explicit intents and, Communicating with intents
functions for private files and directories, File Storage
resource IDs and, Making Toasts
Context.MODE_WORLD_READABLE, File StoragerevokeUriPermission(…), Scaling and Displaying Bitmaps
about, Adding a String converter
converter factories, Adding a String converter
createChooser(…) function (Intent), Sending a crime reportscalars converter, Adding a String converter
@{} (binding mustache) operator, Binding to Data, Binding to a view model, Observable data, Syntactic sugar
application architecture and, Binding to Data
binding adapters, BindingAdapters
binding classes, Implementing Simple Data Binding
declaring objects in layout files, Binding to Data
enabling, Implementing Simple Data Binding
lambda expressions, Lambda expressions
layout files and, Implementing Simple Data Binding
null handling in, Syntactic sugar
observable data, Observable data
Data Binding architecture component library (see data binding)view models and, Binding to Data, Binding to a view model
using databases, Databases and the Room Library
using fragment arguments, For the More Curious: Why Use Fragment Arguments?
using saved instance state, Saving Data Across Process Death
using SharedPreferences, Simple Persistence with SharedPreferences
data/data directory, Uploading test datausing ViewModel, ViewModel lifecycle and ViewModelProvider
(see also Room architecture component library)
accessing, Accessing the Database Using the Repository Pattern
accessing on a background thread, Background threads
data access objects (DAOs), Defining a Data Access Object
database classes, Creating a database class
entities, Defining entities
for storing app data, Databases and the Room Library
primary keys, Defining entities
repository pattern, Accessing the Database Using the Repository Pattern
Structured Query Language (SQL), Defining a Data Access Object
Date class, Passing data to DatePickerFragmenttype conversion, Creating a type converter
about, Dialogs
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, Issues with the R class
crashes, Exceptions and Stack Traces
crashes on unconnected device, Exceptions and Stack Traces
issues with R class, Issues with the R class
logging stack traces vs setting breakpoints, Setting breakpoints
misbehaviors, Diagnosing misbehaviors
online help for, Issues with the R class
running app with debugger, Setting breakpoints
stopping debugger, Setting breakpoints
DEFAULT category (Intent), Using NerdLauncher as a Home Screenusing breakpoints, Setting breakpoints
developer documentation, Using the Android Developer Documentationinjectors, For the More Curious: Singletons
configurations
(see also configuration qualifiers)
configuring language settings, Localizing Resources
enabling developer options, Overriding onSaveInstanceState(Bundle)
hardware, Running on the Emulator
testing configurations, Testing Alternative Resources
devices view (Android Studio), Running on a Devicevirtual, Running on the Emulator
about, Creating a DialogFragment
onCreateDialog(Bundle?), Creating a DialogFragment
dialogs, Dialogsshow(…), Showing a DialogFragment
about, XML Drawables
directories, Adding an Icon
layer list, Layer List Drawables
9-patch images, For the More Curious: 9-Patch Images
referencing, Referencing resources in XML
screen density and, Adding an Icon
shape, Shape Drawables
state list, State List Drawables
drawingXML drawables, XML Drawables
Canvas, Rendering Inside onDraw(Canvas)
in onDraw(Canvas), Rendering Inside onDraw(Canvas)
creating a virtual device for, Running on the Emulator
enabling developer options, Overriding onSaveInstanceState(Bundle)
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 (Retrofit), Executing a web requestsimulating network types, Scheduling Work
(see also debugging, exceptions)
Android Studio indicators, Getting references to widgets
avoiding using StrictMode, For the More Curious: StrictMode
escape sequence (in string), Updating the View LayerERROR log level, For the More Curious: Log Levels
about, Logging stack traces
ActivityNotFoundException, Communicating with intents
creating, Logging stack traces
IllegalStateException, ViewModel lifecycle and ViewModelProvider, Accessing the Database Using the Repository Pattern, Showing a DialogFragment
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
NetworkOnMainThreadException, Executing a web request
Resources.NotFoundException, Default resources
StrictMode and, For the More Curious: StrictMode
type-aliasing and, Exceptions and Stack Traces
execute function (Executor), Using an executorUninitializedPropertyAccessException, Exceptions and Stack Traces, Deserializing JSON text into model objects
about, Using an executor
and Executors.newSingleThreadExecutor(), Using an executor
explicit intentsexecute, Using an executor
creating, Communicating with intents
creating at runtime, Creating Explicit Intents at Runtime
Explore by Touch, Explore by Touchimplicit intents vs, 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
getCacheDir(), File Storage
getDir(…), File Storage
file storagegetFilesDir(), File Storage
authorities, Using FileProvider
granting write permission, Using FileProvider, Firing the intent
private, File Storage
revoking write permission, Scaling and Displaying Bitmaps
FileDescriptor class, Accessing Assetsshared between apps, File Storage
fluent interface, Fragment transactionssearching in, Searching Flickr
getArguments(…), Retrieving arguments
getTargetFragment(), Setting a target fragment
getTargetRequestCode(), Setting a target fragment
newInstance(…), Attaching arguments to a fragment
onActivityCreated(Bundle?), The FragmentManager and the fragment lifecycle
onActivityResult(…), Passing Data Between Two Fragments
onAttach(Context?), The FragmentManager and the fragment lifecycle
onCreate(Bundle?), Implementing fragment lifecycle functions, The FragmentManager and the fragment lifecycle
onCreateOptionsMenu(…), Creating the menu
onCreateView(…), Implementing fragment lifecycle functions, The FragmentManager and the fragment lifecycle
onDestroy(), The FragmentManager and the fragment lifecycle
onDestroyView(), The FragmentManager and the fragment lifecycle
onDetach(), The FragmentManager and the fragment lifecycle
onOptionsItemSelected(MenuItem), Creating the menu, Responding to menu selections
onResume(), The FragmentManager and the fragment lifecycle
onSaveInstanceState(Bundle), Implementing fragment lifecycle functions
onViewCreated(…), The FragmentManager and the fragment lifecycle
setArguments(…), Attaching arguments to a fragment
setHasOptionsMenu(Boolean), Creating the menu
setTargetFragment(…), Setting a target fragment
startActivity(Intent), Sending a crime report
fragment transactionsversions, Different types of fragments
(see also FragmentTransaction class)
about, Fragment transactions
activities and, Single Activity: Fragment Boss
adding a fragment to an activity, Fragment transactions
adding to back stack, Replacing a fragment
FragmentManager classreplacing a fragment in an activity, Replacing a fragment
adding fragments, Fragment transactions
beginTransaction(), Fragment transactions
responsibilities, Adding a UI fragment to the FragmentManager
fragmentsrole in rotation, Rotation and retained fragments
(see also Fragment class, fragment transactions, FragmentManager class)
about, Introducing Fragments
activities vs, The Need for UI Flexibility
activity lifecycle and, The FragmentManager and the fragment lifecycle
adding to FragmentManager, Adding a UI fragment to the FragmentManager
application architecture with, Application Architecture with Fragments
arguments bundle, Fragment Arguments
as composable units, The Need for UI Flexibility, Single Activity: Fragment Boss
checking for existing, Fragment transactions, Creating PhotoGallery
compatibility and, Different types of fragments
container view IDs, Fragment transactions
container views for, Defining a container view
creating, Creating a UI Fragment
defining a callback interface, Fragment callback interfaces
delegating functionality to activity, Fragment callback interfaces
effect of configuration changes on, Rotation and retained fragments
fragment transactions, Fragment transactions
hosting, Starting CriminalIntent, Hosting a UI Fragment
implementing lifecycle functions, Implementing fragment lifecycle functions
in single activity architecture, Single Activity: Fragment Boss
inflating layouts for, Implementing fragment lifecycle functions
Jetpack libraries and, Different types of fragments
lifecycle, Implementing fragment lifecycle functions, The FragmentManager and the fragment lifecycle
lifecycle diagram, Rotation and retained fragments
lifecycle functions, The FragmentManager and the fragment lifecycle
maintaining independence, Single Activity: Fragment Boss
passing data between (same activity), Passing Data Between Two Fragments
passing data with fragment arguments, Passing data to DatePickerFragment
perceived lifetime, Making your thread lifecycle aware
reasons for, The Need for UI Flexibility, Deciding whether to use fragments
reasons not to retain, Whether to retain
retaining, Retained Fragments
setting listeners in, Wiring up widgets in a fragment
target fragments, Setting a target fragment
UI flexibility and, The Need for UI Flexibility
using Jetpack (androidx) version, Creating the CrimeFragment class
FragmentTransaction classwidgets and, Wiring up widgets in a fragment
add(…), Fragment transactions
addToBackStack(String), Replacing a fragment
FrameLayout classreplace(…), Replacing a fragment
about, Creating a landscape layout
as container view for fragments, Defining a container view
parameterless, Preparing to Download Bytes from a URL
getAction() function (MotionEvent), Handling Touch Eventswith parameters, Defining an API interface
as target of Message, Message anatomy
for communication between threads, Messages and Message Handlers
Looper and, Passing handlers
handlers, Message anatomypost(Runnable), Passing handlers
background threads and, Assembling a Background Thread
hardware devices, Running on the EmulatorLooper and, Messages and Message Handlers
action, Parts of an implicit intent, Resolving an Implicit Intent
ACTION_CALL category, Challenge: Another Implicit Intent
ACTION_DIAL category, Challenge: Another Implicit Intent
ACTION_IMAGE_CAPTURE action, Using a Camera 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, Resolving an Implicit Intent
CATEGORY_DEFAULT flag, Resolving an Implicit Intent
DEFAULT category, Using NerdLauncher as a Home Screen
explicit intents vs, Implicit Intents, Using Implicit Intents
extras, Parts of an implicit intent
EXTRA_OUTPUT extra, Firing the intent
FLAG_ACTIVITY_NEW_DOCUMENT flag, For the More Curious: Concurrent Documents
FLAG_GRANT_READ_URI_PERMISSION flag, Contacts permissions
FLAG_GRANT_WRITE_URI_PERMISSION flag, Firing the intent
for browsing web content, The Easy Way: Implicit Intents
HOME category, Using NerdLauncher as a Home Screen
LAUNCHER category, How Android Sees Your Activities, Resolving an Implicit Intent
MAIN category, How Android Sees Your Activities, Resolving an Implicit Intent
parts of, Parts of an implicit intent
inflating layouts, From Layout XML to View Objects, Implementing fragment lifecycle functionstaking pictures with, Using a Camera Intent
Espresso tool, For the More Curious: Integration Testing
mock objects, For the More Curious: Mocks and Testing
Intent classvs unit testing, Creating a Test Class
about, Using Implicit Intents
addFlags(Int), Starting a new task
constructors, Communicating with intents, Sending a crime report
createChooser(…), Sending a crime report
getBooleanExtra(…), Using intent extras
putExtra(…), Using intent extras
intent filterssetClassName(…), Creating Explicit Intents at Runtime
explained, Parts of an implicit intent
Intent.FLAG_ACTIVITY_NEW_DOCUMENT flag, For the More Curious: Concurrent DocumentsSHOW_NOTIFICATION, Creating and registering a dynamic receiver
(see also broadcast intents, explicit intents, extras, implicit intents, Intent class)
about, Communicating with intents
checking for responding activities, Checking for responding activities
communicating with, Communicating with intents
and companion objects, Using intent extras
extras, Using intent extras
implicit vs explicit, Explicit and implicit intents, Implicit Intents
permissions and, Contacts permissions
regular vs broadcast, Regular Intents vs Broadcast Intents
setting results, Setting a result
interceptors, Searching Flickrtaking pictures with, Using a Camera Intent
enabling, The Harder Way: WebView
JavaScript Object Notation (JSON) (see JSON (JavaScript Object Notation))injecting objects, For the More Curious: Injecting JavaScript Objects
about, Creating an Android Project, For the More Curious: Jetpack, AndroidX, and Architecture Components
Android KTX foundation library, Editing SharedPreferences with Android KTX
androidx.lifecycle package, Including the ViewModel Dependency
AppCompat theme, Modifying the theme
enabling, Creating an Android Project
for backward compatibility, Jetpack libraries
lifecycle-extensions architecture component library (ViewModel), Including the ViewModel Dependency
Jetpack librariesNavigation architecture component library, For the More Curious: Navigation Architecture Component Library
(see also AppCompat foundation library, Room architecture component library, WorkManager architecture component library)
JSON (JavaScript Object Notation)Data Binding architecture component library (see data binding)
about, Fetching JSON from Flickr
deserializing, Deserializing JSON text into model objects
Gson library, Deserializing JSON text into model objects
Moshi library, For the More Curious: Alternate Parsers and Data Formats
jumpDrawablesToCurrentState() function (View), Using LiveData Transformations
enabling in an Android Studio project, Creating an Android Project
exceptions, compiled to java.lang exceptions, Exceptions and Stack Traces
extensions in Android KTX, Editing SharedPreferences with Android KTX
functions public by default, Implementing fragment lifecycle functions
Kotlin annotation processor tool (kotlin-kapt), Room Architecture Component Library
Kotlin files in java directory, From Layout XML to View Objects
Mockito library and, Test Dependencies
kotlin.RuntimeException class, Exceptions and Stack Tracessingle abstract method interfaces (SAMs) and, Setting listeners
android:background, Styles
android:drawableEnd, Referencing resources in XML
android:drawablePadding, Referencing resources in XML
android:icon, Using the Android Asset Studio
android:id, Resources and resource IDs
android:layout_gravity, Creating a landscape layout
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
colorAccent, Adding Theme Colors
colorPrimary, Adding Theme Colors
layout constraints (see constraints)colorPrimaryDark, Adding Theme Colors
(see also constraints, graphical layout tool (Android Studio), layout attributes)
about, App Basics
alternative, Creating a landscape layout
animating, For the More Curious: New Developments in ConstraintLayout
creating layout files, Creating a landscape layout
defining in XML, Laying Out the UI
design guidelines, Editing properties
for images, A Place for Your Photo
inflating, From Layout XML to View Objects, Implementing fragment lifecycle functions
landscape, Creating a landscape layout
naming, Laying Out the UI
nested vs flat, Creating User Interfaces with Layouts and Widgets
previewing, Previewing the layout, Creating a new activity, Testing Alternative Resources
for property animation, Building the Scene
root element, The view hierarchy
testing, Testing Alternative Resources
using guidelines, For the More Curious: New Developments in ConstraintLayout
view groups and, Laying Out the UI
lazy initialization, Add data to your ViewModelview hierarchy and, The view hierarchy
@OnLifecycleEvent(Lifecycle.Event) annotation, Making your thread lifecycle aware
ending lifecycle observation, Making your thread lifecycle aware
lifecycle callbacks, Activity States and Lifecycle Callbackslifecycle observers and lifecycle owners, Making your thread lifecycle aware
LinearLayout class, Laying Out the UI, The view hierarchylifecycle property, Making your thread lifecycle aware
about, Setting listeners
as interfaces, Setting listeners
setting in fragments, Wiring up widgets in a fragment
listssetting up, Setting listeners
displaying, Displaying Lists with RecyclerView
ListView class, For the More Curious: ListView and GridViewgetting item data, Implementing an Adapter to Populate the RecyclerView
about, Using LiveData
and LifecycleOwner, Observing LiveData
observe(), Observing LiveData
Observer and, Observing LiveData
threading and, Using LiveData
load(…) function (SoundPool), Loading SoundsTransformation and, Using LiveData Transformations
about, Localization
creating values resource files, Localizing Resources
default resources and, Default resources
language qualifiers, Localizing Resources
language-region qualifiers, Targeting a region
and other configuration qualifiers, Prioritizing alternative resources
resource selection and Android versions, Targeting a region
testing, Testing Alternative Resources
Log classTranslations Editor, Checking string coverage using the Translations Editor
d(String, String, Throwable), Logging stack traces
levels, For the More Curious: Log Levels
Logcatlogging messages, Making log messages
(see also logging)
about, Using Logcat
filtering, Running on the Emulator, Using Logcat, ViewModel lifecycle and ViewModelProvider
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
Looper classTAG constant, Making log messages
as message loop manager, Messages and Message Handlers
Handler and, Passing handlers
LRU (least recently used) caching strategy, Challenge: Preloading and CachingHandler, Message, and, Handler anatomy
about, Application Threads
@MainThread annotation, Preparing to Download Bytes from a URL
application not responding (ANR) error and, Background threads
as message loop, Messages and Message Handlers
communication with background threads, Messages and Message Handlers
for UI updates, Background threads
IllegalStateException and, Application Threads
NetworkOnMainThreadException and, Executing a web request
UI and, Application Threads
@MainThread annotation, Preparing to Download Bytes from a URLUI responsiveness and, Background threads
adding network permissions, Asking permission to network
adding uses-permission, Asking permission to network
Android versions in, A sane minimum
build process and, For the More Curious: The Android Build Process
margins, For the More Curious: Margins vs Paddingdeclaring Activity in, Declaring activities in the manifest
about, Using a Camera Intent
ACTION_IMAGE_CAPTURE action, Using a Camera Intent
memory leaks, ViewModel lifecycle and ViewModelProviderEXTRA_OUTPUT extra, Firing the intent
(see also app bar)
about, 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
Message classresponding to selections, Responding to menu selections
about, Message anatomy
messagesHandler and, Messages and Message Handlers
about, Message anatomy
message handlers, Message anatomy
message loop, Messages and Message Handlers
Migration class (Room), Adding a Suspect to the Model Layermessage queue, Messages and Message Handlers
benefits, Deciding to use MVC
drawbacks, Different Architectures: Why Bother?
flow of control, Model-View-Controller and Android
Model-View-View Model (MVVM), Different Architectures: Why Bother?, Binding to Datawhen not to use, Deciding to use MVC
about, Handling Touch Events
actions, Handling Touch Events
MotionLayout class, For the More Curious: New Developments in ConstraintLayoutgetAction(), Handling Touch Events
activity states and, For the More Curious: UI Updates and Multi-Window Mode
entering and exiting, Temporarily leaving an activity
MVC (see Model-View-Controller (MVC))multi-resume support, For the More Curious: UI Updates and Multi-Window Mode
android, Theme spelunking
Android resource XML, The view hierarchy
app, The app namespace
naming conventionstools, Updating the View Layer
for classes, Navigating in Android Studio
for extras, Using intent extras
for layouts, Laying Out the UI
for menu files, Defining a menu in XML
for packages, Creating an Android Project
for unused parameters, Sending data to the target fragment
Navigation architecture component library, For the More Curious: Navigation Architecture Component Libraryfor style inheritance, Style inheritance
about, HTTP and Background Tasks
background threads and, Preparing to Download Bytes from a URL
canceling requests, For the More Curious: Canceling Requests
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
NetworkOnMainThreadException class, Executing a web requestStrictMode and, For the More Curious: StrictMode
(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
filtering from app in the foreground, Filtering Foreground Notifications
notify(…) function (NotificationManager), Notifying the Usernotification channels, Notifying the User
querying, Firing the intent
packages, naming, Creating an Android ProjectresolveActivity(…), Checking for responding activities
adding to manifest, Asking permission to network
android:grantUriPermissions attribute, Using FileProvider, Firing the intent
for broadcast receivers, Limiting broadcasts to your app using private permissions
for contacts database, Contacts permissions
Intent.FLAG_GRANT_READ_URI_PERMISSION flag, Contacts permissions
Intent.FLAG_GRANT_WRITE_URI_PERMISSION flag, Firing the intent
INTERNET, Asking permission to network
normal, Asking permission to network
private, Limiting broadcasts to your app using private permissions
protection levels, More about protection levels
Request App Permissions guide, Challenge: Another Implicit Intent
revoking, Scaling and Displaying Bitmaps
photosruntime, Challenge: Another Implicit Intent
capturing full resolution, Firing the intent
capturing thumbnails, Firing the intent
designating file location for, Designating a picture location
scaling and displaying bitmaps, Scaling and Displaying Bitmaps
PhotoView class, Scaling and Displaying Bitmapstaking with intents, Using a Camera Intent
progress indicator, hiding, Using WebChromeClient to spruce things uptask killer apps and, For the More Curious: Processes vs Tasks
adding dependencies, Including the ViewModel Dependency
adding resources, Adding resources to a project
app/java directory, From Layout XML to View Objects
configuring, Creating an Android Project
creating, Creating an Android Project
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
about, Adding a RecyclerView
as a ViewGroup, Creating an Item View Layout
creating views, Recycling Views
for displaying a grid, Creating PhotoGallery
for downloading on demand, Downloading Lots of Small Things
item views, Creating an Item View Layout
LayoutManager and, Adding a RecyclerView
setOnItemClickListener(…), The Easy Way: Implicit Intents
ViewHolder and, Implementing a ViewHolder
release key, For the More Curious: The Android Build Processvs ListView and GridView, For the More Curious: ListView and GridView
about, Resolving an Implicit Intent
ActivityInfo and, Creating Explicit Intents at Runtime
resource IDsloadLabel(PackageManager), Resolving an Implicit Intent
about, Resources and resource IDs
resources+ prefix in, Resources and resource IDs
(see also configuration qualifiers, drawables, layouts, menus, string resources)
about, Resources and resource IDs
adding, Adding resources to a project
alternative, Prioritizing alternative resources
vs assets, Importing Assets
default, Default resources
localizing, Localization
location, Resources and resource IDs
referencing in XML, Referencing resources in XML
Resources.NotFoundException class, Default resourcesstring, android:text
Call class, Defining an API interface
Converter.Factory class, Adding a String converter
defining an API interface, Defining an API interface
enqueue(…), Executing a web request
Retrofit.Builder() class (Retrofit), Building the Retrofit object and creating an API instanceRetrofit.Builder() class, Building the Retrofit object and creating an API instance
@Dao annotation, Defining a Data Access Object
@Database annotation, Creating a database class, Adding a Suspect to the Model Layer
@Entity annotation, Defining entities
@Insert annotation, Updating the Database
@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 to the Model Layer
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
LiveData and, Using LiveData
Migration class, Adding a Suspect to the Model Layer
Room.databaseBuilder(), Accessing the Database Using the Repository Pattern
setting up a database, Room Architecture Component Library
specifying type converters, Creating a type converter
SQL commands, Defining a Data Access Object
SQLite in, Creating a type converter
rotationupdating database version, Adding a Suspect to the Model Layer
activity lifecycle and, Rotating an activity, Wiring up widgets in a fragment
run configurations (Android Studio), Data Binding Callbacksfragment lifecycle and, Wiring up widgets in a fragment
strengths and weaknesses, ViewModel vs Saved Instance State
scale-independent pixel, Screen Pixel Densitiesvs ViewModel class, ViewModel vs Saved Instance State
(see also compatibility)
about, Compile SDK version
codenames, Android SDK Versions
compatibility, Compatibility and Android Programming
installing, Downloading Earlier SDK Versions
listed, Android SDK Versions
minimum required, A sane minimum
target, A sane minimum
searchupdating, Downloading Earlier SDK Versions
in Flickr, Searching Flickr
integrating into app, SearchView and SharedPreferences
SearchView classuser-initiated, Using SearchView
about, Using SearchView
OnQueryTextListener(…), Responding to SearchView user interactions
setArguments(…) function (Fragment), Attaching arguments to a fragmentresponding to user interactions, Responding to SearchView user interactions
activity/fragment lifecycles and, Accessing the Database Using the Repository Pattern
solutions file, Adding an Iconbenefits and drawbacks, For the More Curious: Singletons
audio playback, Playing Sounds
creating, Creating a SoundPool
load(…), Loading Sounds
loading sounds, Loading Sounds
play(…), Playing Sounds
release(), Unloading Sounds
sp (scale-independent pixel), Screen Pixel Densitiesunloading sounds, Unloading Sounds
in Logcat, Exceptions and Stack Traces
startActivity(Intent) function (Activity), Starting an Activity, Sending a crime reportlogging, Logging stack traces
about, android:text
creating, Creating string resources
referencing, Referencing resources in XML
res/values/strings.xml, Creating string resources
String typestrings file, android:text
fileList(…), File Storage
replace(…), Wiring Up Assets for Use
@StringRes annotation, Creating a New Classsplit(…), Wiring Up Assets for Use
inheritance, Style inheritance, For the More Curious: More on Style Inheritance
modifying widget attributes, Modifying Button Attributes
res/values/styles.xml file, Styles
system icons, Using the Android Asset Studiothemes and, Styles, themes, and theme attributes
about, TalkBack
Android widgets’ inherent support, Explore by Touch
enabling, TalkBack
linear navigation by swiping, Linear navigation by swiping
target fragments, Setting a target fragmentnon-text elements and, Adding content descriptions
about, Tasks and the Back Stack
Back button and, Tasks and the Back Stack
vs processes, For the More Curious: Processes vs Tasks
starting new, Starting a new task
@Test annotation, Writing Testsswitching between, Switching between tasks
example, Laying Out the UI
inheritance, Challenge: From Button to ImageButton
setText(Int), Using intent extras
TextWatcher interface, onTextChanged(…), Wiring up widgets in a fragmenttools:text and, Updating the View Layer
about, Themes
accessing attributes, For the More Curious: Accessing Theme Attributes
adding colors, Adding Theme Colors
attributes, Adding Theme Colors
modifying, Modifying the theme
overriding attributes, Overriding Theme Attributes
threadsstyles and, Styles, themes, and theme attributes
(see also background threads, main thread)
@MainThread annotation, Preparing to Download Bytes from a URL
@UiThread annotation, Preparing to Download Bytes from a URL
@WorkerThread annotation, Preparing to Download Bytes from a URL
communication between main and background threads, Messages and Message Handlers
Handler and, Messages and Message Handlers
main vs background, Executing a web request
message queue, Messages and Message Handlers
processes and, For the More Curious: Processes vs Tasks
as sequences of execution, Application Threads
ticker text, Notifying the User
makeText(…), Making Toasts
toasts, Making Toastsshow(), Making Toasts
action constants, Handling Touch Events
handling, Responding to Presses, Handling Touch Events
handling with GestureDetector, For the More Curious: GestureDetector
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
@Before annotation, Setting Up Your Test, Writing Tests
Hamcrest tool, Test Dependencies
vs integration testing, Creating a Test Class
JUnit testing framework, Creating a Test Class
matchers, Test Dependencies
mock objects, Test Dependencies, Testing object interactions, For the More Curious: Mocks and Testing
Mockito tool, Test Dependencies
naming conventions for, Setting up the test subject
testing frameworks, Creating a Test Class
@Update annotation, Updating the Databasetesting object interactions, Testing object interactions
activities vs fragments in, The Need for UI Flexibility
defined by layout, App Basics
flexibility in, The Need for UI Flexibility
laying out, Laying Out the UI
<uses-feature> tag, Declaring FeaturesUI fragments and, Introducing Fragments
bottom, Simple Property Animation
draw(), Rendering Inside onDraw(Canvas)
height, Simple Property Animation
invalidate(), Tracking across motion events
jumpDrawablesToCurrentState(), Using LiveData Transformations
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, Handling Touch Events
right, Simple Property Animation
setOnClickListener(OnClickListener), Setting listeners
setOnTouchListener(…), Handling Touch Events
subclasses, Laying Out the UI, Challenge: From Button to ImageButton
view models (in MVVM), Binding to Data
about, Adding a ViewModel
activity lifecycle and, ViewModel lifecycle and ViewModelProvider
fragment lifecycle and, ViewModel lifecycle with fragments, Networking Across Configuration Changes
onCleared(), Adding a ViewModel
for storage, Adding a New Fragment and ViewModel
strengths and weaknesses, ViewModel vs Saved Instance State
ViewModelProvider class, Adding a ViewModelvs saved instance state, ViewModel vs Saved Instance State
about, Laying Out the UI
action, Using SearchView
adding in graphical layout editor, Adding widgets
creating custom views, Creating a Custom View
creation by RecyclerView, Recycling Views
custom, Creating a Custom View
draw order, Simple Property Animation
hierarchy, The view hierarchy
invalid, Rendering Inside onDraw(Canvas)
persisting, Challenge: Saving State
simple vs composite, Creating a Custom View
size settings, Making room
touch events and, Handling Touch Events
using fully qualified name in layout, Creating BoxDrawingView
view groups, Laying Out the UI
view layer, Model-View-Controller and Android
view objects, Model-View-Controller and Android
ViewTreeObserver class, Challenge: Efficient Thumbnail Loadwidgets, Laying Out the UI
browsing via implicit intent, The Easy Way: Implicit Intents
converting web response data, Adding a String converter
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)
for enhancing appearance of WebView, Using WebChromeClient to spruce things up
onProgressChanged(…), Using WebChromeClient to spruce things up
WebSettings class, The Harder Way: WebViewonReceivedTitle(…), Using WebChromeClient to spruce things up
for presenting web content, The Harder Way: WebView
handling rotation, Proper Rotation with WebView
WebViewClient classvs custom UI, WebView vs a Custom UI
about, The Harder Way: WebView
widgetsshouldOverrideUrlLoading(…), The Harder Way: WebView
about, Laying Out the UI
adding in graphical layout editor, Adding widgets
attributes, Laying Out the UI
Button, Laying Out the UI, Challenge: From Button to ImageButton
CheckBox, Defining CrimeFragment’s layout
defining in XML, Laying Out the UI
EditText, Defining CrimeFragment’s layout
FrameLayout, Creating a landscape layout
ImageButton, Challenge: From Button to ImageButton
LinearLayout, Laying Out the UI, The view hierarchy
modifying attributes, Modifying Button Attributes
references, Getting references to widgets
styles and, Styles
and TalkBack, Explore by Touch
TextView, Laying Out the UI, Updating the View Layer
in view hierarchy, The view hierarchy
as view layer, Model-View-Controller and Android
wiring up, Wiring Up Widgets
work requestswiring up in fragments, Wiring up widgets in a fragment
about, Scheduling Work
Worker classconstraints for, Scheduling Work
about, Creating a Worker
doWork(), Creating a Worker
enabling and disabling, Providing User Control over Polling
performing synchronous tasks, Checking for New Photos
@WorkerThread annotation, Preparing to Download Bytes from a URLscheduling with WorkRequest, Scheduling Work
(see also individual class names)
about, WorkManager
Constraints, Scheduling Work
Worker, Creating a Worker
WorkRequest classWorkRequest, Creating a Worker
about, Creating a Worker
Constraints and, Scheduling Work
scheduling a Worker, Scheduling Work
wrap_content, android:layout_width and android:layout_heightsubclasses, Scheduling Work
Android namespace, The view hierarchy
XML drawables (see drawables)referencing resources in, Referencing resources in XML