waleedAhmad1 / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
0 stars 0 forks source link

Eye Gesture API #642

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please release API to detect Wink and Double Wink. I don't need this for 
camera, I need it so that I can finish my mouse app. The wink feature can be 
used to do many things and I think that Google should give developers full 
access to the glass hardware so that we can be creative. 

I am currently working on an App that can help people with disability to use 
their computer with Glass just by making some gestures. 

This API is holding me back from finishing it because it is not public but I 
know for a fat that it is there. Thanks.

Original issue reported on code.google.com by innocla...@gmail.com on 29 Nov 2014 at 12:54

GoogleCodeExporter commented 9 years ago
Hello,

Thanks for the feature request! The reason this feature is not yet part of the 
GDK is because the product feature itself is still experimental: there are a 
lot of ironing we need to do before this becomes a stable feature that 
developers can safely rely on.

However, the "Innovate with the Glass platform" I/O 2014 talk mentions how you 
can use the unreleased version of this feature for experimenting:
  https://www.google.com/events/io/schedule/session/6ae47f24-b9bf-e311-b297-00155d5066d7

Short answer:

IntentFilter filter = new 
IntentFilter("com.google.android.glass.action.EYE_GESTURE");
filter.setPriority(1000);
context.registerReceiver(new BroadcastReceiver() {

    @Override
    public void onReceive(Context context, Intent intent) {
        if (!“WINK”.equals(intent.getStringExtra(“gesture”))) {
            return;
        }
        abortBroadcast();  // Otherwise you’ll get a picture!
        // Do something...
    }
}, filter);

Best,
Alain

Original comment by ala...@google.com on 2 Dec 2014 at 4:21

GoogleCodeExporter commented 9 years ago
Thanks for your reply Alain. I finally got it to work with your help but the 
abortBroadcast is not doing anything. Therefore it is taking pictures when it 
detects wink.
What I did was extend BroadcastReceiver and register my intent via the 
Manifest. Any other way to stop it from taking a picture?

Original comment by innocla...@gmail.com on 9 Dec 2014 at 1:27