From the course: Programming for Non-Programmers: Android & Kotlin
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Connect visual objects to variables
From the course: Programming for Non-Programmers: Android & Kotlin
Connect visual objects to variables
- Up to this point, we've had some practice writing variables in our code, but we haven't done anything with them yet. In other words, we haven't had some kind of way of checking their values. So let's take a look at how that works, by putting the value of a variable inside of a text field. So, I'm working in a new project, and I'm in my Cutland file right now. I'm going to head over to my user interface file, which is activity_main.xml. If you don't have this file open, you can go inside of the project window, and navigate to app, res, layout, and you should see it in there. Activity_main.xml. So I'll close the project window and if you're familiar with xml at all, you may know that it's a text-based format. If you go to the bottom of Android Studio with this file selected, you'll see that there's the design view and the text view. So behind the scenes, this xml file actually is just powered by plain text. Let's go back to the design view. And what we want to do is associate this…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
How programming works3m 58s
-
(Locked)
Variables3m 33s
-
(Locked)
Working with variables5m
-
(Locked)
Using properties2m 53s
-
(Locked)
Connect visual objects to variables6m 39s
-
(Locked)
Enum values5m 30s
-
(Locked)
Private properties and constants4m 53s
-
(Locked)
Practical applications of variables2m 22s
-
(Locked)
Challenge: Create two variables1m 9s
-
(Locked)
Solution: Create two variables2m 41s
-
-
-
-
-
-