Exercise Wednesday

Important: For Friday's code review, we ask that you not .gitignore API keys or credentials unless they grant access to sensitive information, since your instructor will need these keys to review your project with you. Before Friday, determine whether the API you plan on implementing includes sensitive keys. If so, make arrangements with your instructor ahead of time.

Goal: Continue building on your knowledge of requesting data from a backend web service and displaying it using fragments, ListViews, and RecyclerViews. Pay special attention to implementing implicit intents throughout your application.

Warm Up


  • Read through the Android documentation on Intents, up through the 'Standard Activity Actions' section with your partner. We've already covered ACTION_VIEW and ACTION_DIAL in last night's homework, but what about the other activities listed? Browse through a few of the available options and discuss possible use cases with your partner.
  • What is the difference between implicit and explicit intents? Provide an example of each.
  • What arguments do we need to provide when creating an explicit intent?
  • What about when we create an implicit intent?
  • Why do we need to resize images? What errors could occur if we don't?

Code


Movie App (Two-Day Project)

Spend today and Thursday building a movie app that allows users to search for movies by title, rating, and release date. You will use information from The Movie Database API. Display the movie poster, title, synopsis, director, and main actors for each movie.

Here are some additional ideas to explore. It's not required to implement each and every one of these. Select one or more to focus on for your own app:

  • Add a feature that allows users to click on an actor’s name and return a list of other movies they appear in.
  • Add a feature that allows users to open the contact book, select a contact, and then send the contact a text message which includes the name and rating of the selected movie along with a personalized note such as “Let’s go see this together!” refer to the article from the warmup exercise, and Tuesday’s homework on Implicit Intents. Keep in mind you will need to create fake contacts in the emulator’s contact book in order to test this feature out.
  • Implement custom layouts, icons and other aesthetics.

Hint: Append to Response

This particular movie API supports appending additional information to a response, which will allow you to receive multiple types of data from one response instead of making two separate responses.

For example, if you wanted both alternative titles and similar movies, you could append them as part of an append_to_response parameter, like this:

http://api.themoviedb.org/3/movie/550?api_key= ###&append_to_response=similar_movies,alternative_titles&language=DE

Try it out!

Peer Code Review


  • Does the application successfully request information from the Movie Database API?
  • Is it parsing the JSON response appropriately?
  • Is the code clean and well-refactored?
  • Are fragments being utilized? Are there any spots where fragments are not necessary? Any spots that don't use fragments that should?
  • Does the application make use of implicit intent(s)? Are they functional?