Giter Club home page Giter Club logo

android-basics-kotlin-tip-calculator-app-solution's Introduction

Tip Calculator - Solution Code

Solution code for the Android Basics in Kotlin: Tip Calculator app.

Introduction

The Tip Calculator app contains various UI elements for calculating a tip, teaching about app structure, user input, and view binding.

Pre-requisites

  • Experience with Kotlin syntax.
  • How to create and run a project in Android Studio.

Getting Started

  1. Install Android Studio, if you don't already have it.
  2. Download the sample.
  3. Import the sample into Android Studio.
  4. Build and run the sample.

android-basics-kotlin-tip-calculator-app-solution's People

Contributors

geneandgoogle avatar jkcoolmom avatar kkuan2011 avatar osuleymanova 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

android-basics-kotlin-tip-calculator-app-solution's Issues

Android Basics: change-app-icon

URL of codelab

https://developer.android.com/codelabs/basic-android-kotlin-training-change-app-icon?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-change-app-icon#2

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

Step 3: Launcher Icons

Describe the problem

Under Explore Launcher Icons, the text of the tutorial says to click on the image file to see a preview. However, clicking isn't enough unless one has enabled "Open Files wIth Single Click". It would be more accurate to say that you need to open the image file in Android Studio to see the preview.

Also, the tutorial says to click on res > mipmap-xxhdpi > ic_launcher_round.png and to notice that the image is 192 x 192 pixels. However, the image is 142 x 142 pixels. The 192 x 192 image is in the res > mipmap-xxxhdpi folder

Steps to reproduce?

  1. Go to...res > mipmap-xxhdpi
  2. Click on...ic_launcher_round.png (or double click if needed to open)
  3. See error...The preview pane displays the size of the asset as 144x144, not 192x192

Versions
Android Studio version: 4.1.1
API version of the emulator: N/A

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: classes-and-inheritance

https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#4

Task 5

It is a very basic query regarding the floorArea function, which when we are using for roundTower, should have the formula, PIradiusradius, as the formula which is stated by you is valid for the volume, because it's unit is meter-cube, not meter-square, so either correct the formula or correct the name for function used.

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: Done/Next button is missing - change-app-icon

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-change-app-icon#8

In which task and step of the codelab can this issue be found?
Last step
9. Learn more

Describe the problem

"DONE" button missing

Steps to reproduce?
When i try to reproduce steps its work well but in new tub .

Versions
Android Studio version: 4.1
done_button
developer.android.com-1603404335200.log.log

bandicam 2020-10-23 00-55-03-926.zip

API version of the emulator:

Additional information

Microsoft Edge
Version 86.0.622.48 (Official build) (64-bit)

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#6

In which task and step of the codelab can this issue be found?
7. Summary

Describe the problem
The section that says "Use the super keyword to reference functions and properties in the parent class." is wrong. I did not use super keyword nor am I asked to use it during the Codelab lesson.

Steps to reproduce?

  1. Go to https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#6
  2. Click on 7.Summary section
  3. See error...

Versions
Android Studio version: 4.1.1
API version of the emulator: not relevant

Android Basics: xml-layouts

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-xml-layouts?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-xml-layouts#3

In which task and step of the codelab can this issue be found?
At the end of the page of step 4: Create XML layouts for Android

Describe the problem
Typo / copy and paste error:

In the last code-example:
"At this point, your XML should look like this."
The textview still has the copied id from the EditView (@+id/cost_of_service) instead of the before mentioned @+id/service_question

i know this is a very minimal issue, and considered before making this issue/report.
But when i notice issues like that, i always start to question the overall quality of the work that people put into something.
So i think it would be nice if it would be fixed, for the benefit of the people doing this course later.

:-)
and isn't it nice that so far no bigger issues came up?

best regards

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#4

In which task and step of the codelab can this issue be found?
Implement floorArea() for RoundTower
8
Note: For the area values, it would be a nicer user experience to only show a couple of decimal places. This is out of scope for this codelab, but you could print the floor area using this: println("%.2f".format(floorArea))
Describe the problem
println("%.2f".format(floorArea)) -> println("Floor area: %.2f".format(floorArea()))

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: xml-layouts

at https://developer.android.com/codelabs/basic-android-kotlin-training-xml-layouts?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-xml-layouts#5

-> Create XML layouts for Android -> 6. Complete the rest of the layout ->

You want the Switch to be as wide as the parent, so you might think the width should be set to match_parent. As noted earlier, you can't set match_parent on UI elements in a ConstraintLayout

info out-dated: is possible use match_parent in switches and buttons at least

Android Basics: polished-user-experience

https://developer.android.com/codelabs/basic-android-kotlin-training-polished-user-experience?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-polished-user-experience#4

Styles and Themes

I type this code in "@style/Widget.TipTime.CompoundButton.Switch" and got the red error text for the "@style/Widget.TipTime.CompoundButton.Switch", and I tried copying it direct but the result was same. Eventually, I tweaked it till it work and the resulting code I ended up with is "@style/Widget.TipTime.Switch". The codes seems fine but since am only learning, am sure it is right but wanted to highlight this in case some else gets stuck at that same exercise

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version: 4.1.1
API version of the emulator: 25
ThemesAndStyles

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#4

In which task and step of the codelab can this issue be found?
5. Modify classes in the hierarchy
Implement floorArea() for RoundHut

Describe the problem
"The floor area of a circular dwelling is 2 * PI * radius."
I think 2 * PI * radius is a circumference. The area is PI * radius * radius
Further in the code samples it is correct.

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#4

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

Describe the problem
typo: "The floor area of a circular dwelling is 2 * PI * radius." should be "PI * radius * radius" or "PI * radius2" (square)

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: tip-calculator

URL of codelab

URL

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

The problem is in the "Calculate the tip" task, step 4.

Describe the problem

This line:

binding.tipResult.text = getString(R.string.tip_amount, formattedTip)

doesn't work. This just sets binding.tipResult.text to simply "Tip Amount", and does not include formattedTip.

Steps to reproduce?
N/A? Or just follow the codelab.

Versions
Android Studio version: 4.0.1
API version of the emulator: 23

Additional information
I am a beginner in Kotlin and Android Studio but I think I've solved it.
getString() is supposed to convert an integer to string (I'm not really sure how, all I know is that R.string.tip_amount is an integer) but the codelab is trying to feed an integer and a string into it.

I've got it to work properly using this:

binding.tipResult.text = "${getString(R.string.tip_amount)} $formattedTip"

If you're curious, this is my strings.xml:

<resources>
    <string name="app_name">tip calculator</string>
    <string name="round_up_tip">Round up tip?</string>
    <string name="ok_15">OK (15%)</string>
    <string name="good_18">Good (18%)</string>
    <string name="amazing_20">Amazing (20%)</string>
    <string name="how_was_the_service">How was the service?</string>
    <string name="cost_of_service">Cost of Service</string>
    <string name="calculate">Calculate</string>
    <string name="tip_amount">Tip Amount</string>
</resources>

Android Basics: Progress not saved - tip-calculator

URL of codelab

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

Describe the problem
My Progress on the codelabs keeps getting refresh and logging me out of the developer page for some reason

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: classes-and-inheritance

URL of codelab

https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#4

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

Step 5, area of a circle

Describe the problem

You mention the area is 2 * PI * radius but then correct in the code block and say it's radius * radius * PI

See attached images
Screen Shot 2020-10-30 at 3 27 12 PM
Screen Shot 2020-10-30 at 3 27 05 PM

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: tip-calculator

URL:
https://developer.android.com/codelabs/basic-android-kotlin-training-tip-calculator?authuser=3&continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%3Fauthuser%3D3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-tip-calculator#2

Task and the Step:
Task: Adopting good coding practices
Step: Inspect the code

Problem:
According to the documentation in the Inspect Code Step of this task, an option starting with text "file..." should be there. But I couldn't find it in my android studio. Please refer the images below:

Documentation Image:
Documentation Image

Android Studio Image:
Android Studio Screenshot
Android Studio version: 4.1.1 for Windows 64-bit

Please help :)

Android Basics: change-app-icon

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-change-app-icon?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-change-app-icon#5

In which task and step of the codelab can this issue be found?
6 - Change the app icon

Describe the problem
Under "Move vector drawable files into -v26 directory
Depending on the min SDK of your app, you may notice that the background asset is located in the drawable-v24 folder, while the foreground asset is in the drawable folder. The reason is because the background asset contains a gradient, which was available starting in the Android 7.0 release (also known as API version 24, hence the -v24 resource qualifier). The foreground asset doesn't contain a gradient, so that can go in the base drawable folder."

The references to foreground and background have been switched. The foreground file is in the drawable-v24 folder and has a gradient. The background doesn't have a gradient.

Steps to reproduce?

  1. Go to... the URL given above and then to the "Move vector drawable files into -v26 directory" section
  2. Click on...
  3. See error...

Versions
Android Studio version: N/A
API version of the emulator: N/A

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?authuser=1#4

In which task and step of the codelab can this issue be found?
Step 5

Describe the problem
It's just a problem in the concept of circular area, you say: "The floor area of a circular dwelling is 2 * PI * radius" but the area is pi*r^2 and what you said is the perimeter... Probably it's just a minor mistake but I hope it helps to improve your course which so far is the best i have taken

Android Basics: change-app-icon

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-change-app-icon#5

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

   steps 4 and 5 in "Move vector drawable files into -v26 directory"

Describe the problem

   Description of steps 4 and 5 in "Move vector drawable files into -v26 directory" is incorrect

Steps to reproduce?

  1. Go to step 13(Confirm icon path..)

  2. zoom up picture below step 13,check the folder for foreground and background xmls.
    ic_launcher_background.xml - is in drawable-v24
    ic_launcher_foreground.xml - is in drawable

  3. go to step "Move vector drawable files into -v26 directory".

4 .steps 4 and 5 tells u that
ic_launcher_background.xml - is in drawable
ic_launcher_foreground.xml - is in drawable-v24
It should be vice versa(folders for launcher layers) in android studio its also vice versa.
icon layers folders
incorect_description

(Left click on the ic_launcher_background.xml file and drag it from the drawable folder into the drawable-anydpi-v26 folder. Recall that putting a resource in an "any dpi" directory indicates that it's a resource that can scale to any density.
Left click on the ic_launcher_foreground.xml and drag it from the drawable-v24 folder into the drawable-anydpi-v26 folder.)

Versions
Android Studio version: 4.1
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#4

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

in the NOTE:
Describe the problem

the line of code is missing the parenthesis for the floorArea funciton.

println("%.2f".format(floorArea))

it should be : println("%.2f".format(floorArea()))

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

image

Android Basics: change-app-icon

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-change-app-icon?authuser=1&return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%3Fauthuser%3D1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-change-app-icon#2

In which task and step of the codelab can this issue be found?
3.Launcher Icons

Describe the problem
"For example, this is what res > mipmap-xxhdpi > ic_launcher_round.png looks like. Also notice the size of the asset is in the top right. This image is 192px x 192px in size."

it is not the xxhdpi image it is the xxxhdpi image which is 192x192 big

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
Android Studio 4.1

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance#4

In which task and step of the codelab can this issue be found?
Under the Heading "Implement floorArea() for RoundHut, Line three, which says, "The floor area...."

Describe the problem
The formula written is 2PIradius, but here we are calculating area so it should be PIradiusradius.
It's correct in the code but statement is wrong. So it might mislead someone.

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#2

In which task and step of the codelab can this issue be found?
Section "Create an abstract Dwelling class"

  • Step 2 and 8

Describe the problem

Step 2 mentions deleting all code in the editor, while I believe it means just removing the println("Hello, world!") part inside main()

Step 8 asks us to put code inside main() which may have been deleted due to the way Step 2 is written

Steps to reproduce?
Read step 2, then proceed with next steps until step 8

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%3Fhl%3Den%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance&hl=en#4

In which task and step of the codelab can this issue be found?
Implement floorArea() for RoundHut

Describe the problem
The floor area of a circular dwelling is 2 * PI * radius.

I think this is the formula for circumference rather than area. Maybe PI* radius * radius or similar is the area?

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: tip-calculator

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-tip-calculator?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-tip-calculator#3

In which task and step of the codelab can this issue be found?
val stringInTextField = binding.costOfService.text.toString()

Describe the problem
Well its not that big issue but it would be nice to have a check the input value before calculating the Tip. I have added the below code just after getting the text from Cost of Service which will prevent the app from crash.

if (stringInTextField.isEmpty()){
            val toast = Toast.makeText(this,"Please enter cost of service!",Toast.LENGTH_SHORT)
            toast.show()
            return
        }

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#4

In which task and step of the codelab can this issue be found?
In task 5 . Modify classes in the hierarchy and Implement floorArea() for RoundHut step

Describe the problem
Just a minor "typo"
You write in the 3rd line that the area of a circle is 2PIR, while its PI * R ^2.

In the code you use you the correct formula, but not when you explain what to do

Android Basics: tip-calculator

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-tip-calculator?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-tip-calculator#7

In which task and step of the codelab can this issue be found?
8. Summary

Describe the problem
Mistype in attribute name: checkRadioButtonId instead of checkedRadioButtonId

Steps to reproduce?

  1. Go to URL of codelab
  2. Click on line: "Use the checkRadioButtonId attribute of a RadioGroup to find which RadioButton is selected"
  3. See erro.

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: change-app-icon

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-change-app-icon

In which task and step of the codelab can this issue be found?
"Move vector drawable files into -v26 directory"

Describe the problem
"Move vector drawable files into -v26 directory" section has dubious instructions and references options that do not exist where stated.

Steps to reproduce?
Step 1 of this section says, "First create the drawable-anydpi-v26 directory. Right click on the res folder. Select New > Android Resource Directory."
Step 2 says, "A prompt will appear. Select these options:
Resource type: drawable (Select from dropdown)

Directory name: drawable-anydpi-v26

Source set: main (leave as default)"

A prompt does appear, but there's no option or heading labeled "Source set".

Step 3, "Click OK. In the Project view, verify the new resource directory res > drawable-anydpi-v26 has been created."

Skipping the "Source set" stuff and clicking OK does not result in a new resource directory "res > drawable-anydpi-v26". It instead makes a directory "res > drawable > drawable-anydpi-v26"

Versions
Android Studio 4.1.1
Build #AI-201.8743.12.41.6953283, built on November 4, 2020
Runtime version: 1.8.0_242-release-1644-b3-6222593 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.4.58-07649-ge120df5deade
GC: ParNew, ConcurrentMarkSweep
Memory: 1246M
Cores: 4
Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin
Current Desktop: Undefined

Additional information

Android Basics: polished-user-experience

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-polished-user-experience?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-polished-user-experience&authuser=1#4

In which task and step of the codelab can this issue be found?
Create Styles
Step-7
the RadioButton Style:

<style name="Widget.TipTime.CompoundButton.RadioButton" parent="Widget.MaterialComponents.CompoundButton.RadioButton"> 8dp ?attr/textAppearanceBody1 </style>

Describe the problem

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: change-app-icon

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-change-app-icon?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-change-app-icon#2

In which task and step of the codelab can this issue be found?
3. Launcher Icons
Step 4

Describe the problem
This is the current text:
For example, this is what res > mipmap-xxhdpi > ic_launcher_round.png looks like. Also notice the size of the asset is in the top right. This image is 192px x 192px in size.

Miss an x for res folder or change the size image to 144 x 144

Android Basics: polished-user-experience

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-polished-user-experience?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-polished-user-experience#5

In which task and step of the codelab can this issue be found?
Step 6

Describe the problem
The 4th paragraph of the section (Optional) Adjust the tint of the vector drawables has a typo:
One visual enhancement we can make to the app is to tint the drawable based on the primary color of the app theme. BFor light theme, the icon will appear...

The typo is as seen Before, "Bfor".

Steps to reproduce?

  1. Go to the codelab.
  2. Click on the 6th step
  3. See error on 4th paragraph of the section (Optional) Adjust the tint of the vector drawables section.

Versions
Android Studio version: N/A
API version of the emulator: N/A

Additional information
image

Android Basics: tip-calculator

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-tip-calculator?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-tip-calculator#3

In which task and step of the codelab can this issue be found?
Google Developer course to learn build and program an android apps. In unit 2: Layouts, Calculate the Tip codelab.

Describe the problem
_ I found a difference between the two showing. In codelab they ask me to put this Code:

class MainActivity : AppCompatActivity() {

lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    binding = ActivityMainBinding.inflate(layoutInflater)
    setContentView(binding.root)
    binding.calculateButton.setOnClickListener{ calculateTip() } 
}

fun calculateTip() {

}

}

but when I put it into Android Studio I found this wrong alert as this screenshot. And there's no any guidance in the codelab shows that I could find an issue as usual

So. What should I do?_

Versions
Android Studio version: 4.1.1

Additional information
A screenshot
2020-12-04 (1)

Android Basics: classes-and-inheritance

URL of codelab

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

Describe the problem

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: polished-user-experience

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-polished-user-experience?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-polished-user-experience#5

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

(Optional) Adjust the tint of the vector drawables

Describe the problem
Typo in text

Steps to reproduce?

  1. Go to... (Optional) Adjust the tint of the vector drawables
  2. In text bellow Grey bell image
  3. See error...

Versions
Android Studio version: 4.1
typo

API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: tip-calculator

URL of codelab

https://developer.android.com/codelabs/basic-android-kotlin-training-tip-calculator?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-tip-calculator#2

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

Enable View Binding

Describe the problem

I was receiving an error and realized it's because I'm not running AS 4.0+. You may want to add a note about this issue for versions sub 4

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#4

In which task and step of the codelab can this issue be found?
Implement floorArea() for RoundHut: Description

Describe the problem
Mentioned formula in the description is wrong but used in step 2 is right

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: classes-and-inheritance

Classes and inheritance in Kotlin
5. Modify classes in the hierarchy
Implement floorArea() for RoundHut

(...)
The floor area of a circular dwelling is 2 * PI * radius.
(...)

area is wrong: instead 2 * PI * radius, is PI * radius * radius

Android Basics: Done/Next button is missing xml-layouts

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-xml-layouts?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-xml-layouts#10

In which task and step of the codelab can this issue be found?
11. Practice on your own

Describe the problem
At the End there is no DONE button. I've tried to do it with other browser and none was able to show me the button (chrome & firefox), in Fedora 32

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.
image

Android Basics: tip-calculator

https://developer.android.com/codelabs/basic-android-kotlin-training-tip-calculator?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%3Fhl%3Den%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-tip-calculator&hl=en#3

almost at the very end, when you need to start the application for testing, a piece of code does not work: "binding.tipResult.text = getString (R.string.tip_amount, formattedTip)"

I did everything according to the instructions. The moment has come for testing the application. I started it all worked, entered the text into the "EditText" and clicked "Calculate", but some of the code did not work correctly. I had to replace this code: "binding.tipResult.text = getString (R.string.tip_amount, formattedTip)" like this: "binding.tipResult.text = getString (R.string.tip_result_text) +" "+ formattedTip" and it worked correctly.

Безымянный

Steps to reproduce?

  1. launch and debug
  2. Click on Calculate
  3. the compiler gives no errors

Versions
Android Studio version: 4.0.2
API version of the emulator: I don't know where to look at it :(

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#4

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

The floor area of a circular dwelling is 2 * PI * radius.

Describe the problem

The formula show for the area is incorrect, 2PIradius it should be PI * radius * radius

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: tip-calculator

URL of codelab Here

In which task and step of the codelab can this issue be found?
CALCULATE TIP - STEP 3 (VIEW BINDING)

Describe the problem
Following through the steps, while initializing the binding object. I am required to replace all existing code in the MainActivity.kt file with the provided code snippet which didn't include defining package com.example.tiptime, which later caused an error in the activity_main.xml causing the App to crash.

Steps to reproduce?

  1. Just include package com.example.name which in my case package com.example.tiptime at the very top of the MainActivity.kt file.

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance#4

In which task and step of the codelab can this issue be found?
Step 3), when we update the constructor to pass the radius we used: val radius; Int, but also modified the line for the residents, I think we should add the "val' in front of residents because it comes from the abstract class

Describe the problem

I think is not necessary to have the 'val', I run the code with out it and it runs, not problem.

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.
image

Android Basics: polished-user-experience

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-polished-user-experience?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-polished-user-experience#3

In which task and step of the codelab can this issue be found?
Android Basics Kotlin Unit 2 Pathway 1
Create a More Polished User Experience
Section 4 Icons
Step 6

Describe the problem
The code snippit says:

`

<TextView
    android:id="@+id/service_question"
    ...
    android:layout_marginTop="16dp"
    app:layout_constraintStart_toEndOf="@id/icon_service_question" />

`

Specifically app:layout_constraintStart_toEndOf="@id/icon_service_question" is the main point of interest

Based on https://github.com/google-developer-training/android-basics-kotlin-tip-calculator-app-solution/blob/main/app/src/main/res/layout/activity_main.xml#L73, I believe it should be

<TextView android:id="@+id/service_question" ... android:layout_marginTop="16dp" app:layout_constraintStart_toStartOf="@id/cost_of_service" app:layout_constraintTop_toBottomOf="@id/cost_of_service"/>

Prior to looking up the solution by jumping ahead to the solution code, I was unable to get the TextView's left side to align with the Material TextInputLayout above it; the TextView would be on top of the icon.

Steps to reproduce?
Follow the codelabs tutorial.

Versions
N/A

Additional information

Codelabs: Formatting Issue on Mobile Device

URL of codelab
Any codelab page. Needs to be on mobile device.

Example: https://developer.android.com/codelabs/basic-android-kotlin-training-change-app-theme?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-change-app-theme#2

Describe the problem
This isn't specific to any single codelab; it applies to all of them.

When viewing using Chrome 86.0.4240.185 on my Pixel 2, the "Next" and "Back" buttons are cut off almost entirely. It's as if the android bar with the triangle (back), circle (home), and square (recent apps) is not accounted for and it overlays on top of the "Back" and "Next" buttons in codelab. See screenshot attachment.

I am viewing using the mobile view. If I select "Use desktop view" in Chrome, the buttons are not visible at all.

Steps to reproduce?

  1. Navigate to a codelab page (i.e. the actual module with the steps on the left side) in Chrome on a Pixel 2 (suspect any mobile device will work).

Versions
Chrome 86.0.4240.185
Pixel 2

Additional information
See screenshots
Screenshot_20201116-054316
Screenshot_20201115-214710

Android Basics: change-app-theme

URL of codelab

https://developer.android.com/codelabs/basic-android-kotlin-training-change-app-theme?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-change-app-theme#2

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

Step 3: Themes | Separate Styles from Themes

Describe the problem

You do not need to do the steps in this section if you are using Android 4.1 or later

Not an issue but an interesting point. I updated my AS with my TipTime project already created and though I'm on AS 4.1, my themes.xml didn't appear because when I created the project I was on 3.6.

You may want to mention this in case other users update midway, though I also recognize this is probably an edge case 🤷‍♂️

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: classes-and-inheritance

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-classes-and-inheritance?return=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-2-pathway-1%3Fhl%3Den%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-classes-and-inheritance&hl=en#4

In which task and step of the codelab can this issue be found?
Step 5: Modify Classes in the Hirearchy -> Implement floorArea() for RoundHut

Describe the problem
It's written "The floor area of a circular dwelling is 2 * PI * radius." which is incorrect. The formula is for calculating the circumference of a circular dwelling rather than the area.

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

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.