---
# System prepended metadata

title: Learning Diary 2
tags: [fh, MAD]

---

###### tags: `fh` `MAD`
# Learning Diary 2
## Layouts + Data Binding


Please watch Lesson 2 of the Udacity Course "Developing Android Apps with Kotlin" and implement the example App from the course. Answer the following questions and submit this document as your learning diary 2.

## Udacity Course "Developing Android Apps with Kotlin", Lesson 2 (1/2)

1. Explain the terms View, ViewGroup and Layout? (1 point)
* **View:** Is a term that is used to generally takl about Text, Images, Check Boxes, Radio Buttons, Prograss Bars or Buttons of a application.
* **ViewGroup:** A ViewGroup is responsible for holding multiple views or other viewgroups on the screen and specify their positions.
* **Layout:** The layout defines how the finished app will actually look like on the screen of you smart device. There are many different kinds of layouts like the "linear layout" or "constrained layout" for example. Every layout is build hierarchical and can contain other layouts as well as viewgroups and views.

2. What is the purpose of Data Binding in Android? (1 points)
The main purpose of data binding is to minimize the way we play with our views in our activity. In this sense, all views manipulation should be handled in the layout files rather than the activity thus making your layout alive. This is to reduce multiple redundant codes and non-logical codes present by removing UI framework calls in the activities.

3. Please document step-by-step your implementation of the example App from the course. Include screenshots as well as reflections on your main learnings and major difficulties (4-7 screenshots, 500-1.000 words of text)
(3 points)

Coding the app wasn't realy hard since the guide was step by step. It got tricky at some places with following the instructions since 
a) the instructor used a different/older version of the development environment than we do and 
b) also because he worked realy fast at some points.
Here is a picutre of the running app shortly before concluding the databinding parts:

![](https://i.imgur.com/fM6WTfE.png)

After that i had some troubles with the databinding part at the end since the app wouldn't run due to the following error 

![](https://i.imgur.com/bUnJLUB.png)

and wasnt able to run the app. If you could help me fix that at some point that would be apriciated because i googled/stack-overflowed it and couldn't fix it even tho i found some entrys.
There are some screenshots of the relevant code parts:

![](https://i.imgur.com/pmW3Zul.png)
![](https://i.imgur.com/T0oIkUN.png)

and of course i enabled databinding in the gradle file:

![](https://i.imgur.com/0KF9Rjv.png)

Overall it was a managable task except for the last part appearently. But i think it was a bit too easy in terms of "thinking yourself". Because it wasnt realy required to do that. But the course is enjoyable and i will definitly take the rest of the classes to get a better feeling for what i can do with kotlin and in terms of app development. For example: i am already working on expanding the app of the first chapter with all dice required to play dungeons and dragons.

## Open Questions (2/2)
Please list any questions you were not able to understand.

