RottenTomatoes BoxOffice Demo
This is an Android demo application for displaying the latest box office movies using the [RottenTomatoes API](http://www.rottentomatoes.com/). See the [RottenTomatoes Networking Tutorial](http://guides.thecodepath.com/android/Rotten-Tomatoes-Networking-Tutorial) on our cliffnotes for a step-by-step tutorial.
RottenTomatoes BoxOffice Demo
This is an Android demo application for displaying the latest box office movies using the RottenTomatoes API. See the RottenTomatoes Networking Tutorial on our cliffnotes for a step-by-step tutorial.
<img src="http://i.imgur.com/zQPzAxD.png" alt="Screen Demo" width="350" /> <img src="http://i.imgur.com/9Uw7qLc.png" alt="Screen Demo" width="350" />Installation
Quick note is that you must provide your own API key for RottenTomatoes in order to use this demo. To get an API key, you need to register for an account (or sign in). Once you have the key, put the key into the API_KEY constant in the src/com/codepath/example/rottentomatoes/RottenTomatoesClient.java file:
public class RottenTomatoesClient {
private final String API_KEY = "ENTER-KEY-HERE";
// ...
}
Once you've setup the key and imported the project into Eclipse, you should be all set.
Overview
The app does the following:
- Fetch the box office movies from the Box Office Movie API in JSON format
- Deserialize the JSON data for each of the movies into
BoxOfficeMovieobjects - Build an array of
BoxOfficeMovieobjects and create anArrayAdapterfor those movies - Define
getViewto define how to inflate a layout for each movie row and display each movie's data. - Attach the adapter for the movies to a ListView to display the data on screen
To achieve this, there are four different components in this app:
RottenTomatoesClient- Responsible for executing the API requests and retrieving the JSONBoxOfficeMovie- Model object responsible for encapsulating the attributes for each individual movieBoxOfficeMoviesAdapter- Responsible for mapping eachBoxOfficeMovieto a particular view layoutBoxOfficeActivity- Responsible for fetching and deserializing the data and configuring the adapter
The app leverages the Box Office Movies API which returns the following JSON response:
{
"movies": [{
"id": "770687943",
"title": "Harry Potter and the Deathly Hallows - Part 2",
"year": 2011,
"mpaa_rating": "PG-13",
"runtime": 130,
"critics_consensus": "Thrilling, powerfully acted, and visually dazzling...",
"release_dates": {"theater": "2011-07-15"},
"ratings": {
"critics_rating": "Certified Fresh",
"critics_score": 97,
"audience_rating": "Upright",
"audience_score": 93
},
"synopsis": "Harry Potter and the Deathly Hallows, is the final adventure...",
"posters": {
"thumbnail": "http://content8.flixster.com/movie/11/15/86/11158674_mob.jpg",
"profile": "http://content8.flixster.com/movie/11/15/86/11158674_pro.jpg",
"detailed": "http://content8.flixster.com/movie/11/15/86/11158674_det.jpg",
"original": "http://content8.flixster.com/movie/11/15/86/11158674_ori.jpg"
},
"abridged_cast": [
{
"name": "Daniel Radcliffe",
"characters": ["Harry Potter"]
},
{
"name": "Rupert Grint",
"characters": [
"Ron Weasley",
"Ron Wesley"
]
}
]
},
{
"id": "770687943",
...
}]
}
See the RottenTomatoes Networking Tutorial on our cliffnotes for a step-by-step tutorial.
Libraries
This app leverages two third-party libraries:
- Android AsyncHTTPClient - For asynchronous network requests
- Picasso - For remote image loading
Related Documents
How you work
You are a coding agent running in the Codex CLI, a terminal-based coding assistant. Codex CLI is an open source project led by OpenAI. You are expected to be precise, safe, and helpful.
内置 Agent 提示词
Claude Code 内置了 6 个子 Agent,各自有独立的系统提示词和工具权限,用于分工处理不同类型的子任务。以下是每个 Agent 的完整系统提示词。
Overture Integration for Claude Code
You have access to **Overture**, an MCP server that visualizes your execution plans as interactive flowcharts before you write any code.
SolidInvoice - AI Assistant Guide
This document provides comprehensive guidance for AI assistants working with the SolidInvoice codebase. It covers the architecture, conventions, workflows, and best practices to help you understand and effectively contribute to this project.