Group Group Group Group Group Group Group Group Group

Errata for Real-World Android by Tutorials, 1st Edition

Creating this topic to catch any typos and bugs in the 1st Edition of Real-World Android by Tutorials.

In the Building Features – Animals Near You section, the starter project has an older version of Hilt than the finished project. This caused issues with the project unable to resolve the HiltViewModel dependency.

1 Like

In section 2,
10.6 - Handling dependency injection

The DaggerSharingComponent file does not appear in the book.

DaggerSharingComponent.builder ()
.context (requireActivity ())
.moduleDependencies (
EntryPointAccessors.fromApplication (
requireActivity (). applicationContext,
SharingModuleDependencies :: class.java
)
)
.build ()
.inject (this)

2 Likes
  • 13.Custom Views

Understanding the Canvas coordinate system

Figure 13.2 — Android Canvas Coordinates System

In Figure 11.2, you can see that an (x,y) pair represents each…

The correct thing would be: In Figure 13.2, you can see that an (x,y) pair represents each…

For chapter 5, this isn’t really an issue with the book but with the starter code. Once I finished completing the chapter my test wouldn’t pass… I was racking my brain until I realized the fake server couldn’t find the asset file.

I have to make sure my gradle.build file had the sourceSets object setup pointing to the right directory.

Just FYI

1 Like

This is an issue with the book, since chapter 5 makes no mention of the need to set the sourceSets in the gradle.build file. Thankfully you posted here, otherwise I would have also been wracking my brain trying to figure out why my tests were timing out :frowning:

That’s generated by Dagger when annotating with @Component.Builder

@Component(dependencies =[SharingModuleDependencies::class])
interface SharingComponent {
fun inject(fragment: SharingFragment)

**@Component.Builder**
interface Builder {
    fun context(@BindsInstance context: Context): Builder
    fun moduleDependencies(sharingModuleDependencies: SharingModuleDependencies): Builder
    fun build(): SharingComponent
}

}

Chapter 13 - Custom Views - In topic " Binding the animation to the adopt button", the following is not part of the starter code, and is also not mentioned at any point of the chapter:

binding.adoptButton.setOnClickListener {
      binding.adoptButton.startLoading()
      viewModel.handleEvent(AnimalDetailsEvent.AdoptAnimal) //
    }

The Event Adopt Animal is not defined. Also this function is missing in the start project

private fun adoptAnimal() {
    compositeDisposable.add(
        Observable.timer(2L, TimeUnit.SECONDS)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe {
              _state.value = (_state.value as AnimalDetailsViewState.AnimalDetails?)?.copy(adopted = true)
            }
    )
  }

,thank you so much :handshake:,

(Arctic Fox 2020.3.1 patch 4)
I have the project for chapter 11 configured as follows for Gradle at the project and app levels:

:kissing_heart: :kissing_heart: :kissing_heart: