Institute of Computer Science
  1. Courses
  2. 2020/21 fall
  3. Mobile Computing and Internet of Things (LTAT.06.009)
ET
Log in

Mobile Computing and Internet of Things 2020/21 fall

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

Home Assignment 1

  • Have an activity with design such as in figure A, presenting a RecyclerView-based list of the phones contacts (using Contacts content provider, Cursor) ( 6 pts)
    • Content Providers with an example of getting contacts were discussed in lecture 4
    • Tip: You will have to do at least a total of 2 queries, as the list of contacts and data about contacts (such as e-mail) are stored in different tables.
  • Selecting one contact opens up their details in a new activity (Email composition activity) and provides means for sending an e-mail, including EditTexts to capture a title and body for the e-mail ( 3 pts)
    • Required details: Full name, phone no., email
    • Use startActivityForResult() when opening this new activity so you can later handle the results (read below)
    • Pressing the send e-mail button will forward an intent to send an e-mail, passing along relevant information (the recipient's e-mail, e-mail title, body) ( 3 pts)
      • This intent should cause an e-mail app to open up (such as Gmail) with the recpient address and e-mail body pre-filled
    • Alternatively, if the user does not press send e-mail, but hits the back button, they are returned to the contact list activity and a temporary message should appear with the text "Mail composition cancelled".
    • When the user is in the e-mail app (e.g. Gmail), after hitting "send" (which closes the mail App), the e-mail composing activity automatically closes without user input. The user is immediately returned to the contact list, and a message/indicator next to the chosen contact appears indicating that an e-mail was composed for them (up to you how to display the message exactly).
  • The app should also have an action bar with working search (filter) functionality (filter contact list by name). ( 3 pts)
    • Use SearchView
      • I recommend using setting a SearchView.OnQueryTextListener, but other SearchView based solutions are also fine.
  • Make sure your application takes care of lifecycle changes & user state
    • Filtering results must not be lost e.g. when switching phone orientation
    • The app should take care of requesting permissions if they are not already granted.
    • Empty inputs, missing permissions should not make the app crash!
    • if you fail to meet this requirement you will receive a penalty of -3 pts

Note:

  • You may have noticed that Gmail doesn't actually give you any distinct resultCodes when the user sends the e-mail or actually cancels/closes the gmail app without sending. Since we don't know which e-mail apps make proper use of resultCodes, for this assignment you can just assume the e-mail was sent, even if the user canceled it.
  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment