|
@@ -11,6 +11,7 @@ import android.os.Bundle;
|
11
|
11
|
import android.view.View;
|
12
|
12
|
import android.view.View.OnClickListener;
|
13
|
13
|
import android.widget.Button;
|
|
14
|
+import android.widget.EditText;
|
14
|
15
|
import android.widget.TextView;
|
15
|
16
|
|
16
|
17
|
/**
|
|
@@ -21,13 +22,13 @@ public class MainActivity extends Activity implements OnClickListener {
|
21
|
22
|
|
22
|
23
|
static final String VERSION = "0.1";
|
23
|
24
|
|
|
25
|
+ static String ACTIVITY = "Unknown";
|
|
26
|
+
|
24
|
27
|
/** {@inheritDoc} */
|
25
|
28
|
@Override
|
26
|
29
|
public void onCreate(final Bundle icicle) {
|
27
|
30
|
super.onCreate(icicle);
|
28
|
31
|
|
29
|
|
- startService(new Intent(this, SensorLoggerService.class));
|
30
|
|
-
|
31
|
32
|
setContentView(R.layout.main);
|
32
|
33
|
|
33
|
34
|
((Button) findViewById(R.id.start)).setOnClickListener(this);
|
|
@@ -42,11 +43,14 @@ public class MainActivity extends Activity implements OnClickListener {
|
42
|
43
|
+ "Once 1,000 entries have been recorded, the data will be "
|
43
|
44
|
+ "automatically uploaded and erased from the device. You can "
|
44
|
45
|
+ "manually trigger an upload using the button below.\n\n");
|
|
46
|
+ ((TextView) findViewById(R.id.caption)).setText("Activity name:");
|
45
|
47
|
}
|
46
|
48
|
|
47
|
49
|
/** {@inheritDoc} */
|
48
|
50
|
@Override
|
49
|
51
|
public void onClick(final View view) {
|
|
52
|
+ ACTIVITY = ((EditText) findViewById(R.id.entry)).getText().toString();
|
|
53
|
+
|
50
|
54
|
if (view.getId() == R.id.start) {
|
51
|
55
|
if (!stopService(new Intent(this, SensorLoggerService.class))) {
|
52
|
56
|
startService(new Intent(this, SensorLoggerService.class));
|