Exercise: Simple Activity to collect words

You must program a simple Activity class from which you can enter some words - and then show them.

  1. Create a new Android project
  2. Modify the main.xml file to have content (more or less) equivalent to the picture below
  3. Make an listener method for each button.
    The words can be stored in a List<String> = new ArrayList<>()
    The words can be shown using Toast.makeText(...) and/or in the Activity using another TextView for output (below the buttons)

collect words

Experiment: inputType

EditText has an attribute inputType. Use this attribute to try different input types. Run the app and notice the difference.

Some input types:

They may not all be relevant for this app - but try them anyway.

Which input type seems most relevant for this app?

Extra: Nicer layour

You are allowed to make a nicer layout.