Arvutiteaduse instituut
  1. Kursused
  2. 2020/21 sügis
  3. Mobiiliarvutus ja asjade internet (LTAT.06.009)
EN
Logi sisse

Mobiiliarvutus ja asjade internet 2020/21 sügis

  • Main
  • Lectures
  • Labs
  • Homeworks & Home Assignments
  • Quizes
  • Task submission
  • Extra Materials
  • Projects
    • Teams & Topics
    • Presentations & Report
    • Grading & Submission

Homework 1: Biography viewer App GUI

Create a new project (use minSDK API 27) and modify the default activity according to the following specification.

Part 1: Portrait Mode

There is a ConstraintLayout- based Activity that should have 4 objects (2 pts):

  1. One ImageView displaying a drawable image resource
  2. A TextView, which displays the value defined in a String resource xml
  3. Two buttons, with hardcoded text values instead of string resources
    • The values should be "Next" and "Previous".

Use an image and text of your own choice, but text should be at least 200 chars long.

  • The TextView should have 2 vertical and 2 horizontal constraints to the parent so that it is vertically & horizontally centered on the screen.
  • The ImageView should have 2 horizontal constraints to the parent so that it is horizontally centered, its bottom should be constrained to the top of the TextView, while its top should be constrained to the top edge of the screen.
  • Both buttons should be vertically constrained only to the bottom of the screen
    • The "Previous" button should have 1 horizontal constraint to the left edge of the screen
    • The "Next" button should have 1 horizontal constraint to the right edge.

Adjust the widths and height attributes to either wrap_content or match_parent to obtain the above result. Do not use hardcoded numeric values other than 0dp (which is equivalent to match parent)

Part 2: Landscape Mode

  • Create a second activity layout file for Landscape mode, which uses LinearLayout (1pt)
  • Place the same 4 elements in the layout.
  • Using XML attributes of the elements, adjust the elements so that:
    • The LinearLayout uses a "horizontal" value for "orientation"
    • All of them are vertically centered (layout_gravity) (1pt)
    • Distribute the items horizontally using weight (1pt):
      • Set the layout_width of each element to 0dp
      • Set the weights of the buttons so each button takes 10% of the display horizontally
      • Set the weights of the ImageView and TextView so that each takes 40% horizontally

When you run your application and rotate the device, the App should switch between the two activity layout files!

  • Arvutiteaduse instituut
  • Loodus- ja täppisteaduste valdkond
  • Tartu Ülikool
Tehniliste probleemide või küsimuste korral kirjuta:

Kursuse sisu ja korralduslike küsimustega pöörduge kursuse korraldajate poole.
Õppematerjalide varalised autoriõigused kuuluvad Tartu Ülikoolile. Õppematerjalide kasutamine on lubatud autoriõiguse seaduses ettenähtud teose vaba kasutamise eesmärkidel ja tingimustel. Õppematerjalide kasutamisel on kasutaja kohustatud viitama õppematerjalide autorile.
Õppematerjalide kasutamine muudel eesmärkidel on lubatud ainult Tartu Ülikooli eelneval kirjalikul nõusolekul.
Courses’i keskkonna kasutustingimused