javaandroidsonysony-smarteyeglass

Smarteyeglass Control Action Definition


In sony smarteyeglass sdk sample codes, there are different actions defined, like onTap(), onTouch(),onObjectClick(),onKey(). It's not really clear for me to understand the functions, like how to connect the physically action to the event triggered method.

For example, running sample app 'HelloSensors', when I double click the touch sensor on the controller, which method would be called? Is it onTap()? So can I override the method in HelloSensorsControl.javalike this:

@Override
public void onTap(final int action, final long timeStamp) {
    if (action != Control.TapActions.DOUBLE_TAP) {
        Log.v("HelloSensor_onTap","not double tap");
        return;
    } else {
        Log.d(Constants.LOG_TAG, "tapactions:" + action);
        // doing sth here when double click happens
    }
}

I tried this method on sample app 'HelloSensors'. When I double click, it is automatically recognized as twice touch action, so onTouch() is called, but this method is never called. Could any one help me to figure out the problem? Does the glass support double click? How can I use it?


Solution

  • I would suggest taking a look at the HelloEventsControl.java class in the HelloEvents sample project. That will give you a good explanation of which events are supported on the glasses. Double tap is not supported unfortunately, only single tap, but you can also detect swipes and long press so perhaps you can use one of those events instead.