/PopularMovieStage2

Udacity Android developer project: Popular Movies

Primary LanguageJava

Udacity project: PopularMovies - Stage 2

(Trailers, Reviews, and Favorites)

Google Play: https://play.google.com/store/apps/details?id=com.ctyeung.popularmoviestage2

User Experience

  • users to view and play trailers ( either in the youtube app or a web browser).
  • users to read reviews of a selected movie.
  • users to mark a movie as a favorite in the details view by tapping a button(star). This is for a local movies collection that will maintain and does not require an API request*.
  • main view to include an additional pivot to show their favorites collection.

Stage 2 - API Hints

  • To fetch trailers you will want to make a request to the /movie/{id}/videos endpoint.
  • To fetch reviews you will want to make a request to the /movie/{id}/reviews endpoint
  • Use an Intent to open a youtube link in either the native app or a web browser of choice.

Implementation demo

Below screenshots demonstrate pages: main -> detail -> trailer or review.

1080 x 1920 - 1 size only

Portrait layout

Landscape layout

Below screenshots demonstrate content provider with SQLiteDatabase CRUD operators:

create

final String CREATE_TABLE = "CREATE TABLE " + MovieContract.MovieEntry.TABLE_NAME + " (" + MovieContract.MovieEntry._ID + " INTEGER PRIMARY KEY, " + MovieContract.MovieEntry.COLUMN_TITLE + " TEXT NOT NULL, " + MovieContract.MovieEntry.COLUMN_JSON_DETAIL + " TEXT NOT NULL);";

query

cursor = db.query(MovieContract.MovieEntry.TABLE_NAME, columns, selection, selectionArgs, null, null, sortOrder);

update - not used

insert

db.insert(TABLE_NAME, null, values);

delete

db.execSQL("DELETE FROM " + TABLE_NAME+ " WHERE "+COLUMN_TITLE+"='"+selection+"'");

display favorite sorted (DESC)

Refinements in the future (for product grade)

  • tests and error handling.
  • more layouts for different format + sizes.
  • more graphics for trailer + reviews.
  • more verbose; example: no trailer, no review, toasts
  • more comments in code
  • more modularized code; decouple; refactor and use appropriate design patterns for more general usage.

Common Project Requirements

MEETS SPECIFICATIONS

App is written solely in the Java Programming Language.

App conforms to common standards found in the Android Nanodegree General Project Guidelines.

User Interface - Layout

MEETS SPECIFICATIONS

UI contains an element (e.g., a spinner or settings menu) to toggle the sort order of the movies by: most popular, highest rated.

Movies are displayed in the main layout via a grid of their corresponding movie poster thumbnails.

UI contains a screen for displaying the details for a selected movie.

Movie Details layout contains title, release date, movie poster, vote average, and plot synopsis.

Movie Details layout contains a section for displaying trailer videos and user reviews.

User Interface - Function

MEETS SPECIFICATIONS

When a user changes the sort criteria (most popular, highest rated, and favorites) the main view gets updated correctly.

When a movie poster thumbnail is selected, the movie details screen is launched.

When a trailer is selected, app uses an Intent to launch the trailer.

In the movies detail screen, a user can tap a button(for example, a star) to mark it as a Favorite.

Network API Implementation

MEETS SPECIFICATIONS

In a background thread, app queries the /movie/popular or /movie/top_rated API for the sort criteria specified in the settings menu.

App requests for related videos for a selected movie via the /movie/{id}/videos endpoint in a background thread and displays those details when the user selects a movie.

App requests for user reviews for a selected movie via the /movie/{id}/reviews endpoint in a background thread and displays those details when the user selects a movie.

Data Persistence

MEETS SPECIFICATIONS

The titles and ids of the user's favorite movies are stored in a ContentProvider backed by a SQLite database. This ContentProvider is updated whenever the user favorites or unfavorites a movie.

When the "favorites" setting option is selected, the main view displays the entire favorites collection based on movie ids stored in the ContentProvider.