Iteration 2
Group 4′s OOSE Project: Droid Hunt.
The team consists of: Kirk Sabnani, Serena Jeblee, Siren Wei, Sam Hu, Tony Zhang
Vision Statement:
Our app allows a person to create a virtual scavenger hunt and then share that hunt with other droid users in order to create a multiplayer game where players share clues in order to lead other players to real-world locations. We will make use of the droid’s various sensors and features for this game, including the GPS, compass, light sensor, picture/video sharing, and audio recorder.
Features:
- The game GUI and logic will allow users to create, edit, download, join, register, and quit hunts through various screens.
- Users will have the ability to create and edit their own scavenger hunts complete with lists of clues.
- Users will be able to share their scavenger hunt game with other droid users via an online repository (the repository will also store data pertinent to the progress of each hunt such as clues and objective details).
- Users will be able to download hunts from the repository using the droid’s connectivity.
- Users will be able to conduct hunts with other users in competitive multiplayer.
- The app will update users with new clues, etc. in real-time as they progress to new objectives in the hunt.
- Multiplayer will have clear-set progress and winner notifications and possibly specific rules/game modes for each hunt (if time permits).
- Users will need to set up a game account with a username and password in the app in order to perform the aforementioned operations. This will allow for user accountability, increased security and create a user infrastructure for multiplayer.
- Users will be able to search for clues and hunts to facilitate ease of use.
- The abilities of the droids to use different sensors to detect clues will be included as a gameplay mechanic.
- The clues will vary widely in order to maximize use of the multiple sensor abilities on the droids. Examples of clues include text, GPS coordinates, pictures/video, and audio.
- All Droid Hunt data on droids is to be stored on SD cards in order to maintain data liquidity (for convenience of interchangeability).
Iteration To-Do List
We will be trying to get as much as we can in the next iteration, but a rough ordering of what we will be tackling can be seen below:
- Hunts and the ability to create/edit new/existing hunts
- Ability to create clues
- Ability to store clues.
- Server Class to allow FTP
- Player Class
- Syncing the Player Login Credentials with the FTP Server
- Allow users to register
- GUI to support the features above and allow testing
- Server Hierarchy for storing hunts and clues
GUI Sketches:

Architecture:
Phone
The GUI component will deal with all of the visual aspects and application screens that the user will see. These will include the login screen, the main screen, screens that allow the user to join a scavenger hunt, search for clues, etc. The rules for the GUI will be stored locally on their Android Devices when the application is installed.
This component will implement the game logic including scavenger hunts, clues, etc. Each scavenger hunt will have clues, the users that are participating in it and the user who created it. It will include the functionality of adding new scavenger hunts and clues and solving clues. The hunts and clues will be initially stored on the website, but when users try to join and complete a given hunt, the hunt will be downloaded onto their phones and stored locally.
Server/Database
The clues and scavenger hunt data will be stored online. When a user creates a scavenger hunt or a clue, it will be uploaded to the website. Users can then choose to download hunts from the server onto their phones when they opt to do one. The website will include a folder hierarchy to store the user data, scavenger hunt data, what users are participating, the clue data, and possibly which clues have been found by which users.
Use Cases
Actors: Master, Player
Master use-cases:
Master creates new scavenger hunt:
1. User presses “Create New Hunt” button from the main screen.
2. User is sent to the Create New Hunt screen.
3. User specifies the name and type (e.g. public, invite-only) of hunt in provided fields.
3.1. User presses the “Back” button.
3.1.1. User is sent back to the main screen.
4. User is sent to the add new clue screen to add clues to the new hunt.
4.1. Name or type of hunt is invalid, which leads to an error message and a prompt to re-enter hunt data.
5. The first clue is added with a confirmation message.*
6. User is asked if they would like to enter more clues for their hunt.
6.1. If they do, user is sent to the edit hunt screen for that hunt to add more clues.
6.2. If not, user is sent back to main screen.
7. Hunt is added to database when user returns to main screen.
*Steps 5-7 imply that every hunt must have at least one clue in order to be created.
Master adds clue to a hunt:
1. User presses “Add New Clue” button (from either the create hunt screen or the edit hunt screen).
2. User is sent to the Create Clue screen.
3. User specifies the destination, sequence order, type (e.g. text, audio, video), etc. of the new clue and enters type-sensitive data relevant to the clue into (e.g. clue text, file location of video/audio file) into provided fields.
3.1. User presses the “Cancel” button.
3.1.1. User is sent back to their last screen (either the main screen or edit hunt screen).
4. User presses “Upload Clue” to add the clue.
5. Upload data is valid and clue is added to the hunt’s clue list along with a confirmation message.
5.1. Clue data is invalid (e.g. file location does not exist), leading to an error message and a prompt to reenter clue data.
6. User is asked if they would like to enter more clues for their hunt.
6.1. If they do, user is sent to another add new clue screen.
6.2. If not, user is sent back to their last screen (either the main screen or edit hunt screen).
Master edits a hunt:
1. User presses “Edit Hunt” button from main screen.
2. User is sent to the ‘select hunt to edit’ screen.
3. On the ‘select hunt to edit’ screen, the user clicks on a hunt from a list of hunts to edit it (a security question/password may be requested).
3.1. User presses the “Cancel” button.
3.2. User is sent back to the main screen.
4. User is sent to an edit hunt screen where they can change the name/type of the hunt in the provided fields.
4.1. User clicks on a clue from the clue list.
4.1.1. User is sent to the edit clue screen for that clue.
4.2. User presses “Add new Clue”.
4.2.1. User is sent to the add new clue screen.
5. User presses the “Done” button to save the hunt and its changes if any.
6. User is sent to the ‘select hunt to edit’ screen.
6.1. New Hunt data is somehow invalid, leading to an error message and a prompt to reenter hunt data.
Master edits a clue:
1. User clicks on a clue from the clue list of a hunt in the edit hunt screen.
2. User is sent to the edit clue screen for that clue.
3. On the edit clue screen, the user can alter clue data in the provided fields.
4. User presses “Change Clue” to save any changes.
4.2. User presses the “Cancel” button.
4.2.1. User returns to the edit hunt screen and any changes made are undone.
5. User is sent back to the edit hunt screen.
5.1. Clue data is invalid (e.g. file location does not exist), leading to an error message and a prompt to reenter clue data.
Master deletes a clue:
1. User clicks on a clue from the clue list of a hunt in the edit hunt screen.
2. User is sent to the edit clue screen.
3. On the edit clue screen, the user presses the “Delete” button.
4. A confirmation dialog asks the user to confirm the deletion.
4.1. If user confirms, the clue will be deleted from that hunt.
4.1.1. The user is sent back to the edit hunt screen.
4.2. If user aborts, the user is sent back to the edit clue screen.
Master searches for hunt to edit:
1. On the ‘select hunt to edit’ screen, the user presses the “Search for a Hunt” button.
2. User is sent to the search hunts screen.
3. On the search hunts screen, the user enters search terms (e.g. names, clues, etc.) into the provided fields.
4. User presses “Search” to initiate the search.
4.1. The user presses the “Cancel” button.
4.1.1. User is sent back to the ‘select hunt to edit’ screen.
5. User is sent to the search results screen.
6. On the search results screen, a list of hunts that match the search terms will appear for the user to select.
7. The user selects a hunt by clicking on it.
7.1. The user presses the “Back” button.
7.1.1. User is sent back to the ‘select hunt to edit’ screen.
8. The user is sent to the edit hunt screen for that hunt.
Master searches for a clue:
1. On the edit hunt screen, the user presses the “Search for a Clue” button.
2. User is sent to the search clues screen.
3. On the search clues screen, the user enters search terms (e.g. names, order number, etc.) into the provided fields.
4. User presses “Search” to initiate the search.
4.1. The user presses the “Cancel” button.
4.1.1. User is sent back to the edit hunt screen.
5. User is sent to the search results screen.
6. On the search results screen, a list of clues that match the search terms will appear for the user to select.
7. The user selects a clue by clicking it.
7.1. The user presses the “Back” button.
7.1.1. User is sent back to the edit hunt screen.
8. The user is sent to the edit clue screen for that clue.
Player use-cases:
Player logs in:
1. User opens the Droid Hunt app on their Droid.
2. User is sent to the login screen.
3. User logs in by entering his/her username and password in the provided fields.
4. User presses “Login”.
5. User is sent to the main screen.
5.1. User enters incorrect credentials, leading to an error message and a prompt to re-enter credentials.
5.2. User does not have a username/password, so they must register on the server.
Player registers on the server:
1. User presses Create New User button on the login screen.
2. User is sent to the create new user screen.
3. User enters a desired username, password, and password confirmation in the provided fields.
4. User presses the “Submit” button.
4.1. User presses the “Cancel” button.
4.1.1. User is sent to the login screen.
5. User enters valid credentials, and a new account is made with those credentials, with a confirmation message shown.
5.1. User’s desired credentials are invalid or are taken by other accounts.
5.1.1. User is sent back to the create new user screen with an error message and a prompt to re-enter different credentials.
6. User is sent back to login screen.
Player downloads hunt:
1. User presses “Download Hunt” button on the main screen.
2. User is sent to the download hunt screen.
3. User chooses a hunt to download by clicking on it from the online list of hunts.
3.1. User presses the “Cancel” button.
3.1.1. User is sent back to the main screen.
4. The user is asked to confirm if they wish to download that hunt.
4.1. If so, the hunt is sent to the user’s Droid.
4.1.1. Hunt is successfully sent and added to the user’s list of hunts.
4.1.1.1. User is sent back to the download hunt screen along with a confirmation message.
4.1.2. User cannot download hunt due to connection or privacy issues.
4.1.2.1. User is sent back to the download hunt screen along with a detailed error message.
4.2. If not, the user is sent back to the download hunt screen.
Player joins a hunt:
1. User presses the “Join Hunt” button from the main screen.
2. User is sent to the join hunt screen.
3. User selects a hunt by clicking on it from the list of hunts that the player has downloaded.
3.1. User presses the “Cancel” button.
3.1.1. User is sent back to the main screen.
4. User presses “Join Hunt”.
5. User is added to that hunt’s list of participants and sent to a hunt progress screen where they can play the hunt.
5.1. User cannot join hunt due to connection or privacy issues.
5.1.1. User is sent back to the join hunt screen along with a detailed error message.
Player searches for a hunt:
1. On the download hunt screen, the user presses the “Search for a Hunt” button.
2. User is sent to the search hunts screen.
3. On the search hunts screen, the user enters search terms (e.g. names, clues, etc.) into the provided fields.
4. User presses “Search” to initiate the search.
4.1. The user presses the “Cancel” button.
4.1.1. User is sent back to the download hunt screen.
5. User is sent to the search results screen.
6. On the search results screen, a list of hunts that match the search terms will appear for the user to select.
7. The user selects a hunt by clicking on it.
7.1. The user presses the “Back” button.
7.1.1. User is sent back to the download hunt screen.
8. The user is asked to confirm if they wish to download that hunt.
8.1. If so, the hunt is sent to the user’s Droid.
8.1.1. Hunt is successfully sent and added to the user’s list of hunts.
8.1.1.1. User is sent back to the search results screen along with a confirmation message.
8.1.2. User cannot download hunt due to connection or privacy issues.
8.1.2.1. User is sent back to the search results screen along with a detailed error message.
8.2. If not, the user is sent back to the search results screen.
Player searches for a clue:
1. On the hunt progress screen, the user presses the “Search for a Clue” button.
2. User is sent to the search clues screen.
3. On the search clues screen, the user enters search terms (e.g. names, order number, etc.) into the provided fields.
4. User presses “Search” to initiate the search.
4.1. The user presses the “Cancel” button.
4.1.1. User is sent back to the edit hunt screen.
5. User is sent to the search results screen.
6. On the search results screen, a list of clues that match the search terms will appear for the user to select.
7. The user selects a clue by clicking it.
7.1. The user presses the “Back” button.
7.1.1. User is sent back to the hunt progress screen.
8. The user is sent to the clue details screen for that clue.
9. The user presses the “Back” button on the clue details screen.
10. The user is sent back to the hunt progress screen.
Player deletes a hunt:
1. User presses “Join Hunt” button on the main screen.
2. User is sent to the join hunt screen.
3. User selects a hunt to delete by clicking on it from the list of hunts that the player has downloaded.
4. User presses the “Delete Hunt” button.
5. A confirmation dialog asks the user to confirm the deletion.
5.1. If they confirm, the hunt will be deleted from the list.
5.1.1. The user is sent back to the join hunt screen.
5.2. If they abort, the user is sent back to the join hunt screen.
Player progresses to next step in hunt:
1. User reaches destination point specified by a clue in hunt.
2. User receives a notification message on the hunt progress screen.
3. The hunt progress screen displays a new clue.
4. Other participants may be notified (depending on settings) of the player’s progression.
Player finishes hunt:
1. User reaches destination point specified by last clue in hunt.
2. User receives a congratulation message on the hunt progress screen.
3. Other participants in the hunt are notified of the user’s completion.
4. User is asked if they wish to participate in another hunt.
4.1. If they would, the user is sent to the join hunt screen.
4.2. If they don’t, the user is sent to the main screen.
Player leaves hunt:
1. User presses the “Leave Hunt” button on the hunt progress screen.
2. User is asked to confirm.
2.1. If they do, the user is sent to the main screen.
2.2. If they don’t, the GUI reverts to the hunt progress screen.
Player exits app:
1. User presses the “Exit Droid Hunt” button on the main screen.
2. User is asked to confirm.
a. If they do, the app closes.
b. If they don’t, the GUI reverts to the main screen.
Domain Model
Droid Hunt allows for players to participate in user created scavenger hunts on his/her Android phone. These hunts are files that are stored on a server. A user downloads entire hunts from the server, allowing the phone to implement the game. Each hunt consists of one or more clues. Each clue in the hunt leads the player the next clue. The solution to each clue can be either a location (to be checked by GPS) or some specific text answer that the clue will ask for. Once a clue is solved, the next clue will become available until all the clues have been solved. At that point, the hunt ends and the time taken to complete the hunt is calculated.
Each player also has the ability to create hunts. This is done by creating a set of clues of various types. A clue can be an image, video, audio recording, or text that describes the solution of the clue. Each clue has a solution that can be either a GPS coordinate for the user to check or a text answer to some question in the clue. When hunt creation is completed, the creator can then upload hunt files to the server for storage and distribution.
Each user is required to create an account and login to upload and download hunts. Each user is allocated a directory on the server to store all of that user’s created hunts. When downloading, users are presented a list of hunts from the server to choose from.
UML Sequence Diagram:

Activity Model:

Proposed Classes:
Player JavaDoc
Server JavaDoc
Clue JavaDoc
ContinueHuntGUI JavaDoc
CreateClueGUI JavaDoc
CreateHuntGUI JavaDoc
CreateNewUserGUI JavaDoc
CreateNewUserLogic JavaDoc
EditHuntGUI JavaDoc
FirstScreenGUI JavaDoc
FirstScreenLogic JavaDoc
MainScreen JavaDoc
HuntLogic JavaDoc
HuntGUI JavaDoc
UML Class Diagram:

Resources:
- Eclipse IDE
- Android SDK
- SVN Plugin
- import java.io.BufferedOutputStream;
- import java.io.BufferedReader;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileNotFoundException;
- import java.io.FileOutputStream;
- import java.io.FileReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.io.PrintWriter;
- import java.net.ServerSocket;
- import java.net.Socket;
- import java.util.Arrays;
- import java.util.Scanner;
- import org.apache.commons.*;//for ftp functionality
- import android.app.Activity;
- import android.app.AlertDialog;
- import android.content.DialogInterface;
- import android.content.Intent;
- import android.net.Uri;
- import android.os.Bundle;
- import android.os.Environment;
- import android.os.StatFs;
- import android.util.Log;
- import android.view.ContextMenu;
- import android.view.Menu;
- import android.view.MenuItem;
- import android.view.View;
- import android.view.ContextMenu.ContextMenuInfo;
- import android.widget.AdapterView;
- import android.widget.ArrayAdapter;
- import android.widget.ListView;
- import android.widget.TextView;
- import android.widget.Toast;
- import android.hardware.*;
- import android.location.*;
- import android.media.*;
- import android.net.*;
- import android.net.http.*;
- import android.net.wifi.*;