MOVERIO Pro Developer's Guide (Rev.1.4)
55
5.6.
Sample code
package com.epson.moverio.bt2pro.sample.vcmd;
import android.media.epson.IVoiceCommandInterface;
import android.media.epson.VoiceCommandClient;
import android.media.epson.VoiceCommandClientCallbacks;
import android.os.Bundle;
import android.os.RemoteException;
import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends Activity implements VoiceCommandClientCallbacks {
private Context mContext = null;
private Button mStartButton = null;
private Button mStopButton = null;
private VoiceCommandClient mVoiceCommandClient = null;
private IVoiceCommandInterface mVoiceCommandSystem;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mContext = getApplicationContext();
mVoiceCommandClient = new VoiceCommandClient();
mVoiceCommandClient.bindToRemoteRunningService(this);
mStartButton = (Button) findViewById(R.id.start);
mStartButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
mVoiceCommandSystem.start("/system/vendor/bin/epe_au01_j1.lms");
} catch (RemoteException e) {
e.printStackTrace();
}
}
});
mStopButton = (Button) findViewById(R.id.stop);
mStopButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
mVoiceCommandSystem.stop();
} catch (RemoteException e) {
e.printStackTrace();
}
}
});
}
@Override
protected void onResume() {
super.onResume();
mVoiceCommandClient.registerCallback(this);
}
@Override
protected void onPause() {
Summary of Contents for Moverio Pro BT-2000
Page 7: ...MOVERIO Pro Developer s Guide Rev 1 4 1 1 Introduction ...
Page 12: ...MOVERIO Pro Developer s Guide Rev 1 4 6 2 Developing Apps ...
Page 30: ...MOVERIO Pro Developer s Guide Rev 1 4 24 3 Display control ...
Page 39: ...MOVERIO Pro Developer s Guide Rev 1 4 33 4 UI control ...
Page 47: ...MOVERIO Pro Developer s Guide Rev 1 4 41 5 Voice commands ...
Page 70: ...MOVERIO Pro Developer s Guide Rev 1 4 64 6 Camera control ...
Page 119: ...MOVERIO Pro Developer s Guide Rev 1 4 113 7 Sensor control ...
Page 127: ...MOVERIO Pro Developer s Guide Rev 1 4 121 8 Bluetooth BLE ...
Page 184: ...MOVERIO Pro Developer s Guide Rev 1 4 178 9 Power control ...
Page 187: ...MOVERIO Pro Developer s Guide Rev 1 4 181 10 Self diagnostic function ...
Page 191: ...MOVERIO Pro Developer s Guide Rev 1 4 185 11 GPS Assist ...
Page 202: ...MOVERIO Pro Developer s Guide Rev 1 4 196 Memo ...