|
|
@ -69,7 +69,7 @@ public class ActivitySelectSensor extends AppCompatActivity
|
|
|
|
private ListView listView;
|
|
|
|
private ListView listView;
|
|
|
|
private SensorManager sensorManager;
|
|
|
|
private SensorManager sensorManager;
|
|
|
|
private ArrayList<Sensor> sensors = new ArrayList<>();
|
|
|
|
private ArrayList<Sensor> sensors = new ArrayList<>();
|
|
|
|
|
|
|
|
private EditText sessionIdText;
|
|
|
|
private RealTimeSensorReader sensorReader = null;
|
|
|
|
private RealTimeSensorReader sensorReader = null;
|
|
|
|
private RealTimeSensorChangeReceiver realTimeSensorChangeReceiver = new RealTimeSensorChangeReceiver();
|
|
|
|
private RealTimeSensorChangeReceiver realTimeSensorChangeReceiver = new RealTimeSensorChangeReceiver();
|
|
|
|
private SupportedSensors supportedSensors = SupportedSensors.getInstance();
|
|
|
|
private SupportedSensors supportedSensors = SupportedSensors.getInstance();
|
|
|
@ -81,11 +81,21 @@ public class ActivitySelectSensor extends AppCompatActivity
|
|
|
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
|
|
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
|
|
|
setSupportActionBar(toolbar);
|
|
|
|
setSupportActionBar(toolbar);
|
|
|
|
sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
|
|
|
|
sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
|
|
|
|
|
|
|
|
sessionIdText = (EditText) findViewById(R.id.sessionId);
|
|
|
|
|
|
|
|
sessionIdText.setCursorVisible(false);
|
|
|
|
|
|
|
|
|
|
|
|
listView = (ListView) findViewById(R.id.senseListContainer);
|
|
|
|
listView = (ListView) findViewById(R.id.senseListContainer);
|
|
|
|
|
|
|
|
|
|
|
|
registerReceiver(realTimeSensorChangeReceiver, new IntentFilter("sensorDataMap"));
|
|
|
|
registerReceiver(realTimeSensorChangeReceiver, new IntentFilter("sensorDataMap"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sessionIdText.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
|
|
|
sessionIdText.setCursorVisible(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//Publish data
|
|
|
|
//Publish data
|
|
|
|
FloatingActionButton fbtnPublishData = (FloatingActionButton) findViewById(R.id.publish);
|
|
|
|
FloatingActionButton fbtnPublishData = (FloatingActionButton) findViewById(R.id.publish);
|
|
|
|
|
|
|
|
|
|
|
@ -113,7 +123,6 @@ public class ActivitySelectSensor extends AppCompatActivity
|
|
|
|
fbtnSpeechRecongnizer.setOnClickListener(new View.OnClickListener() {
|
|
|
|
fbtnSpeechRecongnizer.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
|
EditText sessionIdText = (EditText) findViewById(R.id.sessionId);
|
|
|
|
|
|
|
|
String sessionId = sessionIdText.getText().toString();
|
|
|
|
String sessionId = sessionIdText.getText().toString();
|
|
|
|
if (!sessionId.isEmpty()) {
|
|
|
|
if (!sessionId.isEmpty()) {
|
|
|
|
Intent intent = new Intent(getApplicationContext(), WordRecognitionActivity.class);
|
|
|
|
Intent intent = new Intent(getApplicationContext(), WordRecognitionActivity.class);
|
|
|
@ -214,6 +223,8 @@ public class ActivitySelectSensor extends AppCompatActivity
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onDialogPositiveClick(SelectSensorDialog dialog) {
|
|
|
|
public void onDialogPositiveClick(SelectSensorDialog dialog) {
|
|
|
|
|
|
|
|
|
|
|
@ -275,6 +286,7 @@ public class ActivitySelectSensor extends AppCompatActivity
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This method unregisters the real-time broadcast receiver.
|
|
|
|
* This method unregisters the real-time broadcast receiver.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|