Skip to Main Content
Android Programming with Kotlin for Beginners
book

Android Programming with Kotlin for Beginners

by John Horton
April 2019
Beginner to intermediate content levelBeginner to intermediate
698 pages
15h 15m
English
Packt Publishing
Content preview from Android Programming with Kotlin for Beginners

Using buttons and TextView widgets from our layout with a little help from interfaces

To follow along with this project, create a new Android Studio project, call it Kotlin Meet UI, and choose the Empty Activity template. You can find the code and the XML layout code in the Chapter12/Kotlin Meet UI folder.

First, let's build a simple UI by observing the following steps:

  1. In the editor window of Android Studio, switch to activity_main.xml and make sure you are on the Design tab.
  2. Delete the auto-generated TextView, the one that reads "Hello world!".
  3. Add a TextView widget to the top-center of the layout.
  4. Set its text property to 0, its id property to txtValue, and its textSize to 40sp. Pay careful attention to the case of the id value. It has an uppercase ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Android with Kotlin

Programming Android with Kotlin

Pierre-Olivier Laurence, Amanda Hinchman-Dominguez, Mike Dunn, G. Blake Meike
How to Build Android Apps with Kotlin - Second Edition

How to Build Android Apps with Kotlin - Second Edition

Alex Forrester, Eran Boudjnah, Alexandru Dumbravan, Jomar Tigcal
Java to Kotlin

Java to Kotlin

Duncan McGregor, Nat Pryce

Publisher Resources

ISBN: 9781789615401Supplemental Content