Arvutiteaduse instituut
  1. Kursused
  2. 2022/23 sügis
  3. Mobiilirakenduste arendus (LTAT.06.021)
EN
Logi sisse

Mobiilirakenduste arendus 2022/23 sügis

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

Homework 4 - SMS Log App

This homework builds upon the project started in Lab 4. You should complete the lab before proceeding.

1. Permission requests (2 pts)

Update your app to properly request permissions from the user when first started.

  • First check if required permissions are already granted
    • If yes, register the receiver
    • If not, request for them and register the receiver once they have been granted

Follow the example demo-ed during lecture, and if necessary study the permissions developer guide for more instructions.

  • In lecture 4, usage of registerForActivityResult(RequestPermission() approach was demonstrated. In the guide linked above, 2 ways of doing it are described:
    1. Using RequestPermission and letting the system manage request codes (shown in lecture)
    2. Using the approach where you manage request codes yourself.
  • You may use either of those approaches.

2. "Call Back" functionality with RecyclerView & Adapter

Similar to the 3rd part of Lab 4, show a RecyclerView-based list of SMS that arrive while the app is running (received using BroadcastReceiver).

  • Modify the custom_list_item.xml so that its root is a horizontal LinearLayout, containing:
    • 2 TextViews (for displaying phone number and the incoming SMS timestamp)
    • An ImageView or Button with the text "Call" (choose one of the 2).
  • Adjust the behaviour of your RecyclerView Adapter:
    • One TextView displays the SMS sender's phone number, as in lab 4 (1pt)
    • The second TextView displays the time when the SMS arrived (hours, minutes, seconds).(1pt)
    • Set up a click listener for the ImageView/Button, so that when it is clicked, a new Intent to start a phone dialer Activity is launched, with the number filled in. ( 1 pt)
      • Use Intent.ACTION_DIAL
      • Tip: you can use your View object from the ViewHolder to get an instance of Context
      • You have to specify the correct Uri for a phone number
      • For more info on initiating calls, including Uri examples: https://developer.android.com/guide/components/intents-common#Phone
  • 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