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

Mobiiliarvutus ja asjade internet 2019/20 sügis

  • Main
  • Lectures
  • Labs
  • Homeworks & Home Assignments
  • Projects
    • Teams & Topics
    • Presentations & Report
    • Grading & Submission
  • Google Group
  • Task submission
  • Results
  • Other

Homework 2: Celsius-Fahrenheit converter

Task 1 - Celsius-Fahrenheit converter

  • Create an application that converts user-entered Celsius values to Fahrenheit and vice versa.
  • Use EditText to get user input ( setText() and getText() methods of EditText are helpful) (1 pt )
  • There should be 2 buttons (1pt)
    • 1 to apply to conversion, which will display the result in a TextView (1pt)
    • another to switch between conversion modes (Celsius 2 Fahrenheit / Fahrenheit 2 Celsius).
  • There should be 2 textviews (1 pt)
    • One with larger fontsize to display the result
    • Another one which displays the current conversion mode mentioned above.

Tip: when acquiring the value from EditText, be mindful of the type it returns. You will have to do some type conversion before you can do calculations on it.

Other than above restrictions, feel free to be creative about the exact design of the UI. Images are only provided as a reference.

Task 2 - Observing lifecycle methods (2 pts)

Override the onPause, onResume, onStop, onDestroy methods as discussed in the lecture. Write some log statement in them and answer these questions:

  • Which of the methods are called & in which order when:
    • Changing device orientation
    • Hitting the home button and returning to the application
    • Hitting the back button and re-opening the application
  • What happens to the EditText and TextView elements in each of these 3 cases (assuming the user has already performed one conversion).

Write your answers as a comment to the submission

  • 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