I need some demos about file I/O

I first use kotlin, even first write mobile android App, and have learnt kotlin a few days, but…

I want the app has these features:
#1 Show files in the specified format as a list.(such as *.txt).
#2 Create, write and read files.
#3 Add items to file.
#4 Read items from file and show the items on screen as a list.

However I am trapped in dynamically create cardView and add textView. In the internet, many tutorials show create layout by xml, I need to use code.I can’t show textView with specified location in cardView. All textViews start at (0, 0).

Is there a doc like Qt Assistant to introduce every method and have little demo about every widget. I can’t find it. I think it is useful for me to complete this App.

I am a freshman in this field, maybe my statement is too embarrassing and my questions are too easy, I still want anyone can offer me links, demos, etc. I can read and refer them by myself, as you know these materials are so important to a freshman.

Thanks first, very much!!