This is the deliverable documentation I created describing my app developed for the final capstone project of Coursera's Mobile Cloud Computing with Android Specialization. It was submitted along with a video walkthrough of the app and the project source code (available upon request).
Android Capstone Project, Final Deliverable Documentation
1. "Mutibo"
Android Capstone Project
University of Maryland / Vanderbilt University via Coursera
Nate Betz
2. 2
Mutibo Project Description
"Do you really like movies? Do you think you have a knack
for solving puzzles? Test your movie trivia knowledge and
puzzle solving abilities with Mutibo, a game in which you are
asked to identify which movie in a group of movies is the
odd one. After making your guess, the game will tell you
the correct answer, explain the link between the movies,
and let you rate the group of movie!"
Application Architecture
The application consists of a native Android application
developed with Android Studio v0.8.14, REST-based server
components developed in Java with Eclipse Luna and hosted
by a local Tomcat server, with data persisted to a SQL
Server 2012 RDMS instance.
Application Tools, API's, and Components Utilized:
Client Server Common
Android Studio Eclipse Luna Git
Google Play Services Spring Security HTTP/S
Retrofit Spring Data REST MVC JSON
Spring JPA JUnit
Apache Tomcat OAuth2
JTDS JDBC Driver Gradle
SQL Server 2012
3. 3
Basic Project Requirements [BPR] and
Implementation Details
BPR-1: App supports multiple users via individual user accounts.
Implementation: The application supports multiple users via individual
user accounts that are authenticated with the Google Authentication API.
Code References
Client
• SecuredRestBuilder.java
• LoginScreenActivity.java
Server
• OAuth2SecurityConfiguration.java
• ClientAndUserDetailsService.java
BPR-2: App contains at least one user facing function available only
to authenticated users.
Implementation: Only authenticated users may start a new game.
Code References
Client
• LoginScreenActivity.java
(onConnected and updateUI)
Server
• OAuth2SecurityConfiguration.java
(ResourceMapper and
OAuth2Config)
BPR-3: App comprises at least 1 instance of each of at least 2 of
the following 4 fundamental Android components:
• Activity
• BroadcastReceiver
• Service
• ContentProvider
Implementation: The application includes three Activity instances for
the UI and one BroadcastReceiver instance. The BroadcastReceiver
instance utilizes the system timer to provide a 10-second "bonus period"
after a question is displayed, during which the player receives more points
for a correct answer.
4. 4
Code References
Client
• LoginScreenActivity
• ScoreboardActivity
• QuestionActivity
• MyBroadcastReceiver
Server
BPR-4: App interacts with at least one remotely-hosted Java
Spring-based service.
Implementation: The application interacts with a remotely-hosted Java
Spring-based service for all game activities. See Appendix I for REST API.
Code References
Client
• GameSvc
• Common.GameSvcAPI
Server
• GameController
BPR-5: App interacts over the network via HTTP.
Implementation: All interactions between the client and server and
conducted over the network via HTTP/S.
Code References
Client
• GameSvc
• Common.GameSvcAPI
Server
• GameController
BPR-6: App allows users to navigate between 3 or more user
interface screens at runtime.
Implementation: The client application consists of 3 interface screens:
Main/Login screen, Question screen, and Scoreboard screen, each
implemented as Activities.
Code References
Client
• LoginScreenActivity
• QuestionActivity
Server
5. 5
• ScoreboardActivity
BPR-7: App uses at least one advanced capability or API from the
following list (covered in the MoCCA Specialization): multimedia
capture, multimedia playback, touch gestures, sensors, animation.
Implementation: The application utilizes touch gestures, allowing the
user to like or dislike a question by swiping up or down, and proceeding to
the next question by swiping to the right.
Code References
Client
• QuestionActivity
(MyGestureDetector())
Server
BPR-8: App supports at least one operation that is performed off
the UI Thread in one or more background Threads of Thread pool.
Implementation: All server requests are invoked by the client off the
main UI thread via the use of AsyncTasks.
Code References
Client
• CallableTask
• TaskCallback
• QuestionActivity, LoginscreenActivity
Server
•
6. 6
Mutibo App Functional Requirements [MFR]
and Implementation Details
MFR-1: A Set is a unit of data that contains four movie titles,
optional associated images for each movie, information identifying
the one movie that is not like the other three, and accompanying
text, explaining the relationship between the three related movies.
Implementation: As described. See screeshots and video walkthrough
for more details.
Code References
Client
• QuestionActivity
• (Common) QSet.java
Server
• QSetRepository
MFR-2: A User should be able to log into the game using an
authenticated user account. (Login & session cookie, Basic Auth,
HMAC auth, or OAuth 2.0 bearer token required along with/HTTPS
to access the game.)
Implementation: A user logs into the game using Google Sign-in, which
provides an OAuth2 token and username that are passed to the service over
HTTPS.
Code References
Client
• LoginScreenActivity
• GameSvc
Server
• OAuth2SecurityConfiguration
(EmbeddedServletContainerCustomizer
and keystore file for HTTPS)
MFR-3: A single game presents a series of Sets and guesses, until
the User has made three Incorrect Guesses.
Implementation: As described, the game ends after 3 incorrect guesses.
Code References
Client
• QuestionActivity
Server
•
7. 7
MFR-4: After viewing a Set, a User will be able to rate a Set based
on the explanation of the link between the movies.
Implementation: The user may Like a question set by swiping up, or
Dislike a question set by swiping down.
Code References
Client
• QuestionActivity
Server
• GameController (likeQSet() and
dislikeQSet())
MFR-5: If a Set receives a large number of poor ratings, it can be
removed from the game.
Implementation: Question ratings are persisted to the database by the
server. The query to retrieve the next question for any users will exclude
questions for which the net rating (Likes minus Dislikes) is below a
configuration threshold.
Code References
Client
Server
• GameController(nextSet())
• QSet NamedNativeQuery:
QSet.GetRandomQSet
• GetRandomQSet stored procedure
MFR-6: For each successfully completed Set, the user will get
Points.
Implementation: Players receive points for each correct answer: 200
points if within the "bonus" period, otherwise 100 points.
Code References
Client
• QuestionActivity (processAnswer())
Server
•
MFR-7: All data (questions, answers, points, etc.) are stored to and
retrieved from a web-based service accessible in the cloud.
8. Implementation: All data are stored to and retrieved from a web-based
8
service accessible via http and persisted to a SQL Server database.
Code References
Client
• GameSvcAPI
• GameSvc
• SecuredResetBuilder
Server
• GameController
• GameRepository
Appendix I: REST API
Path Method Function
/oauth/token GET For OAuth authentication
/mutibo/qset/scores GET Get high scores
/mutibo/qset/next GET Get next QSet
/mutibo/qset/getplayer GET Get player info
/mutibo/qset/start GET Start new game
/mutibo/qset/like/{id} GET Like the current QSet
/mutibo/qset/dislike/{id} GET Dislike the current QSet
/mutibo/qset/update POST Send game update to server