Sample Code - Epson Moverio Pro BT-2000 Developer's Manual

Hide thumbs Also See for Moverio Pro BT-2000:
Table of Contents

Advertisement

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() {
MOVERIO Pro Developer's Guide (Rev.1.4)
55

Advertisement

Table of Contents
loading

This manual is also suitable for:

Moverio pro bt-2200

Table of Contents