Git Product home page Git Product logo

android-kotlin-fundamentals-apps's Introduction

Caution: This course is out of date and no longer maintained. Instead, please refer to the Android Basics with Compose course for the latest recommended practices. If you are looking for content on Views, you can check out the Android Basics in Kotlin course.

Android Fundamentals in Kotlin Solution Apps

This repository contains the solution code for the apps for the Android Fundamentals in Kotlin course, published by the Google Developer Training Team. See Android Training.

A “solution app” is an app that contains the code for a completed codelab.

Code for the starter apps in this course are in a different repository.

Introduction

Each of the samples in this repository is associated with a codelab exercise from the Android Fundamentals in Kotlin course.

The Android Fundamentals in Kotlin course can be used for self-study, or as the basis of an instructor-led training. It is targeted towards beginning Android developers with a background in software development or computer science with at least two years of experience with a modern, object-oriented programming language, such as the Java programming language, and familiarity with basic software architecture principles.

Since this course is in Kotlin, it is assumed you know Kotlin at the level taught in the Udacity course, Kotlin Bootcamp for Programmers.

Pre-requisites

The samples, along with the course, assume basic competence in software design and development, as well as some background in computer science.

Specifically, to get started you need:

  • Familiarity with the general software development process for object-oriented applications using an IDE (Integrated Development Environment).
  • At least 1-3 years of experience with object-oriented programming and the Java programming language, or a comparable modern language.
  • Familiarity with the Kotlin programming language.

Android Studio Version

During development of this course, all samples were built using Android Studio 3.3, and the codelabs assume you are using Android Studio 3.3 with corresponding libraries and available features. See the Android Studio download page for details.

Getting Started

  1. Install Android Studio, if you don't already have it. (If you are just starting the course, you will be guided through this process.)
  2. Download the starter sample for the codelab.
  3. Open the sample into Android Studio.
  4. Build and run the sample. You may need to update gradle and library versions. Follow the guidance provided by Android Studio.

android-kotlin-fundamentals-apps's People

Contributors

android-dev-lxl avatar geneandgoogle avatar jkcoolmom avatar jlulovics avatar lmoroney avatar owenscott-gds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-kotlin-fundamentals-apps's Issues

Android Kotlin Fundamentals codelab: GridLayoutManager.VERTICAL should be HORIZONTAL

Describe the problem

mistake

In the last paragraph where this text written:

  1. Change the span count to 5 and the direction to GridLayoutManager.VERTICAL.

The VERTICAL in the text is a mistake, it must be HORIZONTAL like as the written text and code after it.

In which lesson and step of the codelab can this issue be found?
Lesson 7.3 + task 4 + step 2.

How to reproduce?
Instead of incorrect VERTICAL it must be HORIZONTAL like as following:

  1. Change the span count to 5 and the direction to GridLayoutManager.HORIZONTAL

codelab: android-kotlin-fundamentals

1.1 Get started: Change com.example.hello.helloworld -> com.example.android.helloworld

Describe the problem
A clear and concise description of what the problem is.
There is simple typo in the description.

In which lesson and step of the codelab can this issue be found?
Lesson number + step number.
Android Kotlin Fundamentals 01.1: Get started
step 2

How to reproduce?
What are the exact steps to reproduce the problem?

change line "The com.example.hello.helloworld (or the domain name you have specified) folder contains all the files for an app package."
to
"The com.example.android.helloworld (or the domain name you have specified) folder contains all the files for an app package.

com.example.hello.helloworld -> com.example.android.helloworld

Versions

  1. What version of Android Studio are you using?
    3.5
  2. What API level are you targeting?
    4.4 kitkat

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab:

Describe the problem
'View attributes' section:

The android:layout_width and android:layout_height attributes indicate the weight and height of a view.

weight is width ??

In which lesson and step of the codelab can this issue be found?
Lesson number + step number.
Android Kotlin Fundamentals 01.2: Basic app anatomy
https://codelabs.developers.google.com/codelabs/kotlin-android-training-app-anatomy/#7

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
    3.5
  2. What API level are you targeting?
    29

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

1.3 Image resources and compatibility - toolsSrc doesn't show placeholder dice image

Describe the problem

Once Jetpack library is enabled and configured to add support for vector images, tools:src no longer shows the placeholder

In which lesson and step of the codelab can this issue be found?

Android Kotlin Fundamentals 01.3: Image resources and compatibility - Step 6

How to reproduce?

  • Add a placeholder in a ImageView
  • Configure Jetpack as mentioned
  • Once added app:srcCompat="@drawable/empty_dice" in ImageView the placeholder disappear

Versions

  1. What version of Android Studio are you using?
Android Studio 3.6.1
Build #AI-192.7142.36.36.6241897, built on February 26, 2020
Runtime version: 1.8.0_212-release-1586-b4-5784211 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.3.0-40-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 1981M
Cores: 8
Registry: ide.new.welcome.screen.force=true
Non-Bundled Plugins: 
  1. What API level are you targeting? 29

Additional Information

Screenshot from 2020-03-04 00-59-50

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab: 05.2 Strange arrange about Observer

Describe the problem
The codelab introduces observer pattern on task 7 but we've already used it in task 5.
This arrangement seems strange to me, maybe we could put it out a little bit earlier?

In which lesson and step of the codelab can this issue be found?
05.2 task 5 and task 7

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab:

Describe the problem
await missing

In which lesson and step of the codelab can this issue be found?
Lesson 08.1.6 - Step 2.11

How to reproduce?

private fun getMarsRealEstateProperties() {
   coroutineScope.launch {
       var getPropertiesDeferred = 
          MarsApi.retrofitService.getProperties()
       try {          
           // This instruction is missing: var listResult = getPropertiesDeferred.await()
           _response.value = 
              "Success: ${listResult.size} Mars properties retrieved"
       } catch (e: Exception) {
           _response.value = "Failure: ${e.message}"
       }
   }
}

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab: Update safeargs plugin

Describe the problem
Adding the safe args dependency to the project gradle file using the following declaration stated in the document fails due to not finding the dependency:
classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"
Instead, the following line works:
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"

In which lesson and step of the codelab can this issue be found?
03-3 Step 2

How to reproduce?
Add classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:$navigationVersion" to project gradle file

Versions
3.5
19

Additional information

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab:

Describe the problem
A clear and concise description of what the problem is.
The code lab refers to "main_activity.xml" which for some reason is "activity_main.xml" in android Studio 3.6.1

In which lesson and step of the codelab can this issue be found?
Android Kotlin Fundamentals 01.3: Image resources and compatibility
Step 3: Add compatibility for vector drawables

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using? 3.6.1
  2. What API level are you targeting?
    targetSdkVersion 28

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

How to fix KotlinNullPointerException in LiveData when attempting to get a value (DevBytesRepository)

In my application, the condition: if (playlist.value!!.IsEmpty()) causes a kotlin.KotlinNullPointerException.

class DevByteViewModel(application: Application) : AndroidViewModel(application) {
    
    ...
    
    val playlist = videosRepository.videos
    
    ...
    
    init {
        refreshDataFromRepository()
    }
    
    ...
    
     /**
     * Refresh data from the repository. Use a coroutine launch to run in a
     * background thread.
     */
    private fun refreshDataFromRepository() {
        viewModelScope.launch {
            try {
                videosRepository.refreshVideos()
                _eventNetworkError.value = false
                _isNetworkErrorShown.value = false

            } catch (networkError: IOException) {
                // Show a Toast error message and hide the progress bar.
                if(playlist.value!!.isEmpty())
                    _eventNetworkError.value = true
            }
        }
    }
}

The fact is,

  1. Asynctask is running on another thread in background asynchronously
  2. Livedata is working like floating over database to see the changes.

So it takes time to accomplish the fetch operation for Asyntask. I want to understand how to avoid it. Thanks.

Android Kotlin Fundamentals codelab:

Describe the problem
A clear and concise description of what the problem is.
Android Kotlin Fundamentals 04.2: Complex lifecycle situations

In which lesson and step of the codelab can this issue be found?
Lesson number + step number.
Step 2: Modify MainActivity
Remove the call to startTimer() in onStart() not
remove the call to startTimer() in onCreate()
end of issue
How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

2.3 Describe more about dimens.xml file

Describe the problem
The codelab asks the learner to open "res/values/dimens.xml", yet there is no dimens.xml file by default. A section on how to create the dimens.xml file would be useful.
In which lesson and step of the codelab can this issue be found?
02.3, Task 5, Step 2: Add a style.

How to reproduce?
No steps are required to reproduce.
Versions
I am using version 3.5.3, and targeting API 27.

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab: highlight mistakes

Describe the problem
The position of the code highlight seems to be slightly different.

[Wrong]
findViewById<Button>(R.id.done_button) ⇒ binding.doneButton

[Correct]
findViewById<Button>(R.id.done_button) ⇒ binding.doneButton

In which lesson and step of the codelab can this issue be found?
Android Kotlin Fundamentals 02.4: Data-binding basics
6. Summary

Thank you.

2.1 Typo in MainActivity.kt file name

Describe the problem
Wording mistake

In which lesson and step of the codelab can this issue be found?
Lesson : Android Kotlin Fundamentals 02.1: Linear layout using the Layout Editor
Step: 3. Task: Create the AboutMe Project

How to reproduce?
Always : At the end of this step, it is mentioned "Mainactivity.kt" or it must be "MainActivity.kt"

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab: 08.2: Loading and displaying images from the internet

Describe the problem
A clear and concise description of what the problem is.
Databinding is not working.
In which lesson and step of the codelab can this issue be found?
Lesson number + step number.
8.2 + 4

How to reproduce?
What are the exact steps to reproduce the problem?
Just changed FragmentOverviewBinding to GridItemBinding as mentioned in codelab na dgot this error. After multiple clean and build also not helping here

Versions

  1. What version of Android Studio are you using?
    3.6
  2. What API level are you targeting?
    28

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab:

Describe the problem
A clear and concise description of what the problem is spelling error.

In which lesson and step of the codelab can this issue be found?
Android Kotlin Fundamentals 01.3: Image resources and compatibility
Step 1. Welcome
First line under What you'll do.

How to reproduce?
https://codelabs.developers.google.com/codelabs/kotlin-android-training-images-compat/#0

Additional information
I believe it's dice instead of "die".

codelab: android-kotlin-fundamentals

06.2 ViewModelProviders is deprecated

similar to #29

Describe the problem
The ViewModelProviders is deprecated, use ViewModelProvider directly.

In which lesson and step of the codelab can this issue be found?

06.2 Task 4 and probably every paragraph after that

Additional information

Replace every occurrence of

val sleepTrackerViewModel =
       ViewModelProviders.of(
               this, viewModelFactory).get(SleepTrackerViewModel::class.java)

to

val sleepTrackerViewModel =
       ViewModelProvider(
               this, viewModelFactory).get(SleepTrackerViewModel::class.java)

codelab: android-kotlin-fundamentals

7.5 Typo in name of layout to be inflated, should be header.xml

Describe the problem

Capture2

The textview.xml that specified with a red rectangle, must be header.xml.

In which lesson and step of the codelab can this issue be found?
Lesson 07.5 + task 4 + step 2.

How to reproduce?
Change as the following: textview.xml => header.xml

codelab: android-kotlin-fundamentals

Omission of variable in code.

Describe the problem
I want to say a big thank you to you guys for the good job. My observation is a simple "Variable Omission", noticed in one of the codes (second to the last code in "Android Kotlin Fundamentals 08.1: Getting data from the internet" to be precise). Kindly find the screenshot attached.
Once again, I say: thank you!

In which lesson and step of the codelab can this issue be found?
https://codelabs.developers.google.com/codelabs/kotlin-android-training-internet-data/index.html?index=..%2F..android-kotlin-fundamentals#5

kotlin-android-training-internet-data
kotlin-android-training-internet-data

Android Kotlin Fundamentals codelab: 05.4: Linked to deprecated source

Describe the problem
The document which Transformations.map() linked to has been deprecated.
use anrdoid.x instead of android.arch package

In which lesson and step of the codelab can this issue be found?
05.4 task 5, first link
Screenshot from 2020-02-11 13-44-24

How to reproduce?
Just click the url

Additional information

Change the URL from https://developer.android.com/reference/android/arch/lifecycle/Transformations.html#map%28android.arch.lifecycle.LiveData%3CX%3E,%20android.arch.core.util.Function%3CX,%20Y%3E%29
to
https://developer.android.com/reference/androidx/lifecycle/Transformations.html#map(androidx.lifecycle.LiveData%3CX%3E,%20androidx.arch.core.util.Function%3CX,%20Y%3E)

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab: 05.2: variable name inside `onCorrect` function

Describe the problem

The variable name of the sample code is wrong

fun onCorrect() {
   _score.value = (_score.value)?.plus(1)
   nextWord()
}

since we doesn't introduce the encapsulation of LiveData until the section 6 of 05.2, we should use score in stead of _score as its variable name.

So the correct function should look like this:

fun onCorrect() {
   score.value = (score.value)?.plus(1)
   nextWord()
}

In which lesson and step of the codelab can this issue be found?
05.2 +Step 2 (2. fun onCorrect)

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

03.1.4 step 1 create a binding object - Fix wording for DataBindingUtil.inflate()

Describe the problem
Is the phrase in 03.1.4 step 1 create a binding object point 2
correct, or should we
Change : To inflate the fragment's view, call the DataBindingUtil.inflate() method on the fragment's Binding object, which is FragmentTitleBinding.
To : To inflate the fragment's view, call the DataBindingUtil.inflate() method which returns a Binding object, which is a FragmentTitleBinding.

In which lesson and step of the codelab can this issue be found?
03.1.4 step 1

Additional information
unrelated side note: I found it confusing that in the starter lab we are creating a fragment with id gameOverFragment, but there is also an imageview in the fragment's xml file with the same id.

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab:

Describe the problem

mistake3

You missed the following line of code at the first line of try block as marked in the picture:

val listResult = getPropertiesDeferred.await()

In which lesson and step of the codelab can this issue be found?
Lesson 8.1 + task 6+ step 2.

How to reproduce?
Just add the following code to the first line of the try block:

val listResult = getPropertiesDeferred.await()

The complete getMarsRealEstateProperties() method now looks like this:

private fun getMarsRealEstateProperties() {
   coroutineScope.launch {
       var getPropertiesDeferred = 
          MarsApi.retrofitService.getProperties()
       try {          
           val listResult = getPropertiesDeferred.await()
           _response.value = "Success: ${listResult.size} Mars properties retrieved"
       } catch (e: Exception) {
           _response.value = "Failure: ${e.message}"
       }
   }
}

Additional information
Link: https://codelabs.developers.google.com/codelabs/kotlin-android-training-internet-data/#5

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab: 02.3: Constraint layout using the Layout Editor

Describe the problem
A clear and concise description of what the problem is.

  1. wrong description
  • Change the vertical bias of the yellow_button to 100, to drop down the buttons to the bottom of the layout.
    -> Change the vertical bias of the yellow_button to 1.0, to drop down the buttons to the bottom of the layout.
  1. hard coding margin
<Button
   android:id="@+id/green_button"
   ...
   android:layout_marginEnd="16dp"
   ...
   app:layout_constraintStart_toEndOf="@+id/yellow_button" />
<Button
   android:id="@+id/green_button"
   ...
   android:layout_marginEnd="@dimen/margin_wide"
   ...
   app:layout_constraintStart_toEndOf="@+id/yellow_button" />

In which lesson and step of the codelab can this issue be found?
Lesson number + step number.
02.3: Constraint layout using the Layout Editor

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

4.1: Lifecycles and logging fundamentals: Change method signature of Fragment onAttach()

Describe the problem
I needed to modify code in the instructions after pasting

In which lesson and step of the codelab can this issue be found?
04.1 step 6

How to reproduce?
use:
override fun onAttach(context: Context?) {
to correct change to:
override fun onAttach(context: Context) {

Versions

  1. What version of Android Studio are you using? 3.6.1
  2. What API level are you targeting? 29

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab: 02.4: Data-binding basics

Describe the problem
A clear and concise description of what the problem is.

  • Typo
    • 4 Task: Use data binding to display data
    • Step 4: Use the data class for the nickname in the TextView
      1. In ActivityMain
        -> 3. In MainActivity

In which lesson and step of the codelab can this issue be found?
Lesson number + step number.
02.4: Data-binding basics, 4, step 4

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab:

Describe the problem
ViewModelProviders.of is deprecated

In which lesson and step of the codelab can this issue be found?
Android Kotlin Fundamentals 05.1: ViewModel and ViewModelFactory Step 8

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab: Android Kotlin Fundamentals 08.2: Loading and displaying images from the internet

Describe the problem
A clear and concise description of what the problem is.
When trying to follow steps for generating ImageURI as mentioned in the line

val imgUri = imgUrl.toUri().buildUpon().scheme("https").build()

got error in toUri() method. Below is the error message

Cannot built bytecode embed to JVM 1.8 target

In which lesson and step of the codelab can this issue be found?
Lesson number + step number.
8.2 + 3

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
    Android Studio 3.6 and VM is OpenJDK 64 bit server
  2. What API level are you targeting?
    28

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

2.4 Data binding basics: Specify directory java/com/example/android/aboutme

Describe the problem
Wrong description of target folder when declaring a new kotlin file MyName.kt.

In which lesson and step of the codelab can this issue be found?
02.4: Data-binding basics - 4. Task: Use data binding to display data - Step 1: Create the MyName data class

How to reproduce?
註解 2020-02-21 213937

Versions

  1. 3.5.3
  2. 23

Additional information
No

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab:

Describe the problem
A clear and concise description of what the problem is.
Inside getMarsRealEstateProperties() method, the following line is missing in the try block
var listResult = getPropertiesDeferred.await()

In which lesson and step of the codelab can this issue be found?
Lesson number + step number.
Android Kotlin Fundamentals 08.1: Getting data from the internet + 6

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab:

Describe the problem

mistake1

When you define companion object and the from() method, you must change the primary constructor's accessibility level to private.

In which lesson and step of the codelab can this issue be found?
Lesson 07.5, task 4, step 2

How to reproduce?
The TextViewHolder class definition must be as following:

class TextViewHolder private constructor(view: View): RecyclerView.ViewHolder(view) {
          // Your code
}

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab:

Describe the problem
According to the latest view model version, should be using ViewModelProvider()

In which lesson and step of the codelab can this issue be found?
Android Kotlin Fundamentals 05.1: ViewModel and ViewModelFactory, Step 5

How to reproduce?
Change ViewModelProviders.of() to ViewModelProvider() with the latest view model version

Versions

  1. What version of Android Studio are you using? 3.5
  2. What API level are you targeting? 29

Additional information
Nice course by google, anyway, I very enjoy playing this codelab

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab:

Describe the problem
Type mismatch: inferred type is Int but Drawable! was expected
image

In which lesson and step of the codelab can this issue be found?
lesson 01.3 : step 5

How to reproduce?
Just following the steps.

Versions

  1. Android Studio 3.5.3
  2. API 28

Additional information
Solution: using diceImage.setImageDrawable(resources.getDrawable(drawableResource, applicationContext.theme))

codelab: android-kotlin-fundamentals

Code does not compile with AS 3.5.1

In function makeColored (in MainActivity.kt) the variables box_three_text, box_four_text, and box_five_text are undefined. This is not a problem in AS 3.6 with view binding, but in AS 3.5.1 (the latest stable release) this gives a compile-time error.

8.1 Getting data from the internet - missing code - var listResults = getPropertiesDefered.await()

Describe the problem
In the final implementation of the getMarsRealEstateProperties() , the one that show the final version:
This one:
private fun getMarsRealEstateProperties() {
coroutineScope.launch {
var getPropertiesDeferred =
MarsApi.retrofitService.getProperties()
try {
_response.value =
"Success: ${listResult.size} Mars properties retrieved"
} catch (e: Exception) {
_response.value = "Failure: ${e.message}"
}
}
}

You forget to add the listResults value , like this
private fun getMarsRealEstateProperties() {
coroutineScope.launch {
var getPropertiesDefered = MarsApi.retrofitService.getProperties()
try {
// This is not added to the example code
var listResults = getPropertiesDefered.await()
_response.value = "Success: ${listResults.size} Mars properties retrieved"
} catch (e: Exception){
_response.value = "Failure: ${e.message}"
}
}
}

In which lesson and step of the codelab can this issue be found?
https://codelabs.developers.google.com/codelabs/kotlin-android-training-internet-data/#5

9.2: WorkManager - Worker result SUCCESS for Work [...] is not displayed

Describe the problem
Running the project DevBytesWorkManager does not execute RefreshDataWorker class
Log: I/WM-WorkerWrapper: Worker result SUCCESS for Work [...] is not displayed

In which lesson and step of the codelab can this issue be found?
09.2: WorkManager

How to reproduce?
Run the project and check the logcat for the message : I/WM-WorkerWrapper: Worker result SUCCESS for Work [...] which will not be found

Versions

  1. Android Studio 3.5.3
  2. Tried with API level 28 & 28

Additional information
I tried both Workmanager version 1.0.1as per codelab and latest 2.3.2 its not working

codelab: android-kotlin-fundamentals

01.2 basic app anatomy remarks

Proposed changes

  • task 4, Step 5 second bullet:

from: The setOnClickHandler() method, which connects the Button to the handler method.
to; The setOnClickListener() method, which connects the Button
to the handler method.

  • task 5, step 2, end of first paragraph

from: The task of generating a random number isn't Android-specific, and you use the Random class to do it.
to; The task of generating a random number isn't Android-specific, and you use the random() function on the range to do it.

Thanks a lot for the great course!
Hope this is the correct location to provide feedback (the course does not give a pointer to an appropriate feedback location)
Keep up the good work!

Android Kotlin Fundamentals codelab: Android Kotlin Fundamentals 05.1: ViewModel and ViewModelFactory

Describe the problem
The code used to initialise the ViewModel is depreciated.
viewModel = ViewModelProviders.of(this).get(GameViewModel::class.java)

In which lesson and step of the codelab can this issue be found?
Android Kotlin Fundamentals 05.1: ViewModel and ViewModelFactory

This code seems to work
viewModel = ViewModelProvider(this).get(GameViewModel::class.java)

Refer to StackOverflow:
https://stackoverflow.com/questions/53903762/viewmodelproviders-is-deprecated-in-1-1-0

How to reproduce?
ViewModelProviders

Enter the code into Android Studio

Versions

  1. What version of Android Studio are you using? 3.5.3
  2. What API level are you targeting?
    Min: 19
    Max: 28

Additional information
Add any other context about the problem here.

codelab: android-kotlin-fundamentals

Android Kotlin Fundamentals codelab:

There is a typo in an end-of-section questionnaire as shown below:

"What else do you need to do so that when the user taps the Show headlines button, the app navigates to the ShowHeadlinesFragment?"

It should have been HeadlinesFragment instead of ShowHeadlinesFragment

The issue can be found at:
Lesson number: 03.2 + Step number: 14 + Question: 6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.