Your app is often going to make decisions, based on user input, the result of a calculation, or responses from an external server. We've just learnt how to use conditionals to make decisions in Java. Let's try it out within our app.

Try: Let the user enter a password. Let's say the correct password is "password123". If the user gets it right, tell them so. Otherwise, tell them they got it wrong.

Bonus: Search online to find out how to make your EditText behave like a password field and obscure what the user types.

Try: Ask for the user's age. If they're 18 and above, tell them they are admitted. Otherwise, tell them they are not.

results matching ""

    No results matching ""