Mobile Application Development

Exercise 2

  1. Create a new project with the following configuration,
  • Empty Activity

  • Language: Kotlin

  • Minimum API level: API 30: Android 11 (R)

  1. Create a User class based on the class diagram below.

This is an image

  1. Create the layout of your main activity according to the figure shown below.

This is an image

  1. In your onCreate method, the name and description are loaded from the User object. The button on the left will show “Follow” if the variable followed is false, and vice versa.

  2. When the left button is clicked, it will toggle the text between Follow and Unfollow. The variable followed is also updated to reflect this.


View Github