April 2019
Beginner to intermediate
698 pages
15h 15m
English
Let's try using some declarations, assignments, and operators. When we bundle these elements together into some meaningful syntax, we call it an expression. Let's write a quick app to try some out. We will then use Toast and Log to check our results.
Create a new project called Express Yourself, use an Empty Activity project template, and leave all the other options in their usual settings. The completed code that we will write in this project can be found in the Chapter07 folder of the download bundle.
Switch to the MainActivity tab in the editor and we will write some code. In the onCreate function, just before the closing curly brace (}), add this highlighted code:
class MainActivity : AppCompatActivity() { override ...Read now
Unlock full access