UniVote Class Reference

List of all members.

Public Member Functions

 UniVote ()
void startApp () throws MIDletStateChangeException
void pauseApp ()
void destroyApp (boolean unconditional)
void traceError (String message)
void traceWait (String message)
void traceGoodbye (String message)
void connectServer (final UUID uuid)
void showQuestions (boolean firstRun)
void showAnswers (int question)
void voteAgain ()
void deleteQuestionLastVoted ()
void votingDone ()
void sendVote (String q_id, int a_id, String c_id)

Private Member Functions

String[] split (String original, String separator)

Private Attributes

final UUID SERVER_UUID
final String RECORD_SEPARATOR = ";"
final String FIELD_SEPARATOR = ":"
LocalDevice localDevice = null
RemoteDevice server = null
DiscoveryAgent discoveryAgent = null
StreamConnection conn
DataInputStream in = null
DataOutputStream out = null
String questions
String[] questionRecords = null
String[] questionFields = null
ChoiceGroup questionsGroup = null
ChoiceGroup answersGroup = null
ChoiceGroup againGroup = null
String questionLastVoted
String q_id = null
String q_content = null
String a_1 = null
String a_2 = null
String a_3 = null
Display display = Display.getDisplay(this)
Command exitCommand = new Command("Exit", Command.EXIT, 1)

Detailed Description

The UniVote class makes up the entire client application.

Author:
Nick Day, "UniVote" FInal Year Project, Lancaster University

Definition at line 14 of file UniVote.java.


Constructor & Destructor Documentation

UniVote.UniVote  ) 
 

Definition at line 63 of file UniVote.java.


Member Function Documentation

void UniVote.connectServer final UUID  uuid  ) 
 

Attempts to connect to the UniVote server and open data streams for data transmission via the RFCOMM protocol.

Parameters:
uuid The unique ID of a UniVote server instance.

Definition at line 188 of file UniVote.java.

Referenced by startApp().

void UniVote.deleteQuestionLastVoted  ) 
 

Deletes the local question and answer records which have been voted on.

Definition at line 349 of file UniVote.java.

void UniVote.destroyApp boolean  unconditional  ) 
 

Destroys the application. If the application is closed then the notifyDestroyed method is called to free up resources before closing the application.

Definition at line 118 of file UniVote.java.

void UniVote.pauseApp  ) 
 

Pauses the applicaton. No function.

Definition at line 110 of file UniVote.java.

void UniVote.sendVote String  q_id,
int  a_id,
String  c_id
 

Sends a vote back to the server.

Parameters:
q_id The ID of the question the user is voting on.
a_id The ID of the answer the user selected.
c_id The Bluetooth address of this phone.

Definition at line 390 of file UniVote.java.

void UniVote.showAnswers int  question  ) 
 

Shows the list of answers for a given question.

Parameters:
question The ID of a question.

Definition at line 281 of file UniVote.java.

void UniVote.showQuestions boolean  firstRun  ) 
 

Downloads the list of questions which haven't been voted on by this Bluetooth address, and builds a GUI allowing the user to select which question they want to vote on.

Parameters:
firstRun If this is the first time the user is viewing the questions. true if it is, false if the user has arrived here from the voteAgain method.

Definition at line 231 of file UniVote.java.

String [] UniVote.split String  original,
String  separator
[private]
 

Splits a string transmitted from the server into its components.

Definition at line 409 of file UniVote.java.

void UniVote.startApp  )  throws MIDletStateChangeException
 

Starts the application.

Displays a spalsh screen and begins searching for the nearest Univote server. Once found, the questions are downloaded awaiting user response.

Exceptions:
MIDletStateChangeException 

Definition at line 74 of file UniVote.java.

References connectServer(), discoveryAgent, display, localDevice, SERVER_UUID, traceError(), and traceWait().

Here is the call graph for this function:

void UniVote.traceError String  message  ) 
 

Outputs an error message to the phone, with an "Exit" command.

Parameters:
message The error message to output.

Definition at line 126 of file UniVote.java.

References exitCommand.

Referenced by startApp().

void UniVote.traceGoodbye String  message  ) 
 

Outputs a goodbye message to the phone, with an "Exit" command.

Parameters:
message The message to output.

Definition at line 166 of file UniVote.java.

void UniVote.traceWait String  message  ) 
 

Outputs a please wait message to the phone, with a continuous gauge.

Parameters:
message The message to output.

Definition at line 147 of file UniVote.java.

Referenced by startApp().

void UniVote.voteAgain  ) 
 

Asks the user whether they want to vote again.

Definition at line 319 of file UniVote.java.

void UniVote.votingDone  ) 
 

Confirmation that the application is closing.

Definition at line 369 of file UniVote.java.


Member Data Documentation

String UniVote.a_1 = null [private]
 

Definition at line 50 of file UniVote.java.

String UniVote.a_2 = null [private]
 

Definition at line 51 of file UniVote.java.

String UniVote.a_3 = null [private]
 

Definition at line 52 of file UniVote.java.

ChoiceGroup UniVote.againGroup = null [private]
 

Definition at line 42 of file UniVote.java.

ChoiceGroup UniVote.answersGroup = null [private]
 

Definition at line 41 of file UniVote.java.

StreamConnection UniVote.conn [private]
 

Definition at line 30 of file UniVote.java.

DiscoveryAgent UniVote.discoveryAgent = null [private]
 

Definition at line 29 of file UniVote.java.

Referenced by startApp().

Display UniVote.display = Display.getDisplay(this) [private]
 

Definition at line 57 of file UniVote.java.

Referenced by startApp().

Command UniVote.exitCommand = new Command("Exit", Command.EXIT, 1) [private]
 

Definition at line 58 of file UniVote.java.

Referenced by traceError().

final String UniVote.FIELD_SEPARATOR = ":" [private]
 

Definition at line 22 of file UniVote.java.

DataInputStream UniVote.in = null [private]
 

Definition at line 31 of file UniVote.java.

LocalDevice UniVote.localDevice = null [private]
 

Definition at line 27 of file UniVote.java.

Referenced by startApp().

DataOutputStream UniVote.out = null [private]
 

Definition at line 32 of file UniVote.java.

String UniVote.q_content = null [private]
 

Definition at line 49 of file UniVote.java.

String UniVote.q_id = null [private]
 

Definition at line 48 of file UniVote.java.

String [] UniVote.questionFields = null [private]
 

Definition at line 39 of file UniVote.java.

String UniVote.questionLastVoted [private]
 

Definition at line 43 of file UniVote.java.

String [] UniVote.questionRecords = null [private]
 

Definition at line 38 of file UniVote.java.

String UniVote.questions [private]
 

Definition at line 37 of file UniVote.java.

ChoiceGroup UniVote.questionsGroup = null [private]
 

Definition at line 40 of file UniVote.java.

final String UniVote.RECORD_SEPARATOR = ";" [private]
 

Definition at line 21 of file UniVote.java.

RemoteDevice UniVote.server = null [private]
 

Definition at line 28 of file UniVote.java.

final UUID UniVote.SERVER_UUID [private]
 

Initial value:

                new UUID("00112233445566778899AABBCCDDEEFF", false)

Definition at line 19 of file UniVote.java.

Referenced by startApp().


The documentation for this class was generated from the following file:
Generated on Mon Mar 13 22:07:18 2006 for UniVote Client Application by  doxygen 1.4.6