Wednesday:
Presentation: Intro to ConstraintLayout (You might also watch Android Studio 2.2 Constraint
Layouts For Beginners)
Greeting_Kotlin.zip demos EditText, Button, TextView. Shows varying amount of
"explicitness" Kotlin allows when establishing an "on click listener" and its associated "on click" method. Also
includes an EditText event handler, changes View colors, as well as enables/disables Views (Buttons).
Adding Log
and Toast
to the Hello World program
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Log -- like a console message -- can be used to debug
Log.d("HELLO_TAG", "The Hello World App started.")
// Toast -- message briefly shown to the user
Toast.makeText(this, "Hello Toast", Toast.LENGTH_LONG).show()
}
}
Debugging
Kotlin in Android Studio - Kotlin Android - 04 (youtube tutorial by Electronic Armory)
Not done yet
Lab 2: Design an app that prompts the user with three security questions (such as "What was your
first pet's name?"). This part should have three TextView's and three EditText's. Have two Buttons (Enter
and Clear) and another TextView for the result. The Enter Button when clicked should collect the three
user answers and concatenate them with some delimiter of your choice and use that to set the text of the
result TextView. Furthermore use Log and Toast to display the result. If the clear Button is clicked,
empty out the result TextView. If the user changes any question answer, you should also clear out the
result TextView.
Due: Jan. 22