|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.drismo.logic.TripLogger
public class TripLogger
Class for making/updating log file. Logs the quality when monitoring, and location if specified.
MonitorController
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private android.content.Context |
context
|
private android.location.Location |
currentLocation
|
private boolean |
isLogging
|
private java.lang.String |
logFileName
|
private long |
mStartTime
|
private java.io.OutputStreamWriter |
osw
|
private java.util.ArrayList<java.lang.Integer> |
scoreList
|
private int |
update_ms
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
TripLogger(android.content.Context con)
The constructor |
Method Summary | |
---|---|
private int |
calculateAverageScore()
Calculates the avg. score |
void |
closeLogFile()
closes the log file, so the application can startMonitoring a new one. |
java.lang.String |
getFileName()
Get the file name for this log. |
void |
interrupt()
Called when we want to stop logging. |
void |
newLogFile()
makes a new log file. |
void |
onNewLocation(android.location.Location loc)
This method is called when there is a location update. |
void |
onQualityUpdate(int newScore)
This method is called when the score changes. |
void |
run()
|
void |
start()
Start the logging |
private void |
updateFile()
Updates the log file with a new line of info. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int update_ms
private java.io.OutputStreamWriter osw
private long mStartTime
private java.lang.String logFileName
private android.content.Context context
private boolean isLogging
private volatile java.util.ArrayList<java.lang.Integer> scoreList
private android.location.Location currentLocation
Constructor Detail |
---|
public TripLogger(android.content.Context con)
con
- the application context. This is used when we make/write a log file.Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void interrupt()
interrupt
in class java.lang.Thread
public void start()
start
in class java.lang.Thread
public void newLogFile()
public void closeLogFile()
private void updateFile()
private int calculateAverageScore()
updateFile()
public void onQualityUpdate(int newScore)
onQualityUpdate
in interface QualityListener
newScore
- the new scoreQuality
public void onNewLocation(android.location.Location loc)
onNewLocation
in interface NewLocationListener
loc
- the new location.public java.lang.String getFileName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |