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

.apk file, For the More Curious: The Android Build Process, For the More Curious: Mipmap Images
9-patch images, For the More Curious: 9-Patch Images
<uses-feature> tag, Declaring Features
?? (null coalescing) operator, Syntactic sugar
@+id, Resources and resource IDs
@Before annotation, Setting Up Your Test
@Bindable annotation, Observable data
@Dao annotation (Room), Defining a Data Access Object
@Database annotation (Room), Creating a database class, Adding a Suspect to the Model Layer
@Entity annotation (Room), Defining entities
@GET annotation

parameterless, Preparing to Download Bytes from a URL

with parameters, Defining an API interface

@Insert annotation, Updating the Database
@MainThread annotation, Preparing to Download Bytes from a URL
@OnLifecycleEvent(Lifecycle.Event) annotation, Making your thread lifecycle aware
@PrimaryKey annotation (Room), Defining entities
@Query annotation

in Retrofit, Searching Flickr

in Room, Defining a Data Access Object

@string/ syntax, android:text
@StringRes annotation, Creating a New Class
@Test annotation, Writing Tests
@TypeConverter annotation (Room), Creating a type converter
@TypeConverters annotation (Room), Creating a type converter
@UiThread annotation, Preparing to Download Bytes from a URL
@Update annotation, Updating the Database
@WorkerThread annotation, Preparing to Download Bytes from a URL
@{} (binding mustache) operator, Binding to Data, Binding to a view model

A

aapt2 (Android Asset Packing tool), For the More Curious: The Android Build Process
abstract classes, Creating a database class
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 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

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

Accessibility Scanner, For the More Curious: Using Accessibility Scanner
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_IMAGE_CAPTURE action (MediaStore), Firing the 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

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

record, Saved instance state and activity records

rotation and, Rotating an activity

single activity architecture, Single Activity: Fragment Boss

stack, How Android Sees Your Activities

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

UI flexibility and, The Need for UI Flexibility

Activity class

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

startActivityForResult(…), Getting a result back from a child activity

activity record, Saved instance state and activity records
ActivityInfo class (ResolveInfo), Creating Explicit Intents at Runtime
ActivityManager class

back stack, How Android Sees Your Activities

starting activities, Starting an Activity, Sending back an intent

ActivityNotFoundException class, Communicating with intents
Adapter class

about, Implementing an Adapter to Populate the RecyclerView

getItemCount(), Implementing an Adapter to Populate the RecyclerView

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), Fragment transactions
addFlags(Int) function (Intent), Starting a new task
addToBackStack(String) function (FragmentTransaction), Replacing a fragment
Android Asset Packing tool (aapt), For the More Curious: The Android Build Process
Android Asset Studio, Using the Android Asset Studio
Android Debug Bridge (adb) driver, Running on a Device
Android developer documentation, Using the Android Developer Documentation
Android firmware versions, Android SDK Versions
Android Lint

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

suppressing warnings, Using handlers

Android SDK Manager, Downloading Earlier SDK Versions
Android Studio

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

(see also Logcat, logging)

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

variables view, Setting breakpoints

Android versions (see SDK versions)
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:background attribute, Styles
android:configChanges attribute, Proper Rotation with WebView
android:contentDescription attribute, Challenge: From Button to ImageButton, Adding content descriptions
android:documentLaunchMode attribute, For the More Curious: Concurrent Documents
android:drawableEnd attribute, Referencing resources in XML
android:drawablePadding attribute, Referencing resources in XML
android:focusable attribute, Making a widget focusable
android:grantUriPermissions attribute, Using FileProvider, Firing the intent
android:icon attribute, Using the Android Asset Studio
android:id attribute, Resources and resource IDs
android:labelFor attribute, Challenge: Providing Enough Context for Data Entry
android:layout_gravity attribute, Creating a landscape layout
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
android:orientation attribute, android:orientation
android:padding attribute, For the More Curious: Margins vs Padding
android:protectionLevel attribute, More about protection levels
android:text attribute, android:text
AndroidManifest.xml (see manifest)
AndroidX (see Jetpack libraries)
animation

(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

translation, Simple Property Animation

AnimatorListener class, Playing Animators Together
AnimatorSet class

about, Playing Animators Together

play(Animator), Playing Animators Together

API levels (see SDK versions)
.apk file, For the More Curious: The Android Build Process, For the More Curious: Mipmap Images
app bar

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

terminology vs action bar, toolbar, For the More Curious: App Bar vs Action Bar vs Toolbar

app features

app bar, The App Bar

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:showAsAction attribute, Defining a menu in XML
AppCompat foundation library

about, AppCompat Default App Bar

app namespace, The app namespace

themes in, Modifying the theme

AppCompatActivity class, From Layout XML to View Objects
application architecture

about, Different Architectures: Why Bother?

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

with fragments, Application Architecture with Fragments

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
AppTheme theme, Modifying the theme
Array.last(…) function, Wiring Up Assets for Use
AssetManager class

about, Accessing Assets

list(String), Accessing Assets

assets

about, Importing Assets

accessing, Accessing Assets

importing, Importing Assets

managing, Accessing Assets

presenting to user, Wiring Up Assets for Use

vs resources, Importing Assets

attributes

(see also layout attributes, individual attribute names)

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

B

Back button, Finishing an activity, Tasks and the Back Stack, Challenge: Using the Back Button for Browser History
back stack, How Android Sees Your Activities
background threads

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

Worker and, Creating a Worker

BaseObservable class, Observable data
@Before annotation, Setting Up Your Test
beginTransaction() function (FragmentManager), Fragment transactions
@Bindable annotation, Observable data
Bitmap class, Scaling and Displaying Bitmaps
BitmapFactory class

decodeFile(photoFile.getPath()), Scaling and Displaying Bitmaps

decodeStream(InputStream), Preparing to Download Bytes from a URL

bitmaps

caching, Challenge: Preloading and Caching

downloading, Preparing to Download Bytes from a URL

resizing, Scaling and Displaying Bitmaps

scaling and displaying, Scaling and Displaying Bitmaps

bottom property (View), Simple Property Animation
breakpoints, setting

(see also debugging)

broadcast intents

about, Regular Intents vs Broadcast Intents

ordered, Passing and receiving data with ordered broadcasts

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

sending, Sending broadcast intents

broadcast receivers

about, Regular Intents vs Broadcast Intents

dynamic, Creating and registering a dynamic receiver

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

standalone, Creating and registering a standalone receiver

broadcasts, system vs custom, Regular Intents vs Broadcast Intents
build errors, Issues with the R class

(see also debugging)

build process, For the More Curious: The Android Build Process
build tool window (Android Studio), Navigating in Android Studio
build.gradle, A sane minimum
Build.VERSION.SDK_INT, Adding code from later APIs safely
Bundle class

in onCreate(Bundle?), Saving Data Across Process Death

in onSaveInstanceState(Bundle), Saving Data Across Process Death

putCharSequence(…), Fragment Arguments

putInt(…), Fragment Arguments

putSerializable(…), Fragment Arguments

Button class

example, Laying Out the UI

vs ImageButton, Challenge: From Button to ImageButton

inheritance, Challenge: From Button to ImageButton

buttons

(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

9-patch images for, For the More Curious: 9-Patch Images

by lazy, Add data to your ViewModel

C

caching

about, Challenge: Preloading and Caching

LRU (least recently used) strategy, Challenge: Preloading and Caching

Calendar class, Passing data to DatePickerFragment
Call class (Retrofit), Defining an API interface
callback interfaces, in fragments, Fragment callback interfaces
camera

about, Taking Pictures with Intents

firing intent, Firing the intent

taking pictures with intents, Using a Camera Intent

Canvas class, Rendering Inside onDraw(Canvas)
Channel class, Notifying the User
CheckBox class, Defining CrimeFragment’s layout
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 widgets

inner classes, Using handlers

code completion, Making Toasts
codenames, version, Android SDK Versions
color

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

themes and, Adding Theme Colors

companion objects, Using intent extras
compatibility

Android Lint and, Adding code from later APIs safely

fragments and, Different types of fragments

importance, Android SDK Versions

issues, Compatibility and Android Programming

Jetpack libraries and, Different types of fragments

minimum SDK version and, Minimum SDK version

using conditional code for, Adding code from later APIs safely

wrapping code for, Adding code from later APIs safely

compile SDK version, Compile SDK version
compileSdkVersion, A sane minimum
ComponentName class, Creating Explicit Intents at Runtime
components, Communicating with intents
concurrent documents, For the More Curious: Concurrent Documents
configuration changes

activity/fragment lifecycles and, Wiring up widgets in a fragment

android:configChanges attribute and, Proper Rotation with WebView

effect on activities, Rotating an activity

effect on fragments, Rotation and retained fragments

configuration qualifiers

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

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

ConstraintLayout class

about, Introducing ConstraintLayout

converting layout to use, Introducing the Graphical Layout Editor

Guideline, For the More Curious: New Developments in ConstraintLayout

MotionLayout, For the More Curious: New Developments in ConstraintLayout

constraints

about, Introducing ConstraintLayout

adding in graphical layout editor, Adding widgets

in XML, ConstraintLayout’s inner workings

removing, Using ConstraintLayout

warnings when insufficient, Using ConstraintLayout

Constraints class, and WorkRequest, Scheduling Work
contacts

getting data from, Getting data from the contacts list

permissions for, Contacts permissions

container views

about, Defining a container view

IDs, Fragment transactions

ContentProvider class, Getting data from the contacts list

(see also FileProvider convenience class)

ContentResolver class, Getting data from the contacts list
Context class

AssetManager, Accessing Assets

explicit intents and, Communicating with intents

functions for private files and directories, File Storage

resource IDs and, Making Toasts

revokeUriPermission(…), Scaling and Displaying Bitmaps

Context.MODE_WORLD_READABLE, File Storage
controller objects, Model-View-Controller and Android
conventions (see naming conventions)
Converter.Factory class (Retrofit), Adding a String converter
converters

about, Adding a String converter

converter factories, Adding a String converter

scalars converter, Adding a String converter

createChooser(…) function (Intent), Sending a crime report

D

d(String, String, Throwable) function (Log), Logging stack traces
@Dao annotation (Room), Defining a Data Access Object
data access objects (DAOs), Defining a Data Access Object
data binding

about, Implementing Simple Data Binding

@{} (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

view models and, Binding to Data, Binding to a view model

Data Binding architecture component library (see data binding)
data classes, Creating a New Class
data persistence

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

using ViewModel, ViewModel lifecycle and ViewModelProvider

data/data directory, Uploading test data
@Database annotation (Room), Creating a database class, Adding a Suspect to the Model Layer
databases

(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

schemas, Challenge: Addressing the Schema Warning

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

type conversion, Creating a type converter

Date class, Passing data to DatePickerFragment
DateFormat class, Challenge: Formatting the Date
DatePickerDialog class

about, Dialogs

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

using breakpoints, Setting breakpoints

DEFAULT category (Intent), Using NerdLauncher as a Home Screen
default resources, Default resources
density-independent pixel, Screen Pixel Densities
dependencies, adding, Including the ViewModel Dependency
dependency injection (DI) design pattern

about, For the More Curious: Managing Dependencies

injectors, For the More Curious: Singletons

developer documentation, Using the Android Developer Documentation
devices

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

virtual, Running on the Emulator

devices view (Android Studio), Running on a Device
Dialog class, Dialogs
DialogFragment class

about, Creating a DialogFragment

onCreateDialog(Bundle?), Creating a DialogFragment

show(…), Showing a DialogFragment

dialogs, Dialogs
dip (density-independent pixel), Screen Pixel Densities
documentation, Using the Android Developer Documentation
dp (density-independent pixel), Screen Pixel Densities
draw() function (View), Rendering Inside onDraw(Canvas)
drawables

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

XML drawables, XML Drawables

drawing

Canvas, Rendering Inside onDraw(Canvas)

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

Paint, Rendering Inside onDraw(Canvas)

E

editor (Android Studio), Navigating in Android Studio
EditText class, Defining CrimeFragment’s layout
emulator

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

simulating network types, Scheduling Work

enqueue(…) function (Retrofit), Executing a web request
@Entity annotation (Room), Defining entities
errors

(see also debugging, exceptions)

Android Studio indicators, Getting references to widgets

avoiding using StrictMode, For the More Curious: StrictMode

ERROR log level, For the More Curious: Log Levels

escape sequence (in string), Updating the View Layer
event buses, For the More Curious: Local Events
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 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

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

execute function (Executor), Using an executor
executePendingBindings() function (ViewDataBinding), Binding to a view model
Executor class

about, Using an executor

and Executors.newSingleThreadExecutor(), Using an executor

execute, Using an executor

explicit intents

about, Explicit and implicit intents, Implicit Intents

creating, Communicating with intents

creating at runtime, Creating Explicit Intents at Runtime

implicit intents vs, 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

File class

getCacheDir(), File Storage

getDir(…), File Storage

getFilesDir(), File Storage

file storage

authorities, Using FileProvider

granting write permission, Using FileProvider, Firing the intent

private, File Storage

revoking write permission, Scaling and Displaying Bitmaps

shared between apps, File Storage

FileDescriptor class, Accessing Assets
FileInputStream.openFileInput(…), File Storage
fileList(…) function (String), File Storage
FileOutputStream.openFileOutput(…), File Storage
FileProvider convenience class, Using FileProvider
Flickr

API, Fetching JSON from Flickr

searching in, Searching Flickr

fluent interface, Fragment transactions
format strings, Using a Format String
fragment arguments, Fragment Arguments, For the More Curious: Why Use Fragment Arguments?, Passing data to DatePickerFragment
Fragment class

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

onPause(), The FragmentManager and the fragment lifecycle

onResume(), The FragmentManager and the fragment lifecycle

onSaveInstanceState(Bundle), Implementing fragment lifecycle functions

onStart(), The FragmentManager and the fragment lifecycle

onStop(), The FragmentManager and the fragment lifecycle

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

versions, Different types of fragments

fragment transactions

(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

replacing a fragment in an activity, Replacing a fragment

FragmentManager class

adding fragments, Fragment transactions

beginTransaction(), Fragment transactions

responsibilities, Adding a UI fragment to the FragmentManager

role in rotation, Rotation and retained fragments

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

widgets and, Wiring up widgets in a fragment

FragmentTransaction class

add(…), Fragment transactions

addToBackStack(String), Replacing a fragment

replace(…), Replacing a fragment

FrameLayout class

about, Creating a landscape layout

as container view for fragments, Defining a container view

G

GestureDetector class, For the More Curious: GestureDetector
@GET annotation

parameterless, Preparing to Download Bytes from a URL

with parameters, Defining an API interface

getAction() function (MotionEvent), Handling Touch Events
getArguments(…) function (Fragment), Retrieving arguments
getBooleanExtra(…) function (Intent), Using intent extras
getCacheDir() function (File), File Storage
getDir(…) function (File), File Storage
getFilesDir() function (File), File Storage
getIntent() function (Activity), Using intent extras
getTargetFragment() function (Fragment), Setting a target fragment
getTargetRequestCode() function (Fragment), Setting a target fragment
Google Drive, For the More Curious: Concurrent Documents
graphical layout tool (Android Studio), Introducing the Graphical Layout Editor, Testing Alternative Resources
GridLayoutManager class, Creating PhotoGallery, Preparing RecyclerView to Display Images
GridView class, For the More Curious: ListView and GridView
Gson library, Deserializing JSON text into model objects
Guideline class, For the More Curious: New Developments in ConstraintLayout

H

Handler class

as target of Message, Message anatomy

for communication between threads, Messages and Message Handlers

Looper and, Passing handlers

post(Runnable), Passing handlers

handlers, Message anatomy
HandlerThread class

background threads and, Assembling a Background Thread

Looper and, Messages and Message Handlers

hardware devices, Running on the Emulator
-hdpi suffix, Adding an Icon
height property (View), Simple Property Animation
Home button, Temporarily leaving an activity
HOME category (Intent), Using NerdLauncher as a Home Screen
Home screen, Using NerdLauncher as a Home Screen
HTTP networking (see networking)

I

icons, Using the Android Asset Studio
IllegalStateException class, ViewModel lifecycle and ViewModelProvider, Accessing the Database Using the Repository Pattern, Showing a DialogFragment
ImageButton class, Challenge: From Button to ImageButton
images, layouts for, A Place for Your Photo
implicit intents

about, Explicit and implicit intents, Implicit Intents

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

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

taking pictures with, Using a Camera Intent

inflating layouts, From Layout XML to View Objects, Implementing fragment lifecycle functions
inheritance, Style inheritance, For the More Curious: More on Style Inheritance
inner classes, and memory leaks, Using handlers
inner keyword, Preparing RecyclerView to Display Images
@Insert annotation, Updating the Database
integration testing

about, For the More Curious: Integration Testing

Espresso tool, For the More Curious: Integration Testing

mock objects, For the More Curious: Mocks and Testing

vs unit testing, Creating a Test Class

Intent 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

setClassName(…), Creating Explicit Intents at Runtime

intent filters

about, How Android Sees Your Activities

explained, Parts of an implicit intent

SHOW_NOTIFICATION, Creating and registering a dynamic receiver

Intent.FLAG_ACTIVITY_NEW_DOCUMENT flag, For the More Curious: Concurrent Documents
Intent.FLAG_GRANT_READ_URI_PERMISSION flag, Contacts permissions
Intent.FLAG_GRANT_WRITE_URI_PERMISSION flag, Firing the intent
intents

(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

taking pictures with, Using a Camera Intent

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

J

JavaScript

enabling, The Harder Way: WebView

injecting objects, For the More Curious: Injecting JavaScript Objects

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

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

Navigation architecture component library, For the More Curious: Navigation Architecture Component Library

Jetpack libraries

(see also AppCompat foundation library, Room architecture component library, WorkManager architecture component library)

Data Binding architecture component library (see data binding)

JSON (JavaScript Object Notation)

about, Fetching JSON from Flickr

arrays, Deserializing JSON text into model objects

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

objects, Deserializing JSON text into model objects

jumpDrawablesToCurrentState() function (View), Using LiveData Transformations

K

Kotlin

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

single abstract method interfaces (SAMs) and, Setting listeners

kotlin.RuntimeException class, Exceptions and Stack Traces

L

lambda expressions, Lambda expressions
-land qualifier, Creating a landscape layout
language qualifiers, Localizing Resources
language settings, device, Localizing Resources
language-region qualifiers, Targeting a region
last(…) function (Array), Wiring Up Assets for Use
launcher activities, How Android Sees Your Activities
LAUNCHER category (Intent), How Android Sees Your Activities, Resolving an Implicit Intent
layer list drawables, Layer List Drawables
layout attributes

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

colorPrimaryDark, Adding Theme Colors

layout constraints (see constraints)
layout parameters, ConstraintLayout’s inner workings
LayoutInflater class, For the More Curious: The Android Build Process, Implementing fragment lifecycle functions
LayoutManager class, Adding a RecyclerView
layouts

(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

view hierarchy and, The view hierarchy

lazy initialization, Add data to your ViewModel
-ldpi suffix, Adding an Icon
left property (View), Simple Property Animation
libraries, Including the ViewModel Dependency
lifecycle awareness

@OnLifecycleEvent(Lifecycle.Event) annotation, Making your thread lifecycle aware

ending lifecycle observation, Making your thread lifecycle aware

lifecycle observers and lifecycle owners, Making your thread lifecycle aware

lifecycle callbacks, Activity States and Lifecycle Callbacks
lifecycle owners, Observing LiveData
lifecycle-aware components, Adding a ViewModel, Observing LiveData
lifecycle-extensions architecture component library (androidx.lifecycle), Including the ViewModel Dependency
LifecycleObserver interface, Making your thread lifecycle aware
LifecycleOwner interface

about, Making your thread lifecycle aware

lifecycle property, Making your thread lifecycle aware

LinearLayout class, Laying Out the UI, The view hierarchy
Lint (see Android Lint)
list(String) function (AssetManager), Accessing Assets
list-detail interfaces, UI Fragments and the Fragment Manager
listeners

about, Setting listeners

as interfaces, Setting listeners

setting in fragments, Wiring up widgets in a fragment

setting up, Setting listeners

lists

displaying, Displaying Lists with RecyclerView

getting item data, Implementing an Adapter to Populate the RecyclerView

ListView class, For the More Curious: ListView and GridView
live data transformations, Using LiveData Transformations
LiveData class

about, Using LiveData

and LifecycleOwner, Observing LiveData

observe(), Observing LiveData

Observer and, Observing LiveData

threading and, Using LiveData

Transformation and, Using LiveData Transformations

load(…) function (SoundPool), Loading Sounds
loadLabel(PackageManager) function (ResolveInfo), Resolving an Implicit Intent
local files, Uploading test data
local layout rect, Simple Property Animation
LocalBroadcastManager class, For the More Curious: Local Events, For the More Curious: Detecting the Visibility of Your Fragment
localization

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

Translations Editor, Checking string coverage using the Translations Editor

Log class

d(String, String, Throwable), Logging stack traces

levels, For the More Curious: Log Levels

logging messages, Making log messages

Logcat

(see also logging)

about, Using Logcat

filtering, Running on the Emulator, Using Logcat, ViewModel lifecycle and ViewModelProvider

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

Looper class

as message loop manager, Messages and Message Handlers

Handler and, Passing handlers

Handler, Message, and, Handler anatomy

LRU (least recently used) caching strategy, Challenge: Preloading and Caching
LRUCache class, Challenge: Preloading and Caching

M

MAIN category (Intent), How Android Sees Your Activities, Resolving an Implicit Intent
main thread

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

UI responsiveness and, Background threads

@MainThread annotation, Preparing to Download Bytes from a URL
makeText(…) function (Toast), Making Toasts
manifest

about, Declaring activities in the manifest

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

declaring Activity in, Declaring activities in the manifest

margins, For the More Curious: Margins vs Padding
master-detail interfaces, UI Fragments and the Fragment Manager
matchers, for testing, Test Dependencies
match_parent, android:layout_width and android:layout_height
-mdpi suffix, Adding an Icon
MediaStore class

about, Using a Camera Intent

ACTION_IMAGE_CAPTURE action, Using a Camera Intent

EXTRA_OUTPUT extra, Firing the intent

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

(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

responding to selections, Responding to menu selections

Message class

about, Message anatomy

Handler and, Messages and Message Handlers

messages

about, Message anatomy

message handlers, Message anatomy

message loop, Messages and Message Handlers

message queue, Messages and Message Handlers

Migration class (Room), Adding a Suspect to the Model Layer
minimum required SDK, A sane minimum
minSdkVersion, A sane minimum
mipmap images, For the More Curious: Mipmap Images
mock objects, for testing, Test Dependencies, Testing object interactions, For the More Curious: Mocks and Testing
model classes, using data keyword, Creating a New Class
model layer, Model-View-Controller and Android
model objects, Model-View-Controller and Android
Model-View-Controller (MVC)

about, Model-View-Controller and Android

benefits, Deciding to use MVC

drawbacks, Different Architectures: Why Bother?

flow of control, Model-View-Controller and Android

when not to use, Deciding to use MVC

Model-View-View Model (MVVM), Different Architectures: Why Bother?, Binding to Data
Moshi library, For the More Curious: Alternate Parsers and Data Formats
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: New Developments in ConstraintLayout
multi-window (split screen) mode

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

entering and exiting, Temporarily leaving an activity

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

MVC (see Model-View-Controller (MVC))
MVVM (Model-View-View Model), Different Architectures: Why Bother?, Binding to Data

N

namespaces

android, Theme spelunking

Android resource XML, The view hierarchy

app, The app namespace

tools, Updating the View Layer

naming conventions

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

for style inheritance, Style inheritance

Navigation architecture component library, For the More Curious: Navigation Architecture Component Library
networking

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

StrictMode and, For the More Curious: StrictMode

NetworkOnMainThreadException class, Executing a web request
newInstance(…) function (Fragment), Attaching arguments to a fragment
newSingleThreadExecutor() function (Executors), Using an executor
9-patch images, For the More Curious: 9-Patch Images
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

filtering from app in the foreground, Filtering Foreground Notifications

notification channels, Notifying the User

notify(…) function (NotificationManager), Notifying the User
null coalescing (??) operator, Syntactic sugar

O

ObjectAnimator class, Simple Property Animation
Observable interface, Observable data
observe() function (LiveData), Observing LiveData
onActivityCreated(Bundle?) function (Fragment), The FragmentManager and the fragment lifecycle
onActivityResult(…) function (Activity), Sending back an intent
onActivityResult(…) function (Fragment), Passing Data Between Two Fragments
onAttach(Context?) function (Fragment), The FragmentManager and the fragment lifecycle
OnCheckedChangeListener interface, Wiring up widgets 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), Activity States and Lifecycle Callbacks
onCreate(Bundle?) function (Fragment), Implementing fragment lifecycle functions, The FragmentManager and 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 FragmentManager and the fragment lifecycle
onDestroy() function (Activity), Activity States and Lifecycle Callbacks
onDestroy() function (Fragment), The FragmentManager and the fragment lifecycle
onDestroyView() function (Fragment), The FragmentManager and the fragment lifecycle
onDetach() function (Fragment), The FragmentManager and the fragment lifecycle
onDraw(Canvas) function (View), Rendering Inside onDraw(Canvas)
OneTimeWorkRequest class (WorkRequest), Scheduling Work
@OnLifecycleEvent(Lifecycle.Event) annotation, Making your thread lifecycle aware
onOptionsItemSelected(MenuItem) function (Fragment), Creating the menu, Responding to menu selections
onPause() function (Activity), Activity States and Lifecycle Callbacks
onPause() function (Fragment), The FragmentManager and the fragment lifecycle
onProgressChanged(…) function (WebChromeClient), Using WebChromeClient to spruce things up
OnQueryTextListener(…) interface (SearchView), Responding to SearchView user interactions
onReceivedTitle(…) function (WebChromeClient), Using WebChromeClient to spruce things up
onRestoreInstanceState(Parcelable) function (View), Challenge: Saving State
onResume() function (Activity), Activity States and Lifecycle Callbacks
onResume() function (Fragment), The FragmentManager and the fragment lifecycle
onSaveInstanceState() function (View), Challenge: Saving State
onSaveInstanceState(Bundle) function (Activity), Saving Data Across Process Death
onSaveInstanceState(Bundle) function (Fragment), Implementing fragment lifecycle functions
onStart() function (Activity), Activity States and Lifecycle Callbacks
onStart() function (Fragment), The FragmentManager and the fragment lifecycle
onStop() function (Activity), Activity States and Lifecycle Callbacks
onStop() function (Fragment), The FragmentManager and the fragment lifecycle
onTextChanged(…) function (TextWatcher), Wiring up widgets in a fragment
onTouchEvent(MotionEvent) function (View), Handling Touch Events
OnTouchListener interface (View), Handling Touch Events
onViewCreated(…) function (Fragment), The FragmentManager and the fragment lifecycle
openFileInput(…) function (FileInputStream), File Storage
openFileOutput(…) function (FileInputStream), 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, Switching between tasks

P

PackageManager class

about, Checking for responding activities

querying, Firing the intent

resolveActivity(…), Checking for responding activities

packages, naming, Creating an Android Project
padding, For the More Curious: Margins vs Padding
Paint class, Rendering Inside onDraw(Canvas)
parameters, _ to denote unused, Sending data to the target fragment
Parcelable interface, Challenge: Saving State
paused activity state, Activity States and Lifecycle Callbacks, For the More Curious: UI Updates and Multi-Window Mode
perceived lifetime of a fragment, Making your thread lifecycle aware
PeriodicWorkRequest class (WorkRequest), Scheduling Work
permissions

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

runtime, Challenge: Another Implicit Intent

photos

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

taking with intents, Using a Camera Intent

PhotoView class, Scaling and Displaying Bitmaps
placeholders (in format strings), Using a Format String
play(Animator) function (AnimatorSet), Playing Animators Together
play(…) function (SoundPool), Playing Sounds
PointF class, Handling Touch Events
post(Runnable) function (Handler), Passing handlers
preloading, Challenge: Preloading and Caching
presses (see touch events)
@PrimaryKey annotation (Room), Defining entities
processes

about, For the More Curious: Processes vs Tasks

death, Saving Data Across Process Death

task killer apps and, For the More Curious: Processes vs Tasks

progress indicator, hiding, Using WebChromeClient to spruce things up
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 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

setting project name, Creating an Android Project

property animation (see animation)
protection level values, More about protection levels
putCharSequence(…) function (Bundle), Fragment Arguments
putInt(…) function (Bundle), Fragment Arguments
putSerializable(…) function (Bundle), Fragment Arguments

Q

@Query annotation

in Retrofit, Searching Flickr

in Room, Defining a Data Access Object

R

randomUUID() function (UUID), Creating a Data Class
Recents button, Temporarily leaving an activity
RecyclerView class

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

vs ListView and GridView, For the More Curious: ListView and GridView

release key, For the More Curious: The Android Build Process
release() function (SoundPool), Unloading Sounds
replace(…) function (FragmentTransaction), Replacing a fragment
replace(…) function (String), Wiring Up Assets for Use
repositories, Accessing the Database Using the Repository Pattern, Moving toward the repository pattern
repository pattern for app architecture, Accessing the Database Using the Repository Pattern, Moving toward the repository pattern
request code (Activity), Getting a result back from a child activity
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
res/values/colors.xml file, Color Resources
res/values/styles.xml file, Styles
resolveActivity(…) function (PackageManager), Checking for responding activities
ResolveInfo class

about, Resolving an Implicit Intent

ActivityInfo and, Creating Explicit Intents at Runtime

loadLabel(PackageManager), Resolving an Implicit Intent

resource IDs

about, Resources and resource IDs

+ prefix in, Resources and resource IDs

resources

(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

string, android:text

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
retainInstance property (Fragment), Rotation and retained fragments
Retrofit library

about, Networking Basics with Retrofit

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, Building the Retrofit object and creating an API instance

Retrofit.Builder() class (Retrofit), Building the Retrofit object and creating an API instance
revokeUriPermission(…) function (Context), Scaling and Displaying Bitmaps
right property (View), Simple Property Animation
Room architecture component library

@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

updating database version, Adding a Suspect to the Model Layer

rotation

activity lifecycle and, Rotating an activity, Wiring up widgets in a fragment

fragment lifecycle and, Wiring up widgets in a fragment

run configurations (Android Studio), Data Binding Callbacks
running on device, Running on a Device
RxJava, Using RxJava

S

SAMs (single abstract method interfaces), Setting listeners
sandbox, Uploading test data
saved instance state

about, Saving Data Across Process Death

strengths and weaknesses, ViewModel vs Saved Instance State

vs ViewModel class, ViewModel vs Saved Instance State

scale-independent pixel, Screen Pixel Densities
scope, ViewModel lifecycle and ViewModelProvider
screen orientation, Creating a landscape layout
screen pixel density, Adding an Icon, Screen Pixel Densities, Screen density works differently
screen size, determining, For the More Curious: More on Determining Device Size
SDK versions

(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

updating, Downloading Earlier SDK Versions

search

about, SearchView and SharedPreferences

in Flickr, Searching Flickr

integrating into app, SearchView and SharedPreferences

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

setArguments(…) function (Fragment), Attaching arguments to a fragment
setClassName(…) function (Intent), Creating Explicit Intents at Runtime
setContentView(…) function (Activity), From Layout XML to View Objects
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
setTargetFragment(…) function (Fragment), Setting a target fragment
setText(Int) function (TextView), Using intent extras
shape drawables, Shape Drawables
ShapeDrawable class, Shape Drawables
SharedPreferences class, Simple Persistence with SharedPreferences
shouldOverrideUrlLoading(…) function (WebViewClient), The Harder Way: WebView
show() function (Toast), Making Toasts
show(…) function (DialogFragment), Showing a DialogFragment
simulator (see emulator)
single abstract method interfaces (SAMs), Setting listeners
single activity architecture, Single Activity: Fragment Boss
Single Responsibility Principle, Binding to Data
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

solutions file, Adding an Icon
SoundPool class

about, Unit Testing and Audio Playback

audio playback, Playing Sounds

creating, Creating a SoundPool

load(…), Loading Sounds

loading sounds, Loading Sounds

play(…), Playing Sounds

release(), Unloading Sounds

unloading sounds, Unloading Sounds

sp (scale-independent pixel), Screen Pixel Densities
split(…) function (String), Wiring Up Assets for Use
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(…) function (Activity), Getting a result back from a child activity
stashed activity state, Saved instance state and activity records
state list drawables, State List Drawables
stopped activity state, Activity States and Lifecycle Callbacks
StrictMode class, For the More Curious: StrictMode
@string/ syntax, android:text
string resources

about, android:text

creating, Creating string resources

referencing, Referencing resources in XML

res/values/strings.xml, Creating string resources

strings file, android:text

String type

fileList(…), File Storage

replace(…), Wiring Up Assets for Use

split(…), Wiring Up Assets for Use

@StringRes annotation, Creating a New Class
strings, format, Using a Format String
Structured Query Language (SQL), Defining a Data Access Object
styles

about, Styles, themes, and theme attributes, Styles

inheritance, Style inheritance, For the More Curious: More on Style Inheritance

modifying widget attributes, Modifying Button Attributes

res/values/styles.xml file, Styles

themes and, Styles, themes, and theme attributes

system icons, Using the Android Asset Studio

T

TAG constant, Making log messages
TalkBack

about, TalkBack

Android widgets’ inherent support, Explore by Touch

enabling, TalkBack

linear navigation by swiping, Linear navigation by swiping

non-text elements and, Adding content descriptions

target fragments, Setting a target fragment
target SDK version, A sane minimum, Target SDK version
targetSdkVersion, A sane minimum
tasks

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

switching between, Switching between tasks

@Test annotation, Writing Tests
TextView class

example, Laying Out the UI

inheritance, Challenge: From Button to ImageButton

setText(Int), Using intent extras

tools:text and, Updating the View Layer

TextWatcher interface, onTextChanged(…), Wiring up widgets in a fragment
theme attribute, Modifying the theme
themes

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

styles and, Styles, themes, and theme attributes

threads

(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

UI, Application Threads

ticker text, Notifying the User
TimeInterpolator class, Using different interpolators
tinting, widgets, Adding Theme Colors
Toast class

makeText(…), Making Toasts

show(), Making Toasts

toasts, Making Toasts
tool windows (Android Studio), Navigating in Android Studio
Toolbar class, For the More Curious: App Bar vs Action Bar vs Toolbar
tools:text attribute, Updating the View Layer
top property (View), Simple Property Animation
touch events

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

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
-tvdpi suffix, Adding an Icon
@TypeConverter annotation (Room), Creating a type converter
@TypeConverters annotation (Room), Creating a type converter
TypeEvaluator class, Color evaluation

U

UI fragments (see fragments)
UI thread (see main thread)
@UiThread annotation, Preparing to Download Bytes from a URL
UninitializedPropertyAccessException class, Exceptions and Stack Traces, Deserializing JSON text into model objects
unit testing

about, Unit Testing and Audio Playback

@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

testing object interactions, Testing object interactions

@Update annotation, Updating the Database
Uri class, Firing the intent
user interfaces

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

UI fragments and, Introducing Fragments

<uses-feature> tag, Declaring Features
UUID.randomUUID() function, Creating a Data Class

V

variables view (Android Studio), Setting breakpoints
versions (Android SDK) (see SDK versions)
versions (firmware), Android SDK Versions
View class

(see also views, widgets)

bottom, Simple Property Animation

draw(), Rendering Inside onDraw(Canvas)

height, Simple Property Animation

invalidate(), Tracking across motion events

jumpDrawablesToCurrentState(), Using LiveData Transformations

left, Simple Property Animation

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

top, Simple Property Animation

view models (in MVVM), Binding to Data
ViewDataBinding.executePendingBindings(), Binding to a view model
ViewGroup class, Laying Out the UI, The view hierarchy, Creating a landscape layout
ViewHolder class, as OnClickListener, Responding to Presses
ViewModel class

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

vs saved instance state, ViewModel vs Saved Instance State

ViewModelProvider class, Adding a ViewModel
ViewModelProviders class, Adding a ViewModel
views

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

widgets, Laying Out the UI

ViewTreeObserver class, Challenge: Efficient Thumbnail Load
virtual devices (see emulator)

W

web content

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

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, Using WebChromeClient to spruce things up

for enhancing appearance of WebView, Using WebChromeClient to spruce things up

onProgressChanged(…), Using WebChromeClient to spruce things up

onReceivedTitle(…), Using WebChromeClient to spruce things up

WebSettings class, The Harder Way: WebView
WebView class

for presenting web content, The Harder Way: WebView

handling rotation, Proper Rotation with WebView

vs custom UI, WebView vs a Custom UI

WebViewClient class

about, The Harder Way: WebView

shouldOverrideUrlLoading(…), The Harder Way: WebView

widgets

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

margins, For the More Curious: Margins vs Padding

modifying attributes, Modifying Button Attributes

padding, For the More Curious: Margins vs Padding

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

wiring up in fragments, Wiring up widgets in a fragment

work requests

about, Scheduling Work

constraints for, Scheduling Work

Worker class

about, Creating a Worker

doWork(), Creating a Worker

enabling and disabling, Providing User Control over Polling

performing synchronous tasks, Checking for New Photos

scheduling with WorkRequest, Scheduling Work

@WorkerThread annotation, Preparing to Download Bytes from a URL
WorkManager architecture component library

(see also individual class names)

about, WorkManager

Constraints, Scheduling Work

Worker, Creating a Worker

WorkRequest, Creating a Worker

WorkRequest class

about, Creating a Worker

Constraints and, Scheduling Work

scheduling a Worker, Scheduling Work

subclasses, Scheduling Work

wrap_content, android:layout_width and android:layout_height

X

-xhdpi, -xxhdpi, -xxxhdpi suffixes, Adding an Icon
XML

Android namespace, The view hierarchy

referencing resources in, Referencing resources in XML

XML drawables (see drawables)
..................Content has been hidden....................

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