• 8 hours
  • Hard

Free online content available in this course.

course.header.alt.is_video

course.header.alt.is_certifying

Got it!

Last updated on 4/27/23

Get some practice upgrading your app using Android architecture

It's your turn

You've just shown your new app, SaveMyTrip, to a future client (the code is available for download here).  The client would like you to adapt the existing app by adding image support to the Things to do list. It should look like this:

Expected result
Expected result 

After speaking extensively with the client, you've figured out that you need to do the following:

  • Add a button allowing the user to retrieve images from their personal photo gallery (which will use external storage). This image will show up in place of the button.  (In the example above, this would be the transition from Screen 1 to Screen 2.)

  • Once the user clicks on the big green Add button at the bottom of the screen, a new "to do" should be added to the list.  It should contain the image previously selected by the user, as well as a Share button. (In the example above, this would be screen 3.)

  • The Share button should only show up if an image is present, because this button allows the user to share this image.  You should also implement a function allowing the user to share the image from their "to do" list when they click on the button.

  • The Share functionality should allow your user to share to one or more options: email, social media, etc. 

The end goal is to make a functional application which looks like the expected result above - and make your client happy! 😉

Check your work!

Check that the following elements are present:

  • The "add image" functionality: the user is prompted to choose a photo in their gallery.

  • The "add image" functionality: after being added, the photo shows up as an element in the corresponding RecyclerView.

  • The "share image" functionality: when the user clicks on the Share button, they can share an image via one of the media options (email, for example).

  • Controllers are only used for manipulating the GUI. 

  • ViewModel is used to provide the controller with data for the GUI.

  • The data present within the ViewModel is primarily LiveData. 

  • Repository classes are used in each ViewModel. 

  • Data sources take the form of DAOs. 

Are you done? Sure? Then take a look at the example to see how you got on!

Example of certificate of achievement
Example of certificate of achievement