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

Call Log App

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

  1. Update your app to properly request permissions from user when first started. (2 pts)
    • First check if required permissions are already granted (use ContextCompat.checkSelfPermission( ..) )
    • If not, request for them and register the receiver once they have been granted (use ActivityCompat.requestPermissions(..) and onRequestPermissionsResult(..) )
    • If yes, register the receiver

You can refer to permissions developer guide for more instructions

  1. Using a custom adapter, modify the custom_list_item.xml so that its root is a horizontal LinearLayout, contains a TextView (for displaying phone number) and a button with the text "Call". (1 pt)
  2. Set up a click listener for the button, so that when a number's button is clicked, a new Intent to start a phone dialer Activity is launched, with the number filled in. ( 2 pts)
    • Use Intent.ACTION_DIAL
    • 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
  3. By default, the PHONE_STATE_CHANGED broadcast is delivered more than once per each incoming call. Adjust the code so that the per each call, only 1 item is added.
    • You can do this by tracking the state changes of the broadcasts, for example. Only add an item to the list if the previous state was idle and new state is ringing.
    • Other solutions are also fine, as long as duplicate entries are not made for a single call.
  • 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