Index
A
- action bar, Test drive the app
- ActionBarActivity class, MainActivity needs to be an AppCompatActivity
- ActionBar class, ActionBar vs. Toolbar, Test drive the app
- ActionBarDrawerToggle class, Add a drawer toggle
- actions
- activities
- about, Welcome to Androidville, Activities and layouts from 50,000 feet, Refine the app, Let’s build a Beer Adviser app, How do activities really work?
- backward compatibility for, Create the Pizza app, MainActivity needs to be an AppCompatActivity
- calling custom Java classes from, Enhance the activity to call the custom Java class so that we can get REAL advice
- calling methods from, We need to make the button do something
- class hierarchy for, Your activity inherits the lifecycle methods, AppCompatActivity lets you use AppCompat themes
- class name for, Every activity needs to be declared
- converting to fragments, TempActivity needs to extend AppCompatActivity
- creating, 4. Add an activity, What activity code looks like, The first version of the activity
- declaring in manifest file, Every activity needs to be declared
- default, We’ve created a default activity and layout
- editing (see code editor; design editor)
- in other apps
- location in project, Useful files in your project
- main, specifying, Welcome to the Android manifest file, How do activities really work?
- multiple
- navigating (see navigation)
- organizing, Organize your ideas: top-level, category, and detail/edit activities, Great apps have a clear structure
- category activities, Organize your ideas: top-level, category, and detail/edit activities, We’re going to build part of the Starbuzz app, A category activity displays the data for a single category, Pass the ID of the item that was clicked by adding it to an intent
- detail/edit activities, Organize your ideas: top-level, category, and detail/edit activities, The drink detail activity, A detail activity displays data for a single record
- top-level activities, Organize your ideas: top-level, category, and detail/edit activities, We’re going to build part of the Starbuzz app
- parent activity, Set an activity’s parent
- states of (see activity lifecycle)
- Activity class, What activity code looks like, Your activity inherits the lifecycle methods, AppCompatActivity lets you use AppCompat themes
- activity lifecycle
- ActivityNotFoundException, What happens when the code runs, If you have NO matching activities
- activity transitions, 8. Animation
- adapters
- AdapterView class, Get list views to respond to clicks with a listener, For nonstatic data, use an adapter
- adb (Android Debug Bridge)
- ADD COLUMN command, Delete tables by dropping them
- addDrawerListener() method, DrawerLayout, Add a drawer toggle
- ALTER TABLE command, Change the database structure
- Android application package (see APK files)
- Android apps, 2. Configure the project
- (see also projects)
- about, How do activities really work?
- activities in (see activities)
- adapting for different device sizes, Your app needs to look great on ALL devices, The Workout app looks the same on a phone and a tablet, Put screen-specific resources in screen-specific folders
- app bar for (see app bar)
- back button functionality for, You want fragments to work with the Back button
- building, Install Android Studio, 4. Add an activity, Here’s what we’re going to do
- configuration of, affected by rotation, Test drive the app, Test drive the app, The activity lifecycle: the foreground lifetime
- designing, Every app starts with ideas
- devices supported by, 3. Specify the minimum SDK, Your app needs to look great on ALL devices
- distributing, 1. Distributing your app
- examples of (see examples)
- focus/visibility of, There’s more to an activity’s life than create and destroy, What if an app is only partially visible?
- icons for, Welcome to the Android manifest file, AndroidManifest.xml can change your app bar’s appearance
- Java for (see Java)
- languages used in, Here’s what we’re going to do
- layouts for (see layouts)
- manifest file for (see AndroidManifest.xml file)
- minimum SDK for, 3. Specify the minimum SDK
- navigating (see navigation)
- package name for, 2. Configure the project, Welcome to the Android manifest file
- processes used by, How do activities really work?, The story continues
- resource files for (see resource files)
- running activities in other apps, But we don’t know what apps are on the user’s device
- running in emulator, Run the app in the Android emulator, Let’s take the app for a test drive, If you have NO matching activities
- running on physical devices, You need to run your app on a REAL device, If you have NO matching activities
- settings screen for, 7. Settings
- structuring, Organize your ideas: top-level, category, and detail/edit activities, We’re going to build part of the Starbuzz app, Great apps have a clear structure
- theme for (see themes)
- Android debug bridge (see ADB)
- Android devices
- Android emulator
- AndroidManifest.xml file
- about, Useful files in your project, Welcome to the Android manifest file
- activity hierarchy in, Set an activity’s parent
- app bar attributes in, AndroidManifest.xml can change your app bar’s appearance, Change the app bar text by adding a label
- intent filters in, The intent filter tells Android which activities can handle which actions
- language settings in, Orientation is vertical or horizontal
- main activity in, How do activities really work?, What happens when you run the app
- permissions needed in, Declare the permissions you need
- screen size settings in, The different folder options
- started services in, You declare services in AndroidManifest.xml
- themes in, Create a toolbar layout
- Android platform
- Android Runtime (ART), The Android platform dissected, What just happened?, What is the Android runtime?
- Android SDK (API level)
- about, Your development environment
- features specific to, LinearLayout displays views in a single row or column, Padding adds space, Add an app bar by applying a theme, AppCompatActivity lets you use AppCompat themes, MainActivity needs to be an AppCompatActivity, Test drive the app, Set an activity’s parent
- libraries for, Android Studio creates a complete folder structure for you, Support libraries allow you to use new features in older versions of Android
- list of, 3. Specify the minimum SDK
- permissions affected by, Declare the permissions you need, Request location updates...
- specifying for AVD, Select a system image, Select a system image
- specifying minimum for apps, 3. Specify the minimum SDK
- Android Studio
- Android virtual device (see AVD)
- animated toolbar (see collapsing toolbar; scrolling toolbar)
- animation, 8. Animation
- API level (see Android SDK (API level))
- APK files, Run the app in the emulator, What just happened?, DEX files are zipped into APK files
- app bar
- about, Different types of navigation
- activity titles in, Update OrderActivity.java
- adding actions to, Add actions to the app bar, The code for AndroidManifest.xml
- attributes in manifest file for, AndroidManifest.xml can change your app bar’s appearance, Change the app bar text by adding a label
- icon in, AndroidManifest.xml can change your app bar’s appearance
- label for, AndroidManifest.xml can change your app bar’s appearance, Change the app bar text by adding a label
- removing, 3. Remove the app bar
- replacing with toolbar, Here’s what we’re going to do, ActionBar vs. Toolbar
- sharing content on, Sharing content on the app bar
- tabs in, How to add tabs to your layout
- themes required for, Add an app bar by applying a theme, Add the v7 AppCompat Support Library, AndroidManifest.xml can change your app bar’s appearance
- Up button for, Enable Up navigation
- AppBarLayout element, How to add tabs to your layout, How to create a plain collapsing toolbar
- AppCompatActivity class, AppCompatActivity lets you use AppCompat themes, 1. Add the AppCompat Support Library
- AppCompat Library (see v7 AppCompat Library)
- app folder, Useful files in your project
- application framework, The Android platform dissected
- application name, 2. Configure the project
- applications, core (see core applications)
- app_name string resource, Create the String resource
- apps (see Android apps)
- AppTheme attribute, Create a toolbar layout
- app widgets, 9. App widgets
- ArrayAdapter class, For nonstatic data, use an adapter, App review: where we are, Test drive the app, Adapters revisited
- @array reference, Add the string-array to strings.xml
- array resources, Add values to the spinner, Spinner, Use a list view to display the list of options
- ART (Android Runtime), The Android platform dissected, What just happened?, What is the Android runtime?
- AsyncTask class, AsyncTask performs asynchronous tasks, The AsyncTask class parameters, Execute the AsyncTask..., Chapter 17 Your Android Toolbox
- ?attr reference, 4. Add a toolbar to the layout
- automated testing, 10. Automated testing
- AVD (Android virtual device)
- AWT, Here’s what we’re going to do
B
- Back button
- background, services running in (see services)
- background thread, Databases can make your app go in sloooow-moooo...., Test drive the app
- back stack, Welcome to the back stack
- backward compatibility, for activities, Create the Pizza app, MainActivity needs to be an AppCompatActivity
- Bates, Bert (Head First Java), Here’s what we’re going to do
- Beer Adviser app, Let’s build a Beer Adviser app
- Beighley, Lynn (Head First SQL), What we’ve done so far
- biases for views, Adjust a view’s position by updating its bias
- Binder class, Test drive the app
- bindService() method, activity, Use bindService() to bind the service
- blueprint tool
- about, Use the blueprint tool
- aligning views, How to align views
- biases, setting, Adjust a view’s position by updating its bias
- centering views, How to center views
- horizontal constraints, Position views using constraints
- inferring contraints, First, add the top line of views, Chapter 6 Your Android Toolbox
- margins, setting, Add a vertical constraint
- size of views, changing, How to change a view’s size
- vertical constraints, Add a vertical constraint
- view properties, editing, The Infer Constraints feature guesses which constraints to add
- widgets, adding, Use the blueprint tool, First, add the top line of views, Add the next line to the blueprint...
- books and publications
- bound services
- about, Services work in the background, Bound services are bound to other components
- binding to an activity, Implement a binder, What MainActivity needs to do
- calling methods from, Call OdometerService’s getDistance() method
- compared to started services, Test drive the app
- creating, Create a new service, Add a getDistance() method to the service
- displaying results of, Update MainActivity’s layout
- in combination with started services, Test drive the app
- lifecycle of, The states of a bound service
- other apps using, Test drive the app
- broadcasts, 5. Broadcasts
- build folder, Useful files in your project
- build.gradle files, What has Gradle have the Romans ever done for us?
- built-in services
- Bundle class
- Button element, Here’s what we’ll do
C
- CalledFromWrongThreadException, The runTimer() method
- cardCornerRadius attribute, card view, How to create a card view
- cardElevation attribute, card view, How to create a card view
- CardView element, How to create a card view
- CardView Library, Support libraries allow you to use new features in older versions of Android, Display the pizza data in a card
- card views
- CatChat app, We’re going to create a navigation drawer for a new email app
- category activities, Organize your ideas: top-level, category, and detail/edit activities, We’re going to build part of the Starbuzz app, A category activity displays the data for a single category, Pass the ID of the item that was clicked by adding it to an intent, Great apps have a clear structure
- centering views, How to center views
- chaining activities, Apps can contain more than one activity
- changeCursor() method, cursor adapter, Change the cursor with changeCursor()
- checkableBehavior attribute, How to group items together
- CheckBox element, Checkboxes, Add a checkbox to DrinkActivity’s layout
- checkSelfPermission() method, ContextCompat, Request location updates..., The OdometerService.java code (continued)
- check task, Gradle, The check task
- choosers, What if you ALWAYS want your users to choose an activity?
- classes (see Java classes)
- clean task, Gradle, The check task
- closeDrawer() method, DrawerLayout, Close the drawer when the user presses the Back button
- close() method, cursor, Get cursor values, The story continues
- close() method, SQLiteDatabase, Get cursor values, The story continues
- code editor
- collapsing toolbar, Here’s what we’ll do, Add a collapsing toolbar to OrderActivity
- CollapsingToolbarLayout element, How to create a plain collapsing toolbar
- color resources, Define colors in a color resource file
- colors, for themes, Customize the look of your app
- columnCount attribute, GridLayout, A grid layout displays views in a grid
- company domain, 2. Configure the project
- constraint layout
- about, Introducing the constraint layout
- aligning views, How to align views
- alternatives to, Chapter 6 Your Android Toolbox
- biases, setting, Adjust a view’s position by updating its bias
- centering views, How to center views
- horizontal constraints, adding, Position views using constraints
- inferring contraints, First, add the top line of views, Chapter 6 Your Android Toolbox
- library for, Make sure your project includes the Constraint Layout Library
- margins, setting, Add a vertical constraint
- size of views, changing, How to change a view’s size
- specifying in main activity, Add the String resources to strings.xml
- vertical constraints, adding, Add a vertical constraint
- widgets, adding, Use the blueprint tool, First, add the top line of views, Add the next line to the blueprint...
- XML code for, Changes to the blueprint are reflected in the XML
- Constraint Layout Library, Make sure your project includes the Constraint Layout Library, Support libraries allow you to use new features in older versions of Android
- contentDescription attribute, ImageView, Image view: the layout XML
- content providers, 2. Content providers
- contentScrim attribute, CollapsingToolbarLayout, How to add an image to a collapsing toolbar
- ContentValues object, Insert data using the insert() method, Upgrade an existing database
- Context class, Your activity inherits the lifecycle methods, Your service inherits the lifecycle methods
- ContextThemeWrapper class, Your activity inherits the lifecycle methods
- ContextWrapper class, Your activity inherits the lifecycle methods, Your service inherits the lifecycle methods
- CoordinatorLayout element, Make the toolbar respond to scrolls, How to create a plain collapsing toolbar, Add the icon for the FAB
- core applications, The Android platform dissected
- core libraries, The Android platform dissected
- createChooser() method, Intent, What if you ALWAYS want your users to choose an activity?
- CREATE TABLE command, You create tables using Structured Query Language (SQL)
- Cursor class, Android comes with SQLite classes
- cursors, SQLite
- about, Android comes with SQLite classes, Get data from the database with a cursor
- adapter for, How do we replace the array data in the list view?, The revised code for DrinkCategoryActivity, Change the cursor with changeCursor()
- closing, Get cursor values, Close the cursor and database
- creating, Get data from the database with a cursor, Get a reference to the Starbuzz database...
- navigating to records in, To read a record from a cursor, you first need to navigate to it
- refreshing, Cursors don’t automatically refresh
- retrieving values from, Get cursor values
- custom Java classes (see Java classes)
D
- data
- database (see SQLite database)
- delete() method, SQLiteDatabase, Apply conditions to multiple columns
- density-independent pixels (dp), LinearLayout displays views in a single row or column
- design editor, Use the blueprint tool
- Design Support Library
- about, Support libraries allow you to use new features in older versions of Android, The Design Support Library helps you implement material design
- AppBarLayout element, How to add tabs to your layout
- collapsing toolbar, Add a collapsing toolbar to OrderActivity
- FAB (floating action button), Here’s what we’ll do, FABs and snackbars
- navigation drawers, Create the CatChat project
- scrolling toolbar, Make the toolbar respond to scrolls
- snackbar, Here’s what we’ll do, FABs and snackbars, How to create a snackbar
- TabLayout element, How to add tabs to your layout, Link the tab layout to the view pager
- detail/edit activities, Organize your ideas: top-level, category, and detail/edit activities, The drink detail activity, A detail activity displays data for a single record, Great apps have a clear structure
- development environment (see Android SDK; Android Studio)
- devices (see Android devices)
- DEX files, ART compiles code into DEX files, Android converts the .dex code to OAT format
- dimension resources, Add a dimension resource file for consistent padding across layouts
- dimens.xml file, Add a dimension resource file for consistent padding across layouts
- distributing apps, 1. Distributing your app
- doInBackground() method, AsyncTask, AsyncTask performs asynchronous tasks, The doInBackground() method, Execute the AsyncTask...
- dp (density-independent pixels), LinearLayout displays views in a single row or column
- drawable attributes, Button, Adding images to buttons
- @drawable reference, Image view: the layout XML
- drawable resource folders (see image resources)
- DrawerLayout element, How to create a navigation drawer
- (see also navigation drawers)
- drop-down list (see Spinner element)
- DROP TABLE command, Delete tables by dropping them
- dynamic fragments (see fragments: dynamic)
E
- editors (see blueprint tool; code editor; design editor)
- EditText element
- email app example (see CatChat app)
- email grid layout example, Let’s create a new grid layout
- emulator (see Android emulator)
- entries attribute, ListView, Use a list view to display the list of options
- entries attribute, Spinner, Add the string-array to strings.xml, Spinner
- Espresso tests, 10. Automated testing
- event listeners
- about, What being a view buys you
- compared to onClick attribute, Where we’ve got to
- for card views, Keep your adapters reusable
- for fragments, 3. Make the fragment implement OnClickListener
- for list fragments, We need to decouple the fragment by using an interface
- for ListView element, Get list views to respond to clicks with a listener, What changes are needed for TopLevelActivity.java, The new TopLevelActivity.java code
- for navigation drawers, Respond to the user clicking items in the drawer
- for snackbar actions, How to create a snackbar
- location listeners, Add a location listener to OdometerService
- examples
- Beer Adviser app (see Beer Adviser app)
- CatChat app (see CatChat app)
- email grid layout, Let’s create a new grid layout
- Joke app (see Joke app)
- My Constraint Layout app (see My Constraint Layout app)
- My First App (see My First App)
- My Messenger app (see My Messenger app)
- Odometer app (see Odometer app)
- Pizza app (see Pizza app)
- source code for, Read me
- Starbuzz Coffee app (see Starbuzz Coffee app)
- Stopwatch app (see Stopwatch app)
- Workout app (see Workout app)
- execSQL() method, SQLiteDatabase, You create tables using Structured Query Language (SQL), Delete tables by dropping them
- execute() method, AsyncTask, Execute the AsyncTask...
F
- FAB (floating action button), Here’s what we’ll do, FABs and snackbars
- findViewById() method, view, onClickFindBeer() needs to do something, What the code does
- FloatingActionButton element, Add the icon for the FAB
- focus
- FragmentActivity class, Support Library fragments need activities that extend FragmentActivity
- fragment element, Add a fragment to an activity’s layout, Use <fragment> for static fragments...
- fragment lifecycle, The fragment lifecycle, Fragments and activities have similar lifecycles...
- fragment manager, Use the fragment manager to manage fragments, Using fragment transactions
- FragmentPagerAdapter class, Tell a view pager about its pages using a fragment pager adapter
- fragments
- about, Fragments allow you to reuse code
- activities using
- adding to project, How to add a fragment to your project
- app structure for, The phone version of the app
- back button functionality with, You want fragments to work with the Back button
- code for, What fragment code looks like
- converting activities to, TempActivity needs to extend AppCompatActivity
- data for, The Workout class
- dynamic
- for tab navigation, The app structure
- ID for, Pass the workout ID to the fragment
- layouts for, What fragment code looks like, Tablets use layouts in the layout-large folder
- list fragments
- methods associated with, The fragment lifecycle, Fragments and activities have similar lifecycles...
- nested, Using getChildFragmentManager() creates nested transactions instead
- replacing programmatically, Use a frame layout to replace fragments programmatically
- state of, saving, Rotating the tablet breaks the app, Change activity_temp.xml to use a FrameLayout
- swiping through, Use a view pager to swipe through fragments
- v7 AppCompat Library for, Create the project and activities, Support Library fragments need activities that extend FragmentActivity
- view for, creating, The fragment’s onCreateView() method
- FragmentStatePagerAdapter class, Tell a view pager about its pages using a fragment pager adapter, Attach the fragment pager adapter to the view pager
- fragment transactions, Using fragment transactions, Use <fragment> for static fragments..., So far, we’ve only used fragment transactions in activities
- FrameLayout element
- about, Frame layouts stack their views, FrameLayout: a summary
- gravity for view placement, A frame layout stacks views in the order they appear in the layout XML
- height, Frame layouts stack their views
- nesting, You can nest layouts
- order of views in, A frame layout stacks views in the order they appear in the layout XML
- replacing fragments programmatically using, Use a frame layout to replace fragments programmatically, Change activity_temp.xml to use a FrameLayout, Add a FrameLayout where the fragment should appear
- width, Frame layouts stack their views
G
- getActivity() method, PendingIntent, Add an action to tell the notification which activity to start when clicked
- getBestProvider() method, LocationManager, We need a location manager and location provider
- getCheckedRadioButtonId() method, RadioGroup, Radio buttons
- getChildFragmentManager() method, fragment, Using getChildFragmentManager() creates nested transactions instead
- getContext() method, LayoutInflator, Our previous array adapter
- getCount() method, FragmentPagerAdapter, Tell a view pager about its pages using a fragment pager adapter
- getFragmentManager() method
- getIntent() method, activity, putExtra() puts extra info in an intent, Get ReceiveMessageActivity to use the information in the intent, Retrieve data from the intent
- getIntExtra() method, Intent, putExtra() puts extra info in an intent
- getItemCount() method, RecyclerView.Adapter, Tell the adapter what data it should work with...
- getItem() method, FragmentPagerAdapter, Tell a view pager about its pages using a fragment pager adapter
- get*() methods, cursor, Get cursor values
- getReadableDatabase() method, SQLiteOpenHelper, Get a reference to the database, Get a reference to the Starbuzz database...
- getSelectedItem() method, view, The first version of the activity, Test drive the changes, Spinner
- getStringExtra() method, Intent, putExtra() puts extra info in an intent, Get ReceiveMessageActivity to use the information in the intent
- getString() method, string resource, Change the code to create a chooser
- getSupportActionBar() method, activity, Adding the Up button
- getSupportFragmentManager() method, activity, Use the fragment manager to manage fragments
- getText() method, EditText, Editable text view
- getView() method, fragment, Set the view’s values in the fragment’s onStart() method, Test drive the app
- getWritableDatabase() method, SQLiteOpenHelper, Get a reference to the database
- GPS location provider, We need a location manager and location provider
- Gradle build tool
- gradlew and gradlew.bat files, Gradle comes built in to your project
- gravity attribute, view, Gravity controls the position of a view’s contents
- GridLayout element
- GridLayoutManager class, A recycler view uses a layout manager to arrange its views
- group element, How to group items together
- GUI components, activity_find_beer.xml has a new button
H
- Handler class, Handlers allow you to schedule code
- HAXM (Hardware Accelerated Execution Manager), 1. Use a real device
- headerLayout attribute, How to create a navigation drawer
- Head First Java (Sierra; Bates), Here’s what we’re going to do
- Head First SQL (Beighley), What we’ve done so far
- heads-up notification, Android has a built-in notification service, First create a notification builder
- hint attribute, EditText, Here’s the starting point for the linear layout, Editable text view
- horizontal constraints, Position views using constraints
- HorizontalScrollView element, Scroll view
I
- IBinder interface, Test drive the app
- IBinder object, Create a new service, The onServiceConnected() method
- icon attribute, AndroidManifest.xml can change your app bar’s appearance, Control the action’s appearance
- icons
- id attribute, view, activity_find_beer.xml has a new button, A linear layout displays views in the order they appear in the layout XML
- IDE
- ImageButton element, Image button
- image resources, 1. Add the action’s resources
- (see also icons; mipmap resource folders)
- adding, Add an image to your project, Image view, The image files, Add scrollable content to TopFragment
- for Button elements, Adding images to buttons
- for ImageButton elements, Image button
- for ImageView element, Image view: the layout XML, The top-level layout contains an image and a list
- for navigation drawer header, Create the navigation drawer’s header
- R.drawable references for, Image view: the layout XML, The image files
- resolution options, folders for, Image view
- ImageView element, Image view, The top-level layout contains an image and a list, How to add an image to a collapsing toolbar
- include tag, Include the toolbar in the activity’s layout, Test drive the app
- inflate() method, LayoutInflator, The fragment’s onCreateView() method
- inflators, layout, The fragment’s onCreateView() method, The fragment lifecycle
- inputType attribute, EditText, Editable text view
- insert() method, SQLiteDatabase, Insert data using the insert() method
- installDebug task, Gradle, The check task
- Instant Run, 4. Use Instant Run
- IntelliJ IDEA, Your development environment
- intent filter, The intent filter tells Android which activities can handle which actions
- intents
- about, An intent is a type of message
- alternatives to, Update the text view properties
- category for, How Android uses the intent filter, If you have NO matching activities
- creating, An intent is a type of message , Pass the ID of the item that was clicked by adding it to an intent
- implicit and explicit, Create an intent that specifies an action, The intent filter tells Android which activities can handle which actions, If you have NO matching activities
- passing text using, Pass text to a second activity
- resolving activities and actions, The intent filter tells Android which activities can handle which actions
- retrieving data from, Retrieve data from the intent
- retrieving text from, Get ReceiveMessageActivity to use the information in the intent
- sharing content using, Sharing content on the app bar
- starting activities, An intent is a type of message
- starting activities in other apps, How Android apps work
- IntentService class, Use the IntentService class to create a basic started service, The full DelayedMessageService code, Your service inherits the lifecycle methods
- internationalization (see localization)
- isChecked() method, CheckBox, Checkboxes
L
- label attribute, application, AndroidManifest.xml can change your app bar’s appearance, Test drive the app, Change the app bar text by adding a label
- layout_above attribute, RelativeLayout, Attributes for positioning views relative to other views
- layout_align* attributes, RelativeLayout, Attributes for positioning views relative to the parent layout, Attributes for positioning views relative to other views
- layout_behavior attribute, ViewPager, How to coordinate scroll behavior, Nested scroll view attributes
- layout_below attribute, RelativeLayout, Attributes for positioning views relative to other views
- layout_center* attributes, RelativeLayout, Attributes for positioning views relative to the parent layout
- layout_collapseMode attribute, Toolbar, Nested scroll view attributes, How to add an image to a collapsing toolbar
- layout_column attribute, GridLayout, Row 0: add views to specific rows and columns
- layout_columnSpan attribute, GridLayout, Row 1: make a view span multiple columns
- layout_gravity attribute, view, Changes to the XML..., layout_gravity controls the position of a view within a layout, A frame layout stacks views in the order they appear in the layout XML
- layout_height attribute
- LayoutInflator class, The fragment’s onCreateView() method, The fragment lifecycle, Our previous array adapter
- layout manager, for recycler view, A recycler view uses a layout manager to arrange its views
- layout_margin attributes, view, Changes to the XML..., Use margins to add distance between views, Add a vertical constraint
- layout resource folders, Put screen-specific resources in screen-specific folders
- layout_row attribute, GridLayout, Row 0: add views to specific rows and columns
- layouts
- about, Welcome to Androidville, Activities and layouts from 50,000 feet, Refine the app, Let’s build a Beer Adviser app, Your user interface is made up of layouts and GUI components
- code for, The design editor, activity_main.xml has two elements, We’ve created a default activity and layout, activity_find_beer.xml has a new button, Update the layout
- constraint (see constraint layout)
- creating, 4. Add an activity
- default, We’ve created a default activity and layout
- editing, We’ve created a default activity and layout
- for fragments (see fragments)
- frame (see FrameLayout element)
- grid (see GridLayout element)
- inherited from ViewGroup class, GUI components are a type of View, A layout is really a hierarchy of Views
- linear (see LinearLayout element)
- nesting, You can nest layouts, Nested layouts can be inefficient
- relative (see RelativeLayout element)
- toolbars as, ... or define the toolbar as a separate layout, Create OrderActivity
- layout_scrollFlags attribute, Toolbar, How to coordinate scroll behavior, Nested scroll view attributes
- layout_to* attributes, RelativeLayout, Attributes for positioning views relative to other views
- layout_weight attribute, view, Make a view streeeeetch by adding weight
- layout_width attribute
- libraries, The Android platform dissected
- LinearLayout element
- about, We’ve created a default activity and layout, A closer look at the layout code, LinearLayout displays views in a single row or column, LinearLayout: a summary
- dimension resources, Add a dimension resource file for consistent padding across layouts
- gravity for view contents, Gravity controls the position of a view’s contents
- gravity for view placement, layout_gravity controls the position of a view within a layout
- height, LinearLayout displays views in a single row or column
- nesting, You can nest layouts, Nested layouts can be inefficient
- order of views in, A linear layout displays views in the order they appear in the layout XML
- orientation, Orientation is vertical or horizontal
- padding, Padding adds space
- weight of views in, Make a view streeeeetch by adding weight
- width, LinearLayout displays views in a single row or column
- xmlns:android attribute, LinearLayout displays views in a single row or column
- LinearLayoutManager class, A recycler view uses a layout manager to arrange its views
- Linux kernel, The Android platform dissected
- Listener interface, We need to decouple the fragment by using an interface, Keep your adapters reusable
- listeners (see event listeners)
- ListFragment class
- ListView element
- loaders, 3. Loaders
- localization
- LocationListener class, Add a location listener to OdometerService
- LocationManager class, We need a location manager and location provider
- Location Services
- logcat, viewing, How to log messages, Kill the adb server
- Log class, How to log messages
- logging messages, How to log messages
M
- main activity, Welcome to the Android manifest file, How do activities really work?
- manifest file (see AndroidManifest.xml file)
- material design, The Design Support Library helps you implement material design
- (see also Design Support Library)
- menu attribute, NavigationView, How to create a navigation drawer
- menu element, 2. Create the menu resource file
- menu resource folders, 2. Create the menu resource file
- messages, Android has a built-in notification service
- methods, We need to make the button do something
- mipmap resource folders, AndroidManifest.xml can change your app bar’s appearance
- moveToFirst() method, cursor, Navigate cursors
- moveToLast() method, cursor, Navigate cursors
- moveToNext() method, cursor, Navigate cursors
- moveToPrevious() method, cursor, Navigate cursors
- My Constraint Layout app, Introducing the constraint layout
- My First App, Install Android Studio
- My Messenger app, Here’s the app structure
- activities, Create the second activity and layout, Pass text to a second activity
- choosers, What if you ALWAYS want your users to choose an activity?
- intents, An intent is a type of message , putExtra() puts extra info in an intent
- layout, Update the layout, Create the second activity and layout, Update the text view properties
- manifest file, Welcome to the Android manifest file
- running on device, You need to run your app on a REAL device
- String resources, Update strings.xml...
N
- navigation, Different types of navigation
- navigation drawers
- about, Tab layouts allow easy navigation...
- adding to main activity, Here’s what we’re going to do, How to create a navigation drawer
- closing the drawer, What the activity code needs to do, Close the drawer when the user presses the Back button
- compared to tab navigation, Tab layouts allow easy navigation...
- drawer toggle for, What the activity code needs to do
- fragments for, Here’s what we’re going to do, Create InboxFragment
- header for, Here’s what we’re going to do, We need to build a navigation drawer
- libraries for, Create the CatChat project
- menu click behavior, What the activity code needs to do, Respond to the user clicking items in the drawer
- menu options for, Here’s what we’re going to do, We need to build a navigation drawer, The drawer gets its options from a menu
- multiple, Close the drawer when the user presses the Back button
- submenu in, Add the support section as a submenu
- theme for, Create a toolbar layout
- toolbar for, Create a toolbar layout
- NavigationView element, How to create a navigation drawer, Respond to the user clicking items in the drawer
- NestedScrollView element, Use a nested scroll view to make layout content scrollable, How to create a plain collapsing toolbar
- network location provider, We need a location manager and location provider
- NotificationManager class, Issue the notification using the built-in notification service
- Notification object, Issue the notification using the built-in notification service
- notification service
- about, Android has a built-in notification service, What happens when you run the code
- action for, adding, Add an action to tell the notification which activity to start when clicked
- heads-up notification, Android has a built-in notification service, First create a notification builder
- issuing a notification, Issue the notification using the built-in notification service, Issue a notification if we’re denied permission, Add notification code to onRequestPermissionsResults()
- library for, We’ll use notifications from the AppCompat Support Library
- notification builder for, First create a notification builder
- notification manager for, Issue the notification using the built-in notification service
- notify() method, NotificationManager, Issue the notification using the built-in notification service
O
- OAT format, Android converts the .dex code to OAT format
- Odometer app, Here’s what we’re going to do
- onActivityCreated() method, fragment, The fragment lifecycle
- onAttach() method, fragment, The fragment lifecycle
- onBind() method, Service, Create a new service, The states of a bound service
- onBindViewHolder() method, RecyclerView.Adapter, Add the data to the card views, You can listen for view events from the adapter
- onButtonClicked() method, activity, Button, Image button
- onCheckboxClicked() method, CheckBox, Checkboxes (continued)
- onClick attribute
- Button, Make the button call a method, How the activity code will work, Button, Where we’ve got to
- CheckBox, Checkboxes (continued), Respond to clicks to update the database
- ImageButton, Image button
- RadioButton, Radio buttons (continued)
- Switch, Switch
- ToggleButton, Toggle button
- onClickDone() method, activity, Add the onClickDone() method to OrderActivity
- OnClickListener interface, 3. Make the fragment implement OnClickListener
- onClickListener() method, view, How to create a snackbar
- onClick() method
- onCreate() method
- activity, What activity code looks like, Update strings.xml..., Get ReceiveMessageActivity to use the information in the intent, How do activities really work?, The story continues, The states of an activity, The activity lifecycle: from create to destroy, The activity lifecycle: the visible lifetime, Your handy guide to the lifecycle methods, The states of a bound service
- fragment, The fragment lifecycle, Save the fragment’s state..., The updated code for WorkoutDetailFragment.java
- service, The started service lifecycle: from create to destroy
- SQLiteOpenHelper, Create the SQLite helper, The StarbuzzDatabaseHelper code
- onCreateOptionsMenu() method, activity, 3. Add the menu to the app bar with the onCreateOptionsMenu() method
- onCreateViewHolder() method, ViewHolder, Override the onCreateViewHolder() method
- onCreateView() method, fragment, What fragment code looks like, The fragment lifecycle, How to create a list fragment, Our previous array adapter
- onDestroy() method
- onDestroyView() method, fragment, The fragment lifecycle
- onDetach() method, fragment, The fragment lifecycle
- on-device tests, 10. Automated testing
- onDowngrade() method, SQLiteOpenHelper, SQLite databases have a version number, Downgrade your database with onDowngrade()
- onHandleEvent() method, IntentService, Use the IntentService class to create a basic started service
- onHandleIntent() method, IntentService, The full DelayedMessageService code
- OnItemClickListener class, Get list views to respond to clicks with a listener
- onItemClick() method, OnItemClickListener, Get list views to respond to clicks with a listener
- onListItemClick() method, list fragment, A list fragment is a fragment that contains only a list, 2. Register the listener
- onLocationChanged() method, LocationListener, Add a location listener to OdometerService
- onNavigationItemSelected() method, activity, Respond to the user clicking items in the drawer
- onOptionsItemSelected() method, activity, 4. React to action item clicks with the onOptionsItemSelected() method
- onPause() method
- onPostExecute() method, AsyncTask, AsyncTask performs asynchronous tasks, The onPostExecute() method
- onPreExecute() method, AsyncTask, AsyncTask performs asynchronous tasks
- onProgressUpdate() method, AsyncTask, The onProgressUpdate() method
- onProviderDisabled() method, LocationListener, Add a location listener to OdometerService
- onProviderEnabled() method, LocationListener, Add a location listener to OdometerService
- onRadioButtonClicked() method, RadioGroup, Radio buttons (continued)
- onRequestPermissionResult() method, activity, Check the user’s response to the permission request
- onRestart() method, activity, There’s more to an activity’s life than create and destroy, The activity lifecycle: the visible lifetime, Test drive the app, Your handy guide to the lifecycle methods
- onResume() method
- onSaveInstanceState() method
- onServiceConnected() method, ServiceConnection, Create a ServiceConnection
- onServiceDisconnected() method, ServiceConnection, Create a ServiceConnection, The onServiceDisconnected() method
- onStartCommand() method, Service, The started service lifecycle: from create to destroy
- onStart() method
- onStatusChanged() method, LocationListener, Add a location listener to OdometerService
- onStop() method
- onSwitchClicked() method, Switch, Switch
- onToggleClicked() method, ToggleButton, Toggle button
- onUnbind() method, Service, The states of a bound service
- onUpgrade() method, SQLiteOpenHelper, Create the SQLite helper, SQLite databases have a version number, Upgrade your database with onUpgrade(), Let’s upgrade the database
- Oracle JVM (Java Virtual Machine), What is the Android runtime?
- orderInCategory attribute, Control the action’s appearance
- organizing ideas, Every app starts with ideas
- (see also Starbuzz Coffee app)
- orientation attribute, LinearLayout, A closer look at the layout code, Orientation is vertical or horizontal
P
- package name, Welcome to the Android manifest file
- padding attributes, LinearLayout, Padding adds space
- parent activity, Set an activity’s parent
- PendingIntent class, Add an action to tell the notification which activity to start when clicked
- performance
- permissions
- API levels affecting, Declare the permissions you need, Request location updates...
- checking for permissions granted, Request location updates..., The OdometerService.java code (continued)
- declaring permissions needed, Declare the permissions you need
- denied, issuing notification of, Issue a notification if we’re denied permission, Add notification code to onRequestPermissionsResults()
- requesting from user, Get the app to request permission, Issue a notification if we’re denied permission
- Pizza app, Great apps have a clear structure, The Bits and Pizzas app revisited, There’s still work to do on the Bits and Pizzas app
- actions, Add actions to the app bar
- activities, AppCompatActivity lets you use AppCompat themes
- adapters, You can listen for view events from the adapter
- app bar, Different types of navigation, AndroidManifest.xml can change your app bar’s appearance
- card views, How to create a card view, Add the data to the card views, The story continues
- collapsing toolbar, Add a collapsing toolbar to OrderActivity
- color resources, Define colors in a color resource file
- FABs, FABs and snackbars
- fragments, Create TopFragment
- layout, The code for activity_main.xml
- libraries, Support libraries allow you to use new features in older versions of Android, 1. Add the AppCompat Support Library, The Design Support Library helps you implement material design
- recycler views, There’s still work to do on the Bits and Pizzas app, How our recycler view adapter will work, Implement the listener in PizzaFragment.java
- scrollbars, Make the toolbar respond to scrolls
- share action provider, Sharing content on the app bar
- snackbar, FABs and snackbars, How to create a snackbar
- tab navigation, Add tab navigation to MainActivity
- themes and styles, How to apply a theme
- toolbar, ActionBar vs. Toolbar
- Up button, Enable Up navigation
- ViewPager, Use a view pager to swipe through fragments
- Play Store, releasing apps to, 1. Distributing your app
- pop-up messages (toasts), Toasts
- postDelayed() method, Handler, Handlers allow you to schedule code
- post() method, Handler, Handlers allow you to schedule code
- Preferences API, 7. Settings
- processes, apps using, How do activities really work?
- processes, apps using, The story continues
- (see also services; threads)
- projects, How do activities really work?
- property animation, 8. Animation
- publishProgress() method, AsyncTask, The onProgressUpdate() method
- putExtra() method, Intent, putExtra() puts extra info in an intent, Create an intent that specifies an action
- put() method, ContentValues, Insert data using the insert() method
R
- RadioButton element, Radio buttons
- RadioGroup element, Radio buttons
- Random class, Add a getDistance() method to the service
- R.drawable reference, Image view: the layout XML, The image files
- recycler view adapter, How our recycler view adapter will work, Add the RecyclerView to PizzaFragment’s layout, You can listen for view events from the adapter
- RecyclerView.Adapter class, How our recycler view adapter will work
- RecyclerView element, Add the RecyclerView to PizzaFragment’s layout
- RecyclerView Library, Support libraries allow you to use new features in older versions of Android
- recycler views
- about, There’s still work to do on the Bits and Pizzas app
- class hierarchy for, Get a recycler view to respond to clicks
- creating, Create the recycler view, Test drive the app
- data for, Tell the adapter what data it should work with..., Add the data to the card views
- layout manager for, A recycler view uses a layout manager to arrange its views
- responding to clicks, Make the recycler view respond to clicks
- scrollbars for, Add the RecyclerView to PizzaFragment’s layout
- views for, Define the adapter’s view holder
- RecyclerView-v7 Library, Display the pizza data in a card
- RelativeLayout element
- releasing apps, 1. Distributing your app
- removeUpdates() method, LocationManager, Return the miles traveled
- RENAME TO command, Change the database structure
- render thread, Databases can make your app go in sloooow-moooo....
- requestLocationUpdates() method, LocationManager, Request location updates...
- requestPermissions() method, ActivityCompat, Check permissions at runtime, Issue a notification if we’re denied permission
- res-auto namespace, How to create a card view
- res folder, Useful files in your project
- resolution of images, Image view
- resource files, Add values to the spinner
- (see also array resources; image resources; String resources)
- about, Welcome to Androidville
- color resources, Define colors in a color resource file
- dimension resources, Add a dimension resource file for consistent padding across layouts
- layout resources, Put screen-specific resources in screen-specific folders
- menu resources, 2. Create the menu resource file
- mipmap resources, AndroidManifest.xml can change your app bar’s appearance
- style resources, How to apply a theme
- types of, folders for, Android Studio creates a complete folder structure for you, The different folder options
- resources (see books and publications; website resources)
- resources element, The code for activity_find_beer.xml
- R.java file, Useful files in your project, onClickFindBeer() needs to do something, Test drive the changes
- rotation of device
- roundIcon attribute, AndroidManifest.xml can change your app bar’s appearance
- rowCount attribute, GridLayout, A grid layout displays views in a grid
- Runnable class, Handlers allow you to schedule code
S
- Safari Books Online, O’Reilly Safari ®
- scale-independent pixels (sp), Playing with views
- scheduled services, Services work in the background
- screens
- scrollbars attribute, recycler view, Add the RecyclerView to PizzaFragment’s layout
- scrolling toolbar, Here’s what we’ll do, Make the toolbar respond to scrolls
- ScrollView element, Scroll view
- SDK (see Android SDK (API level))
- Service class, Your service inherits the lifecycle methods, Create a new service
- ServiceConnection interface, Create a ServiceConnection
- service element, You declare services in AndroidManifest.xml
- services
- setAction() method, Snackbar, How to create a snackbar
- setAdapter() method
- setContentDescription() method, ImageView, Image view: the layout XML, Update the views with the data
- setContentIntent() method, notification builder, Add an action to tell the notification which activity to start when clicked
- setContentView() method, activity, What activity code looks like, The story continues, The states of an activity, Get the activity to set the workout ID
- setDisplayHomeAsUpEnabled() method, ActionBar, Adding the Up button
- setImageResource() method, ImageView, Image view: the layout XML, Update the views with the data
- setListAdapter() method, fragment, Our previous array adapter
- setNavigationItemSelectedListener() method, NavigationView, Respond to the user clicking items in the drawer
- setShareIntent() method, ShareActionProvider, Specify the content with an intent
- setSupportActionBar() method, AppCompatActivity, 5. Set the toolbar as the activity’s app bar, Test drive the app, Update OrderActivity.java
- setText() method, TextView, Once you have a view, you can access its methods, Playing with views, Update the views with the data
- settings screen, 7. Settings
- setType() method, Intent, Create an intent that specifies an action
- setupWithViewPager() method, TabLayout, Link the tab layout to the view pager
- share action provider, Here’s what we’re going to do, Sharing content on the app bar
- shell, running with adb, Running a shell
- shortcuts (see app bar)
- showAsAction attribute, Control the action’s appearance
- Sierra, Kathy (Head First Java), Here’s what we’re going to do
- signing APK files, DEX files are zipped into APK files
- SimpleCursorAdapter class, How to use a simple cursor adapter
- slider (see Switch element)
- snackbar, Here’s what we’ll do, FABs and snackbars, How to create a snackbar
- SnackBar class, How to create a snackbar
- Spinner element
- sp (scale-independent pixels), Playing with views
- SQLite database
- about, Android uses SQLite databases to persist data
- accessing in background thread, Databases can make your app go in sloooow-moooo...., Test drive the app
- adding columns, Change the database structure, Delete tables by dropping them
- alternatives to, Android comes with SQLite classes
- closing, Get cursor values, Close the cursor and database
- conditions for columns, Apply conditions to multiple columns
- conditions for queries, Return selected records
- creating, Specify the database, The StarbuzzDatabaseHelper code
- cursors
- about, Android comes with SQLite classes, Get data from the database with a cursor
- adapter for, How do we replace the array data in the list view?, The revised code for DrinkCategoryActivity, Change the cursor with changeCursor()
- closing, Get cursor values, Close the cursor and database
- creating, Get data from the database with a cursor, Get a reference to the Starbuzz database...
- navigating to records in, To read a record from a cursor, you first need to navigate to it
- refreshing, Cursors don’t automatically refresh
- retrieving values from, Get cursor values
- data types in, Inside a SQLite database
- deleting records, Apply conditions to multiple columns
- deleting tables, Delete tables by dropping them
- downgrading, Downgrade your database with onDowngrade()
- DrinkActivity (see DrinkActivity)
- files for, Android uses SQLite databases to persist data
- getting a reference to, Get a reference to the database, Get a reference to the Starbuzz database...
- helper, Android comes with SQLite classes, Let’s change the app to use a database, The StarbuzzDatabaseHelper code
- inserting data in, Insert data using the insert() method
- location of, Android uses SQLite databases to persist data, Android comes with SQLite classes
- ordering records from query, Return records in a particular order
- performance of, Databases can make your app go in sloooow-moooo...., Test drive the app
- querying records, Get data from the database with a cursor
- renaming tables, Change the database structure
- security for, Android comes with SQLite classes
- tables in, Inside a SQLite database
- updating records
- upgrading, SQLite databases have a version number, Let’s upgrade the database
- version number of, SQLite databases have a version number
- SQLiteDatabase class, Android comes with SQLite classes
- SQLiteException, Get a reference to the database, What we’ve done so far
- SQLiteOpenHelper class, Android comes with SQLite classes, The SQLite helper manages your database
- SQL (Structured Query Language), You create tables using Structured Query Language (SQL), What we’ve done so far
- src attribute, ImageButton, Image button
- src attribute, ImageView, Image view: the layout XML
- src folder, Useful files in your project
- StaggeredGridLayoutManager class, A recycler view uses a layout manager to arrange its views
- Starbuzz Coffee app, Every app starts with ideas, Back to Starbuzz, The story so far..., We want our Starbuzz app to update database data
- activities, Every app starts with ideas, We’re going to build part of the Starbuzz app, Set the listener to the list view, A category activity displays the data for a single category
- adapters, For nonstatic data, use an adapter
- database, Let’s change the app to use a database, The new Starbuzz app structure, We want our Starbuzz app to update database data
- DrinkActivity (see DrinkActivity)
- image resources, The image files
- intents, Pass the ID of the item that was clicked by adding it to an intent
- Java classes, The Drink class
- layout, The top-level layout contains an image and a list
- listeners, Get list views to respond to clicks with a listener, How we handled clicks in TopLevelActivity
- navigation, Navigating through the activities
- threads, Databases can make your app go in sloooow-moooo....
- top level activity
- adding favorites to (see top level activity)
- startActivity() method, activity, An intent is a type of message , What if you ALWAYS want your users to choose an activity?, If you have NO matching activities, How do activities really work?
- started services
- about, Services work in the background, What happens when you run the app
- class hierarchy for, Your service inherits the lifecycle methods
- compared to bound services, Test drive the app
- creating, We’ll create a STARTED service, The full DelayedMessageService code
- declaring in AndroidManifest.xml, You declare services in AndroidManifest.xml
- in combination with bound services, Test drive the app
- lifecycle of, The states of a started service
- methods associated with, The states of a started service
- starting, Add a button to activity_main.xml
- startService() method, Intent, You start a service using startService(), The started service lifecycle: from create to destroy
- states, of activities (see activity lifecycle)
- Stopwatch app, The Stopwatch app, Adding dynamic fragments
- activities, How the activity code will work, The full StopwatchActivity code
- activity lifecycle, The activity lifecycle: from create to destroy, There’s more to an activity’s life than create and destroy
- activity states, Test drive the app
- dynamic fragments, Adding dynamic fragments, The StopwatchFragment.java code
- fragment lifecycle, Fragments and activities have similar lifecycles...
- fragment transactions, Use <fragment> for static fragments..., So far, we’ve only used fragment transactions in activities
- handlers, Handlers allow you to schedule code
- layout, Add String resources, Add a FrameLayout where the fragment should appear
- project, The Stopwatch app
- String resources, Add String resources
- string-array element, Add values to the spinner
- string element, The code for activity_find_beer.xml
- @string reference, Use the String resource in your layout, Update strings.xml...
- String resources
- about, Let’s build a Beer Adviser app, Hardcoding text makes localization hard, The code for activity_find_beer.xml, Time for a test drive
- action titles in, 1. Add the action’s resources
- adding, Add scrollable content to TopFragment, Add a collapsing toolbar to OrderActivity
- arrays of, Add values to the spinner, Spinner, Use a list view to display the list of options
- creating, Create the String resource, Update strings.xml...
- getting value of, Change the code to create a chooser
- location of, The code for activity_find_beer.xml, Time for a test drive
- referencing strings in, Use the String resource in your layout, Update strings.xml...
- updated in R.java file, Test drive the changes
- strings.xml file (see Array resources; String resources)
- Structured Query Language (see SQL)
- style element, Define styles in a style resource file
- @style reference, How to apply a theme
- style resources, How to apply a theme
- styles
- Support Libraries, Support libraries allow you to use new features in older versions of Android
- supportsRtl attribute, application, Orientation is vertical or horizontal
- Swing, Here’s what we’re going to do
- swiping through fragments, Use a view pager to swipe through fragments
- Switch element, Switch
- sync adapters, 3. Loaders
- syncState() method, ActionBarDrawerToggle, Add a drawer toggle
- system image (see Android SDK (API level))
T
- TabLayout element, How to add tabs to your layout, Link the tab layout to the view pager
- tab navigation
- tasks, Apps can contain more than one activity
- testing
- text attribute
- text field (see EditText element)
- textOff attribute
- textOn attribute
- textSize attribute, TextView, Playing with views
- TextView element
- theme attribute
- themes
- about, Welcome to the Android manifest file
- app bar requiring, Add an app bar by applying a theme
- applying to project, AndroidManifest.xml can change your app bar’s appearance
- built-in, list of, Theme gallery
- customizing, Customize the look of your app
- for navigation drawers, Create a toolbar layout
- removing app bar using, 3. Remove the app bar
- v7 AppCompat Library for, Support libraries allow you to use new features in older versions of Android, Add the v7 AppCompat Support Library
- threads
- title attribute, Control the action’s appearance
- toasts, Toasts
- ToggleButton element, Toggle button
- toolbar
- Toolbar class, ActionBar vs. Toolbar, 4. Add a toolbar to the layout, Test drive the app
- top-level activities, Organize your ideas: top-level, category, and detail/edit activities, We’re going to build part of the Starbuzz app, Great apps have a clear structure
- transactions, for fragments (see fragment transactions)
U
- unbindService() method, ServiceConnection, Use unbindService() to unbind from the service
- unit tests, 10. Automated testing
- Up button, Here’s what we’re going to do, Enable Up navigation
- update() method, SQLiteDatabase, Update records with the update() method, Respond to clicks to update the database
- USB debugging, You need to run your app on a REAL device
- USB driver, installing, You need to run your app on a REAL device
- uses-permission element, Declare the permissions you need
V
- v4 Support Library, Support libraries allow you to use new features in older versions of Android
- (see also Design Support Library)
- v7 AppCompat Library
- v7 CardView Library, Support libraries allow you to use new features in older versions of Android, Display the pizza data in a card
- v7 RecyclerView Library, Support libraries allow you to use new features in older versions of Android
- values resource folders (see string resources; dimension resources)
- variables, setting, Add code for the buttons, The runTimer() method
- vertical constraints, Add a vertical constraint
- view animations, 8. Animation
- ViewGroup class, GUI components are a type of View, A layout is really a hierarchy of Views
- ViewHolder class, Add a recycler view adapter, Define the adapter’s view holder
- ViewPager class, Use a view pager to swipe through fragments, Link the tab layout to the view pager
- views, 9. App widgets
- (see also specific GUI components)
- about, activity_find_beer.xml has a new button, GUI components are a type of View
- aligning, How to align views
- biases for, Adjust a view’s position by updating its bias
- centering, How to center views
- getting and setting properties, What being a view buys you
- gravity for view contents, Gravity controls the position of a view’s contents
- gravity for view placement, layout_gravity controls the position of a view within a layout, A frame layout stacks views in the order they appear in the layout XML
- height, A linear layout displays views in the order they appear in the layout XML, Adding weight to one view, How to change a view’s size
- ID, activity_find_beer.xml has a new button, A linear layout displays views in the order they appear in the layout XML, What being a view buys you
- margins, Use margins to add distance between views, Add a vertical constraint
- methods associated with, What being a view buys you
- weight, Make a view streeeeetch by adding weight
- width, A linear layout displays views in the order they appear in the layout XML, How to change a view’s size
W
- website resources
- WebView class, 6. The WebView class
- widgets, Add a button using the design editor
- Workout app, Your app needs to look great on ALL devices, The Workout app looks the same on a phone and a tablet, Adding dynamic fragments
- activities, Add a button to MainActivity’s layout, Get the fragment and activity to interact, The code for activity_main.xml, DetailActivity needs to pass the ID to WorkoutDetailFragment, 3. Commit the transaction, What we’re going to do
- adapters, Adapters revisited
- back button, You want fragments to work with the Back button
- device sizes, supporting, Your app needs to look great on ALL devices, The Workout app looks the same on a phone and a tablet
- dynamic fragments, Adding dynamic fragments, The StopwatchFragment.java code
- fragment lifecycle, Fragments and activities have similar lifecycles...
- fragment state, Rotating the tablet breaks the app
- fragment transactions, Use <fragment> for static fragments..., So far, we’ve only used fragment transactions in activities
- fragments, Fragments allow you to reuse code, How to add a fragment to your project, Get the fragment and activity to interact, The fragment lifecycle, Use a frame layout to replace fragments programmatically
- Java classes, The Workout class
- layout, Add a FrameLayout where the fragment should appear
- libraries, Create the project and activities
- list fragments, We need to create a fragment with a list, The updated WorkoutListFragment code
- listener interface, Connect the list to the detail
- screen-specific resources, Put screen-specific resources in screen-specific folders
- tablet AVD, Create a tablet AVD
- wrap_content setting, width and height, How to change a view’s size
..................Content has been hidden....................
You can't read the all page of ebook, please click
here login for view all page.