public class AIRS_local
extends Service
AIRS_remote,
AIRS_record_tab,
Service| Modifier and Type | Class and Description |
|---|---|
class |
AIRS_local.LocalBinder |
class |
AIRS_local.SortBasedOnName |
| Modifier and Type | Field and Description |
|---|---|
Context |
airs
Context of the main Service
|
static SQLiteDatabase |
airs_storage
Reference to AIRS database
|
static AIRS_database |
database_helper
Reference to current AIRS_database
|
boolean |
discovered
Flag if discovery has been done
|
|
mValuesArrayAdapter
List of Values, being used in visualisation activity
|
boolean |
paused
Flag that recording should be paused (where possible)
|
boolean |
registered
Flag that sensors have been registered
|
boolean |
restarted
Flag if AIRS has been restarted
|
boolean |
running
Flag if AIRS is recording
|
boolean |
show_values |
boolean |
start
Flag that AIRS should be started initially
|
boolean |
started
Flag if AIRS has been started as a service already
|
String |
template
Template being used for starting the recording, if any used
|
| Constructor and Description |
|---|
AIRS_local() |
| Modifier and Type | Method and Description |
|---|---|
void |
Discover(Activity airs)
Called to start all sensor handlers and inquire the discovered sensors from these handlers
The function also populates the UI sensor list and shows the appropriate view
This function needs calling from a UI thread, e.g., from AIRS_record_tab
|
void |
execStorage(long milli,
String query)
Synchronised method for writing to AIRS database from the recording threads being created
|
String |
getSymbol(int j)
Gets Sensor symbol that the j-th thread is recording
|
String |
getValue(int j)
Gets Value of the j-th thread
|
IBinder |
onBind(Intent intent)
Returns current instance of AIRS_local Service to anybody binding to AIRS_local
|
void |
onCreate()
Called when starting the service the first time around
|
void |
onDestroy()
Called when service is destroyed, e.g., by stopService()
Here, we tear down all recording threads, close all handlers, unregister receivers for battery signal and close the thread for indicating the recording
|
void |
onLowMemory()
Called when system is running low on memory
|
int |
onStartCommand(Intent intent,
int flags,
int startId) |
void |
pause_threads()
Asks threads to pause
|
void |
refresh_values()
Asks threads to refresh latest value
|
void |
Restart(boolean check)
Restarts the AIRS_local recording service, calling the Rediscover() function, restarting all recordings threads and then make the service sticky
|
void |
resume_threads()
Ask threads to pause recording.
|
void |
saveSelections()
Save all sensor selections in the UI sensor list as persistent values in the preference file
|
void |
selectall()
Sets all sensors being selected in the sensor list - called from UI in
AIRS_record_tab |
void |
sensor_info()
Builds
AlertDialog with sensor information |
String |
share(int j)
Sharing info for sensor entry that j-th thread is recording
|
void |
show_info(int j)
Show timeline, map or similar for sensor entry that j-th thread is recording
|
boolean |
startMeasurements(boolean restarted)
Sets up the main threads to run, acquire values, store them locally and display them (if wanted)
|
void |
unselectall()
Unselects all sensors in the sensor list - called from UI in
AIRS_record_tab |
public boolean show_values
public Context airs
Contextpublic String template
public boolean discovered
public boolean running
public boolean restarted
public boolean started
public boolean start
public boolean paused
public boolean registered
publicmValuesArrayAdapter
AIRS_measurementspublic static AIRS_database database_helper
AIRS_databasepublic static SQLiteDatabase airs_storage
SQLiteDatabasepublic IBinder onBind(Intent intent)
intent - Reference to calling Intentpublic void onLowMemory()
Servicepublic void onCreate()
Servicepublic void execStorage(long milli,
String query)
milli - timestamp of the recordingquery - the SQL query being executed, formed in the recording threadspublic void onDestroy()
public int onStartCommand(Intent intent,
int flags,
int startId)
public void refresh_values()
public void pause_threads()
public String getValue(int j)
j - index to thread which should provide the valuepublic String getSymbol(int j)
j - index to thread which should provide the symbolpublic String share(int j)
j - index to thread which should provide the sharing stringpublic void show_info(int j)
j - index to thread which should show the informationpublic void resume_threads()
public void selectall()
AIRS_record_tabpublic void unselectall()
AIRS_record_tabpublic void sensor_info()
AlertDialog with sensor informationpublic boolean startMeasurements(boolean restarted)
restarted - is this measurements restarted (true) or not (false).public void saveSelections()
public void Discover(Activity airs)
airs - Reference to the current Activitypublic void Restart(boolean check)
check - Should the service been running (true) and was it therefore restarted?