reklama - zainteresowany?

Head First Android Development. 3rd Edition - Helion

Head First Android Development. 3rd Edition
ebook
Autor: Dawn Griffiths, David Griffiths
ISBN: 9781492076476
stron: 932, Format: ebook
Data wydania: 2021-11-10
Księgarnia: Helion

Cena książki: 177,65 zł (poprzednio: 206,57 zł)
Oszczędzasz: 14% (-28,92 zł)

Dodaj do koszyka Head First Android Development. 3rd Edition

What will you learn from this book?

If you have an idea for a killer Android app, this fully revised and updated edition will get you up and running in a jiffy. You'll go beyond syntax and how-to manuals and learn how to think like a great Android developer. This hands-on book teaches you everything from designing user interfaces to building multi-screen apps that persist data in a database. It covers the latest features of Android Jetpack, including Jetpack Compose. It's like having an experienced Android developer sitting right next to you! If you have some Kotlin know-how, you're ready to get started.

Why does this book look so different?

Based on the latest research in cognitive science and learning theory, Head First Android Development uses a visually rich format to engage your mind rather than a text-heavy approach that puts you to sleep. Why waste your time struggling with new concepts? This multisensory learning experience is designed for the way your brain really works.

Dodaj do koszyka Head First Android Development. 3rd Edition

 

Osoby które kupowały "Head First Android Development. 3rd Edition", wybierały także:

  • Windows Media Center. Domowe centrum rozrywki
  • Ruby on Rails. Ćwiczenia
  • DevOps w praktyce. Kurs video. Jenkins, Ansible, Terraform i Docker
  • Przywództwo w Å›wiecie VUCA. Jak być skutecznym liderem w niepewnym Å›rodowisku
  • Scrum. O zwinnym zarzÄ…dzaniu projektami. Wydanie II rozszerzone

Dodaj do koszyka Head First Android Development. 3rd Edition

Spis treści

Head First Android Development. 3rd Edition eBook -- spis treści

  • Table of Contents (the real thing)
  • How to use this book: Intro
    • Who is this book for?
      • Who should probably back away from this book?
    • We know what youre thinking
    • We know what your brain is thinking
    • Metacognition: thinking about thinking
    • Heres what WE did
      • Heres what YOU can do to bend your brain into submission
    • Read me
    • The truly awesome technical review team
    • Acknowledgments
    • OReilly Online Learning
  • 1. Getting Started: Diving In
    • Welcome to Androidville
      • Activities define what the app does
      • Layouts define what each screen looks like
      • There may be extra files too
    • Activities and layouts form the backbone of your app
    • Heres what were going to do
    • Android Studio: your development environment
      • You need to install Android Studio
    • Install Android Studio
    • Lets build a basic app
    • How to build the app
      • 1. Create a new project
      • 2. Select a project template
      • 3. Configure your project
    • Youve created your first Android project
    • Dissecting your new project
      • The folder structure includes different types of files
    • Introducing the key files in your project
    • Edit code with the Android Studio editors
      • The code editor
      • The design editor
    • The story so far
    • How to run the app on a physical device
      • 1. Enable USB debugging on your device
      • 2. Set up your computer to detect the device
      • 3. Use a USB cable to plug your device into your computer
      • 4. Run the app
    • How to run the app on a virtual device
    • Create an Android Virtual Device (AVD)
      • Open the Android Virtual Device Manager
      • Select the hardware
      • Select a system image
      • Verify the AVD configuration
      • The virtual device gets created
      • Run the app on the AVD
    • Compile, package, deploy, run
    • Test Drive
    • What just happened?
    • Lets refine the app
      • The app has one activity and one layout
      • The activity controls what the app does
      • The layout controls the apps appearance
    • Whats in the layout?
      • The design editor
      • The code editor
    • activity_main.xml has two elements
    • Update the text displayed in the layout
    • What the code does
    • Test Drive
    • Your Android Toolbox
  • 2. Building Interactive Apps: Apps That Do Something
    • Lets build a Beer Adviser app
    • Heres what were going to do
    • Create the project
    • Weve created a default activity and layout
    • A closer look at the design editor
    • Add a button using the design editor
      • Changes in the design editor are reflected in the XML
    • activity_main.xml has a new button
      • Buttons and text views are subclasses of the same Android View class
        • android:id
        • android:layout_width, android:layout_height
        • android:text
    • A closer look at the layout code
      • The <LinearLayout> element
      • The <Button> element
      • The <TextView> element
    • Lets update the layout XML
    • The XML changes are reflected in the design editor
    • Test Drive
    • There are warnings in the layout
      • because theres hardcoded text
    • Put text in a String resource file
      • Android Studio helps you extract String resources
    • Extract the String resource
      • A String resource has been added to strings.xml
    • activity_main.xml uses the String resource
      • You also can extract String resources manually
    • Add and use a new String resource
    • Test Drive
    • Add values to the spinner
      • Adding an array resource is similar to adding a String
    • Add the string-array to strings.xml
      • Get the spinner to display the arrays values
    • The full code for activity_main.xml
    • Test Drive
    • We need to make the app interactive
    • What the MainActivity code looks like
    • A button can listen for on-click events
      • using an OnClickListener
    • Get a reference to the button
      • and call its setOnClickListener method
    • Pass a lambda to the setOnClickListener method
    • How to edit a text views text
      • How to get the spinners value
    • Pool Puzzle
    • Pool Puzzle Solution
    • The updated code for MainActivity.kt
    • What happens when you run the code
    • Test Drive
    • Add the getBeers() method
    • Activity Magnets
    • Activity Magnets Solution
    • The full code for MainActivity.kt
    • What happens when you run the code
    • Test Drive
    • Your Android Toolbox
  • 3. Layouts: Being a layout
    • It all starts with a layout
    • Android has different types of layout
      • Use the best layout for your screen design
    • Lets build a linear layout
      • Create a new project
    • How to define a linear layout
    • Orientation can be vertical or horizontal
    • Use padding to add space to the layouts edges
    • The layout code so far
    • An edit text lets you enter text
    • Add views to the layout XML
    • Make a view streeeeetch by adding weight
    • How to add weight to one view
    • How to add weight to multiple views
    • The gravity attribute controls the position of a views contents
    • Values you can use with the android:gravity attribute
    • Layout Magnets
    • Layout Magnets Solution
    • The story so far
    • layout-gravity controls the position of a view within a layout
    • More values you can use with the android:layout-gravity attribute
    • Use margins to add space between views
    • The full linear layout code
    • Test Drive
    • BE the Layout
    • BE the Layout Solution
    • Your activity code tells Android which layout it uses
      • The layouts views are inflated into objects
    • Layout inflation: an example
    • A frame layout stacks its views
      • Create a new project
      • How to define a frame layout
    • Add an image to your project
    • A frame layout stacks views in the order they appear in the layout XML
    • Test Drive
    • All layouts are a type of ViewGroup
      • and a ViewGroup is a type of View
    • A scroll view inserts a vertical scrollbar
    • How to add a scroll view
    • Test Drive
    • Your Android Toolbox
  • 4. Constraint Layouts: Draw Up a Blueprint
    • Nested layouts revisited
    • Nesting layouts comes at a price
    • Introducing the constraint layout
      • You design constraint layouts VISUALLY
    • Constraint layouts are part of Android Jetpack
    • Heres what were going to do
      • Create a new project
    • Use Gradle to include Jetpack libraries
      • The project build.gradle needs a Google repository line
      • The app build.gradle includes the constraint layouts library
    • Lets add a constraint layout to activity_main.xml
      • Show the layout in the blueprint
    • Add a button to the blueprint
    • Position views using constraints
      • Well add a horizontal constraint to the button
    • Add a vertical constraint too
    • Use opposing constraints to center views
    • You can delete constraints you no longer need
    • Remove constraints with the constraint widget
      • You can use it to add margins too
    • Changes to the blueprint appear in the XML
    • Views can have bias
    • Test Drive
    • You can change a views size
      • Make the view just big enough
      • Match the views constraints
    • BE the Constraint
    • BE the Constraint Solution
    • Most layouts need multiple views
      • Add a second button to the blueprint
    • You can connect views to other views
    • You can align views too
    • Align views using guidelines
    • Guidelines have a fixed position
    • Create a movable barrier
      • Lets build a layout that uses a barrier
    • Add a horizontal barrier
      • Place the barrier beneath the views
    • Constrain a button under the barrier
    • The full code for activity_main.xml
    • Test Drive
    • Use a chain to control a linear group of views
      • Were going to create a horizontal chain
    • The chain will use three buttons
      • Align the views were going to chain
    • Create the horizontal chain
    • There are different styles of chain
      • Spread spaces out views between the blueprints edges
      • Spread inside moves the first and last view to the edges
      • Packed moves the views together
    • Test Drive
    • A flow is like a multi-line chain
    • How to add a flow
    • You can control the flows appearance
      • Use chain to create a multi-line chain
      • Use aligned to line up the views
    • The full code for activity_main.xml
    • Test Drive
    • Your Android Toolbox
  • 5. The Activity Lifecycle: Being an Activity
    • How do activities really work?
      • Introducing the Stopwatch app
    • Create a new project
      • Add String resources for the text labels
      • The layout includes a Chronometer view
    • The full code for activity_main.xml
    • The activity code controls the stopwatch
      • The Chronometers key properties and methods
      • The base property
      • The start() method
      • The stop() method
    • The full code for MainActivity.kt
    • What happens when you run the app
    • Test Drive
      • But theres just one problem
    • What happens when the app runs
    • Rotating the screen changes the device configuration
    • An activitys states
    • The activity lifecycle: from create to destroy
    • Your activity inherits the lifecycle methods
    • Save the current state in a Bundle
      • Add values using put methods
      • Retrieve values using get methods
    • Save the state using onSaveInstanceState()
      • Restore the state using onCreate()
    • The updated MainActivity.kt code
    • What happens when you run the app
    • Test Drive
    • Activity Magnets
    • Activity Magnets Solution
    • Theres more to an activitys life than create and destroy
      • Start, stop, and restart
    • The visible lifecycle
    • We need to implement two more lifecycle methods
      • Implement onStop() to pause the stopwatch
    • Restart the stopwatch when the app becomes visible
    • The updated MainActivity.kt code
    • What happens when you run the app
    • Test Drive
    • What if an activity is only partially visible?
    • The foreground lifecycle
    • Pause the stopwatch if the activitys paused
    • The complete MainActivity.kt code
    • What happens when you run the app
    • Test Drive
    • Your handy guide to the activity lifecycle methods
    • BE the Activity
    • BE the Activity Solution
    • Your Android Toolbox
  • 6. Fragments and Navigation: Finding Your Way
    • Most apps need more than one screen
    • Each screen is a fragment
      • WelcomeFragment
      • MessageFragment
      • EncryptFragment
    • Navigate between screens using the Navigation component
    • Heres what were going to do
    • Create a new project
      • Add some String resources
    • Add WelcomeFragment to the project
    • What fragment code looks like
      • Fragment code looks similar to activity code
    • The fragments onCreateView() method
      • Inflate the fragments layout, and return it
    • Fragment layout code looks like activity layout code
    • You display a fragment in a FragmentContainerView
    • Update the activity_main.xml code
      • The full code for MainActivity.kt
    • What the code does
    • Test Drive
    • Pool Puzzle
    • Pool Puzzle Solution
    • Create MessageFragment
    • Update MessageFragments layout
    • Update MessageFragment.kt
    • Use the Navigation component to navigate between fragments
    • Use Gradle to add the Navigation component to your project
      • Add a version number to the project build.gradle file
      • Add a dependency to the app build.gradle file
    • Create a navigation graph
    • Add fragments to the navigation graph
    • Connect fragments using an action
      • Every action needs a unique ID
    • Navigation graphs are XML resources
    • Add a navigation host to the layout using a FragmentContainerView
    • Add a NavHostFragment to activity_main.xml
      • We need to navigate between the fragments
    • Add an OnClickListener to the button
      • Fragment OnClickListener code is a little different
    • Get a navigation controller
      • Tell it where to navigate with an action
    • The full code for WelcomeFragment.kt
    • What happens when the app runs
    • Test Drive
    • Your Android Toolbox
  • 7. Safe Args: Passing Information
    • The Secret Message app navigates between fragments
    • MessageFragment needs to pass the message to a new fragment
    • Heres what were going to do
    • Create EncryptFragment
      • and update its layout
    • Update EncryptFragment.kt
    • Add EncryptFragment to the navigation graph
    • The updated nav_graph.xml code
    • MessageFragment needs to navigate to EncryptFragment
    • Test Drive
    • Add Safe Args to the build.gradle files
      • Add a classpath to the project build.gradle file
      • Add the plug-in to the app build.gradle file
    • EncryptFragment needs to accept a String argument
    • The updated nav_graph.xml code
    • MessageFragment needs to pass a message to EncryptFragment
      • You can pass arguments to navigation actions
    • Safe Args generates Directions classes
      • Use a Directions class to add arguments to actions
    • Update the MessageFragment.kt code
    • EncryptFragment needs to get the arguments value
      • Use an Args class to retrieve arguments
      • We need to encrypt the message
    • The full code for EncryptFragment.kt
    • What happens when the app runs
    • Test Drive
    • Navigation Magnets
    • Navigation Magnets Solution
    • What if the user wants to go back?
    • We could change the back behavior
    • Welcome to the back stack
      • A back stack scenario
    • Use the navigation graph to pop fragments off the back stack
    • The updated nav_graph.xml code
    • Test Drive
    • BE the Safe Args Plug-in
    • BE the Safe Args Plug-in Solution
    • Your Android Toolbox
  • 8. Navigation ui: Going Places
    • Different apps, different structures
    • Android includes navigation UI components
      • An app bar
      • The bottom navigation bar
      • A navigation drawer
    • How the CatChat app will work
    • Heres what were going to do
    • Create a new project
      • A default app bar gets added
      • by applying a theme
    • The CatChat app will use a Material theme
      • The app build.gradle file needs a Material library dependency
    • Apply a theme in AndroidManifest.xml
    • Define styles in style resource files
    • Styles can override theme colors
      • Color resource files define a set of colors
    • Replace the default app bar with a toolbar
      • Remove the default app bar using a theme
    • A toolbar is a type of View
    • Add the toolbar to activity_main.xml
      • Where did the app name go?
    • Set the toolbar as MainActivitys app bar
    • Test Drive
    • Lets use the toolbar to navigate
      • How toolbar navigation will work
    • Create InboxFragment
    • Create HelpFragment
    • Well use the Navigation component to navigate to HelpFragment
      • Add a version number to the project build.gradle file
      • Add dependencies to the app build.gradle file
    • Add the fragments to a navigation graph
    • Add a navigation host to activity_main.xml
    • Specify items in the toolbar with a menu resource file
    • Lets add a Help item to the menu
    • onCreateOptionsMenu() adds menu items to the toolbar
    • Respond to menu item clicks with onOptionsItemSelected()
    • We need to configure the toolbar
    • Configure the toolbar using an AppBarConfiguration
    • The full code for MainActivity.kt
    • What happens when the app runs
    • Test Drive
    • BE the Menu
    • BE the Menu Solution
    • Most types of UI navigation work with the Navigation component
      • How the bottom navigation bar will work
    • Create SentItemsFragment
    • Add SentItemsFragment to the Navigation graph
    • The bottom navigation bar needs a new menu resource file
    • A bottom navigation bar is a type of View
    • The full code for activity_main.xml
    • Link the bottom navigation bar to the navigation controller
    • The updated code for MainActivity.kt
    • Test Drive
    • A navigation drawer lets you display many navigation items
    • Lets replace the bottom navigation bar with a navigation drawer
    • Navigation drawers deconstructed
    • The drawer gets its items from a menu
    • Add the support section
      • as a separate submenu
    • Highlight the selected item with groups
    • The full code for menu_main.xml
    • Create the navigation drawers header
      • Add the image file
      • and update the nav_header.xml code
    • How to create a navigation drawer
    • The full code for activity_main.xml
      • Weve added a navigation drawer to the layout
    • Configure the toolbars drawer icon
      • and link the drawer to the navigation controller
    • The full code for MainActivity.kt
    • Test Drive
    • Layout Magnets
    • Layout Magnets Solution
    • Your Android Toolbox
  • 9. Material Views: A Material World
    • Material is used throughout Androidville
    • The Bits and Pizzas app
    • Heres what well do
    • Create the Bits and Pizzas project
      • Add a Material library dependency to the app build.gradle file
    • Create OrderFragment
    • Display OrderFragment in MainActivitys layout
    • Replace the default app bar with a toolbar
    • Fragments dont have a setSupportActionBar() method
    • Weve added the toolbarnow what?
      • We want the toolbar to respond to scrolls
    • The coordinator layout coordinates animations between views
    • The app bar layout enables toolbar animation
    • Tell the toolbar how to respond to scroll events
    • A nested scroll view makes layout content scrollable
    • The full code for fragment_order.xml
    • Test Drive
    • BE the Layout
    • BE the Layout Solution
    • Lets create a collapsing toolbar
    • How to create a plain collapsing toolbar
    • How to add an image to a collapsing toolbar
    • Add a restaurant image drawable
      • The full code for fragment_order.xml
    • Test Drive
    • Layout Magnets
    • We need to build OrderFragments main content
    • Choose a pizza type using a radio button
    • Radio buttons are a type of compound button
    • A chip is a type of flexible compound button
    • Add multiple chips to a chip group
      • Use isChecked to find out if a chip is checked
    • A FAB is a floating action button
    • You can anchor a FAB to a collapsing toolbar
    • We need to build OrderFragments layout
    • The full code for fragment_order.xml
    • Test Drive
    • Lets make the FAB respond to clicks
    • Add an OnClickListener to the FAB
      • Find out if a pizza type has been selected
    • A toast is a simple pop-up message
      • Add a toast to the FAB OnClickListener
    • Display the pizza order in a snackbar
      • Snackbars can have actions
    • The snackbar code for the pizza order
    • The full code for OrderFragment.kt
    • Test Drive
    • Pool Puzzle
    • Pool Puzzle Solution
    • Layout Magnets Solution
    • Your Android Toolbox
  • 10. View Binding: Bound Together
    • Behind the scenes of findViewById()
      • findViewById() looks for a view in the view hierarchy
    • Theres a downside to findViewById()
    • View binding to the rescue
      • View binding is safer and more efficient than findViewById()
    • Heres how well use view binding
    • The Stopwatch app revisited
    • Enable view binding in the app build.gradle file
      • Enabling view binding generates code for each layout
    • How to add view binding to an activity
    • Use the binding property to interact with views
      • The layout code
      • The activity code
    • The full code for MainActivity.kt
    • What the code does
    • Test Drive
    • Activity Magnets
    • Fragments can use view binding too (but the codes a little different)
      • Lets implement view binding in the Bits and Pizzas app
    • Enable view binding for Bits and Pizzas
      • Binding classes are generated for every layout
    • Fragment view binding code is a little different
      • Activities can access views from onCreate()
    • Fragments can access views from onCreateView() to onDestroyView()
    • What fragment view binding code looks like
    • _binding refers to the binding object
      • ...and the binding property provides non-null access to it
    • The full code for OrderFragment.kt
    • Test Drive
    • Activity Magnets Solution
    • Your Android Toolbox
  • 11. View Models: Model Behavior
    • Configuration changes revisited
      • There are other problems, too
    • Introducing the view model
      • Why use a view model?
    • What the guessing game will do
    • How the app will be structured
    • Heres what were going to do
      • Create the Guessing Game project
    • Update the project build.gradle file
      • and update the app build.gradle file too
    • The Guessing Game app has two fragments
      • Create GameFragment
      • and then create ResultFragment
    • How navigation should work
      • Create the navigation graph
    • Update the navigation graph
    • Display the current fragment in MainActivitys layout
    • Update GameFragments layout
      • What GameFragment needs to do
    • The GameFragment.kt code
    • Update ResultFragments layout
      • We also need to update ResultFragment.kt
    • The ResultFragment.kt code
    • What happens when the app runs
    • Test Drive
    • The game loses state when the screen rotates
    • A view model holds business logic
    • Add a view model dependency to the app build.gradle file
      • and create a view model
    • The full code for GameViewModel.kt
    • Create a GameViewModel object
      • Use a ViewModelProvider to create view models
    • The updated code for GameFragment.kt
    • What happens when the app runs
    • Test Drive
    • BE the View Model
    • Weve added a view model for GameFragment
      • ResultFragment needs a view model too
    • ResultViewModel needs to hold the result
      • We need to link ResultViewModel to ResultFragment
    • A view model factory creates view models
    • Create the ResultViewModelFactory class
    • Use the factory to create the view model
    • The updated code for ResultFragment.kt
    • What happens when the app runs
    • Test Drive
    • View Model Magnets
    • View Model Magnets Solution
    • BE the View Model Solution
    • Your Android Toolbox
  • 12. Live Data: Leaping into Action
    • The Guessing Game app revisited
    • The fragments decide when to update views
      • Let the view model say when a values changed
    • Heres what were going to do
      • Add a live data dependency to the app build.gradle file
    • GameViewModel and GameFragment need to use live data
      • Which view model properties should use live data?
    • Live data objects use a value property
      • The value property can be null
    • The full code for GameViewModel.kt
    • The fragment observes the view model properties and reacts to changes.
    • The full code for GameFragment.kt
    • What happens when the app runs
    • Test Drive
    • Fragments can update GameViewModels properties
      • Keep your privates private
    • The full code for GameViewModel.kt
    • What happens when the app runs
    • Test Drive
    • GameFragment still includes game logic
      • Make GameViewModel decide when the game is over
    • Pool Puzzle
    • Pool Puzzle Solution
    • The full code for GameViewModel.kt
    • Make GameFragment observe the new property
    • What happens when the app runs
    • Fragment Magnets
    • Fragment Magnets Solution
    • Test Drive
    • Your Android Toolbox
  • 13. Data Binding: Building Smart Layouts
    • Back to the Guessing Game app
    • The fragments update the views in their layouts
      • We can make the views update themselves instead
    • Heres what were going to do
    • Enable data binding in the app build.gradle file
    • ResultFragment updates the text in its layout
      • How well implement data binding
    • 1. Add <layout> and <data> elements
    • 2. Set the layouts data binding variable
    • 3. Use the layouts data binding variable to access the view model
    • The full code for fragment_result.xml
    • The full code for ResultFragment.kt
    • What happens when the app runs
    • Test Drive
    • Layout Magnets
    • Layout Magnets Solution
    • GameFragment can use data binding too
    • Add <layout> and <data> elements to fragment_game.xml
    • Use the data binding variable to set the layouts text
      • Two of the views need to show extra text
    • String resources revisited
      • String resources can have arguments
      • Add two new String resources to strings.xml
    • The layout can pass parameters to String resources
    • The full code for fragment_game.xml
    • We need to set the gameViewModel variable
      • We also need to make the data binding use live data
    • The full code for GameFragment.kt
    • What happens when the app runs
    • Test Drive
    • You can use data binding to call methods
    • Add finishGame() to GameViewModel.kt
    • Use data binding to make a button call a method when clicked
    • The full code for fragment_game.xml
    • What happens when the app runs
    • Test Drive
    • Pool Puzzle
    • Fireside Chats
    • We can switch off view binding
      • Switch off view binding in the apps build.gradle file
    • Test Drive
    • Binding-Cross
    • Binding-Cross Solution
    • Pool Puzzle Solution
    • Your Android Toolbox
  • 14. Room Databases: Room with a View
    • Most apps need to store data
      • Apps can persist data using a database
    • How the app will be structured
    • Room is a database library that sits on top of SQLite
      • Room apps are usually structured using MVVM
    • Heres what were going to do
      • Create the Tasks project
    • Add a variable to the project build.gradle file
      • and update the app build.gradle file, too
    • Create TasksFragment
      • Update TasksFragment.kt
    • Update fragment_tasks.xml
    • Display TasksFragment in MainActivitys layout
      • and check the MainActivity.kt code
    • How Room databases are created
      • 1. A database class
      • 2. Data classes for the tables
      • 3. Interfaces for data access
    • Well store tasks data in a table
      • You define tables with an annotated data class
      • Create the Task data class
    • Specify a table name with @Entity
      • Specify the primary key with @PrimaryKey
      • Specify column names with @ColumnInfo
    • The full code for Task.kt
    • Use an interface to specify data operations
      • Create the TaskDao interface
      • Use @Dao to mark the interface for data access
    • Use @Insert to insert a record
      • Use @Update to update a record
    • Use @Delete to delete a record
      • Use @Query for everything else
    • The full code for TaskDao.kt
    • Create a TaskDatabase abstract class
      • Annotate the class with @Database
    • Add properties for any DAO interfaces
      • Create and return an instance of the database
    • The full code for TaskDatabase.kt
    • MVVM revisited
      • Weve completed all the Model code
      • so lets move on to the ViewModel
    • Create TasksViewModel
    • Database operations can run in slooooow-moooo
      • Well use coroutines to run data access code in the background
    • 1. Mark TaskDaos methods with suspend
    • 2. Launch the insert() method in the background
    • TasksViewModel needs a view model factory
      • Create TasksViewModelFactory
    • TasksViewModelFactory needs a TaskDao
      • The TaskDatabase code has a TaskDao property
    • The updated code for TasksFragment.kt
    • TasksFragment can use data binding
    • Well use data binding to insert a record
      • Set TasksViewModels newTaskName property
      • Call TasksViewModels addTask() method
    • The full fragment_tasks.xml code
    • The full TasksFragment.kt code
    • What happens when the code runs
    • Test Drive
    • TasksFragment needs to display records
    • Use getAll() to get all tasks from the database
    • A LiveData<List<Task>> is a more complex type
      • Use Transformations.map() to transform live data objects
    • Lets update the TasksViewModel code
    • Well bind the tasksString property to the layouts text view
      • We need to make the layout respond to live data updates
    • The full TasksFragment.kt code
    • What happens when the code runs
    • Test Drive
    • Mixed Messages
    • Mixed Messages Solution
    • Your Android Toolbox
  • 15. Recycler Views: Reduce, Reuse, Recycle
    • What the Tasks app currently looks like
    • We can turn the list into a recycler view
    • Why use a recycler view?
      • Recycler views get their data from an adapter
    • Heres what were going to do
      • Add a recycler view dependency to the app build.gradle file
    • Tell the recycler view how to display each item
      • by defining a layout file
    • The adapter adds data to the recycler view
      • Create the adapter file
    • Tell the adapter what data it should work with
      • Override the getItemCount() method
    • Define the adapters view holder
    • Override the onCreateViewHolder() method
    • Add data to the layouts view
    • The full code for TaskItemAdapter.kt
    • The adapter code is complete
    • We need to display the recycler view
      • How to add a recycler view to a layout
    • The full code for fragment_tasks.xml
      • Tell the recycler view to use the adapter
    • The updated code for TasksFragment.kt
    • Weve added a recycler view to TasksFragments layout
      • Well make TasksFragment add task data to TaskItemAdapter
    • Update the TasksViewModel.kt code
    • TasksFragment needs to update TaskItemAdapters data property
    • The full code for TasksFragment.kt
      • Weve finished writing all the recycler view code
    • What happens when the code runs
    • Test Drive
    • Adapter Magnets
    • Adapter Magnets Solution
    • Recycler views are very flexible
    • Recycler view 2.0
      • Add a card view dependency to the app build.gradle file
    • How to create a card view
    • The full code for task_item.xml
    • The adapters view holder needs to work with the new layout code
    • The full code for TaskItemAdapter.kt
    • What the recycler view looks like so far
    • The layout manager gallery
      • Display items in a horizontal row
      • Use GridLayoutManager to display items in a grid
      • Arrange items in a staggered grid
    • Update fragment_tasks.xml to arrange items in a grid
    • What happens when the code runs
    • Test Drive
    • Pool Puzzle
    • Pool Puzzle Solution
    • Your Android Toolbox
  • 16. Diffutil and Data Binding: Life in the Fast Lane
    • The recycler view displays task data correctly
      • but when the datas updated, the recycler view jumps
    • The Tasks app revisited
    • How the recycler view gets its data
    • The data propertys setter calls notifyDataSetChanged()
      • notifyDataSetChanged() redraws the entire list
    • Tell the recycler view what needs to change
      • DiffUtil works out differences between lists
    • Heres what were going to do
    • We need to implement DiffUtil.ItemCallback
      • Create TaskDiffItemCallback.kt
    • A ListAdapter accepts a DiffUtil.ItemCallback argument
      • We can simplify the rest of TaskItemAdapters code
    • The updated code for TaskItemAdapter.kt
    • Populate the ListAdapters list
      • using submitList()
    • The updated code for TasksFragment.kt
    • What happens when the code runs
    • Test Drive
    • BE the ListAdapter
    • Recycler views can use data binding
      • How well implement data binding
    • Add a data binding variable to task_item.xml
    • The layout gets inflated in the adapters view holder code
    • Use the binding class to inflate the layout
      • Set the layouts data binding variable to a Task
    • The full code for TaskItemAdapter.kt
      • Use data binding to set the layouts views
    • The full code for task_item.xml
    • What happens when the code runs
    • Test Drive
    • Adapter Magnets
    • Adapter Magnets Solution
    • BE the ListAdapter Solution
    • Your Android Toolbox
  • 17. Recycler View Navigation: Pick a Card
    • Recycler views can be used for navigation
    • How the Tasks app is currently structured
    • Were going to make the recycler view navigate to a new fragment
    • Heres what were going to do
    • Make each item clickable
    • Where should we create the toast?
      • Well make TasksFragment pass the toast code in a lambda
    • How the code will work
    • The full code for TaskItemAdapter.kt
    • Well pass a lambda to TaskItemAdapter
    • The full code for TasksFragment.kt
    • What happens when the code runs
    • Test Drive
    • Adapter Magnets
    • Adapter Magnets Solution
    • We want to use the recycler view to navigate to a new fragment
    • Update the project build.gradle file
      • then update the app build.gradle file
    • Create EditTaskFragment
      • and create a navigation graph
    • Update the navigation graph
    • Add a NavHostFragment to MainActivitys layout
    • Make TasksFragment navigate to EditTaskFragment
    • Add a new property to TasksViewModel
      • Add methods to update the new property
    • The full code for TasksViewModel.kt
    • Make TasksFragment navigate to EditTaskFragment
      • Call onTaskClicked() when the user clicks a task
      • Navigate to EditTaskFragment when navigateToTask gets updated
    • The full code for TasksFragment.kt
    • Make EditTaskFragment display the task ID
      • We also need to update EditTaskFragment.kt
    • The full code for EditTaskFragment.kt
    • What happens when the code runs
    • Test Drive
    • We want to use EditTaskFragment to update task records
    • Use TaskDao to interact with database records
      • Well create a view model to access TaskDaos methods
    • Create EditTaskViewModel
      • The view model needs to get a task record
      • and include methods to update and delete the task
    • EditTaskViewModel will tell EditTaskFragment when to navigate
    • The full code for EditTaskViewModel.kt
    • EditTaskViewModel needs a view model factory
      • Create EditTaskViewModelFactory
    • fragment_edit_task.xml needs to display the task
      • We need to update EditTaskFragment.kt too
    • The full code for EditTaskFragment.kt
    • What happens when the code runs
    • Test Drive
    • Your Android Toolbox
  • 18. Jetpack Compose: Compose Yourself
    • UI components dont have to be Views
      • Were going to build a Compose app
    • Heres what were going to do
    • Create a new Compose project
    • Configure the project
    • Compose projects have no layout files
    • What Compose activity code looks like
      • Compose activities extend ComponentActivity
    • Use a Text composable to display text
    • Use composables in composable functions
      • Call the Hello composable from setContent()
    • Most UIs have multiple composables
      • You can arrange composables using Row or Column
    • The full code for MainActivity.kt
    • Test Drive
    • You can preview composable functions
      • Add MainActivityPreview to MainActivity.kt
    • Preview composables with the Design or Split option
    • Pool Puzzle
    • Pool Puzzle Solution
    • Lets make the app convert temperatures
    • Add a MainActivityContent composable function
    • Display the header image
      • with an Image composable
    • Add an Image to MainActivity.kt
    • Lets display the temperature text
    • Test Drive
    • Use a Button composable to add a button
      • Lets write a ConvertButton composable function
    • We need to pass a lambda to ConvertButton
    • We need to change the value of TemperatureTexts argument
      • Use remember to store celsius in memory
    • The full code for MainActivity.kt
    • What happens when the app runs
    • Test Drive
    • Compose Magnets
    • Compose Magnets Solution
    • Let the user enter a temperature
      • Well use a TextField composable
    • Add a TextField to a composable function
      • Call the function in MainActivityContent
    • The full code for MainActivity.kt
    • What happens when the app runs
    • Test Drive
    • Well tweak the apps appearance
    • Add padding to the Column composable
    • You can center composables in Columns or Rows
      • Center all of a Columns content
      • Center the content of a single Row
    • Applying themes: revisited
      • How to apply a theme to composables
    • Android Studio includes extra theme code
      • How to apply the theme
    • The full code for MainActivity.kt
    • Test Drive
    • BE Compose
    • BE Compose Solution
    • Your Android Toolbox
  • 19. Integrating Compose with views: Perfect Harmony
    • You can add composables to View-based UIs
      • The Guessing Game app revisited
    • The Guessing Game app structure
    • Heres what were going to do
    • Update the project build.gradle file
      • and update the app build.gradle file, too
    • Well replace ResultFragments views with composables
    • A ComposeView lets you add composables to a layout
      • Well add a ComposeView to fragment_result.xml
    • Add composables using Kotlin code
    • Add a composable function for the fragments content
    • Reproduce the Start New Game button
    • Reproduce ResultFragments TextView
    • The updated code for ResultFragment.kt
    • Test Drive
    • We need to remove ResultFragments views
      • and update ResultFragment.kt
    • onCreateView() returns the UIs root view
      • Return a ComposeView for Compose UIs
    • The full code for ResultFragment.kt
      • We can delete fragment_result.xml
    • What happens when the app runs
    • Test Drive
    • Pool Puzzle
    • Next well make GameFragment use composables too
    • Well add a ComposeView to fragment_game.xml
    • Add a composable function for GameFragments content
    • Reproduce the Finish Game button
    • Reproduce the EditText with a TextField
    • Reproduce the Guess button
    • The updated code for GameFragment.kt
    • Test Drive
    • Well display the incorrect guesses in a Text composable
      • Respond to LiveData using observeAsState()
    • Create an IncorrectGuessesText composable function
      • Run IncorrectGuessesText from GameFragmentContent
    • Compose Magnets
    • Compose Magnets Solution
    • The updated code for GameFragment.kt
    • Test Drive
    • Remove views from GameFragment.kt
    • Delete fragment_game.xml
      • We can also switch off data binding
    • Test Drive
    • Pool Puzzle Solution
    • Your Android Toolbox
    • Leaving town
    • Its been great having you here in Androidville
  • A. Leftovers: The Top Ten Things (we didnt cover)
    • 1. Sharing data with other apps
      • Sharing data with Androids intent resolver
      • Sharing data with the Android Sharesheet
    • 2. WorkManager
      • Use WorkManager to schedule deferrable tasks
    • 3. Dialogs and notifications
      • Use dialogs to prompt the user for a decision
      • Notifications appear outside the apps UI
    • 4. Automated testing
      • Unit tests
      • Instrumented tests
      • An instrumented test example
    • 5. Supporting different screen sizes
      • Provide alternate layouts
      • Use a SlidingPaneLayout
    • 6. More Compose features
      • The Compose ViewModel library
      • Compose constraint layout library
      • The Compose Navigation component
    • 7. Retrofit
    • 8. Android Game Development Kit
    • 9. CameraX
    • 10. Publishing your app
      • Preparing your app for release
      • Releasing your app
  • Index

Dodaj do koszyka Head First Android Development. 3rd Edition

Code, Publish & WebDesing by CATALIST.com.pl



(c) 2005-2024 CATALIST agencja interaktywna, znaki firmowe należą do wydawnictwa Helion S.A.