Google Glass voice command send activity to background - google-glass

I do an example that launch the voice command on an activity, but when the "ok glass" shown on the bottom of the screen, the activity came to background ( it's looks like my activity goes more transparent ... )
There is a way that this doen't happen? I would like to made that ... transparent, but when I say "ok glass" not when the activity load that on the bottom ...
any idea?

If I understand correctly your question, you want to customize the Contextual Voice Command, by deleting the gray overlay above your activity.
If yes, I wanted to do the same thing but with XE19 we do not have this possibility yet.
I asked a question and got a respons with a custom solution if you are interested :
Custom Voice Input
EDIT: I also find another solution customizing the Voice Input From google, but it won't work when the XE will be upgraded : Another Custom Voice Input

Related

How to change the message icon if a message is received

I've built a chat app using Django Channels. To check messages I should click on the message icon (just like stackoverflow for example). I want to add the feature enabling to have these small red circles on the message icon indicating the number of messages not read and I don't even know what I should type on Google to look for this. Any suggestions ?
Thanks!

How do you customise Glass contextual voice menu in an immersion *after* its initial setup?

I've successfully populated the contextual voice menu of my glassware immersion but I want to be able to change the menu after the initial set up in onPreparePanel() or onCreatePanelMenu() as described here: Programmatically populated contextual "ok glass" menu.
Ideally one of the callbacks would be called after receiving the 'ok, glass' voice command but as far as I can tell, none of them are. Outcome, you're stuck with the version of the voice commands menu as it was the first time you cam into the activity.
So far, the only hack that's come close was when I pulled the GlassVoice.apk off the device and set up a manual VoiceListener (as discussed here: Glass voice command nearest match from given list). When the voice command is detected an onVoiceCommand is called, I try to force a refresh of the menu by calling invalidateOptionsMenu() (no effect) or getWindow().invalidatePanelMenu(WindowUtils.FEATURE_VOICE_COMMANDS). This second one looks like it tries to pull up the menu but then instantly hides it again.
How can I dynamically change the contextual voice menu later on in the lifetime of the activity?
I actually just wrote a sample app and this is working fine for me.
Be sure to use onCreatePanelMenu() to create the voice menu and check
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS ||
featureId == Window.FEATURE_OPTIONS_PANEL) ...
to inflate the menu for both touch menu and voice menu.
To refresh both, in onMenuItemSelected(), make sure to call both invalidateOptionsMenu() to refresh the touch menu and getWindow().invalidatePanelMenu(WindowUtils.FEATURE_VOICE_COMMANDS) to refresh the voice menu. I just flipped a boolean on the first menu item selection, which I used to determine whether an old or new menu should be inflated.
What version of Glass are you running on?

how to hide ok glass label from google glass voice menu

Hi I am developing a application fro Google glass ,I want to hide the "OK glass" command which is essential to launch the menu on voice command so is there a way in which i can launch a menu options on voice command without saying the " OK glass " keyword every time.
kindly guide me on this.
You cannot do this at the moment using Contextual voice commands. In my opinion, it was for the best, otherwise the Glass user could occasionally select a menu item unintentionally.
Maybe you can implement an alternative using SpeechRecognizer, maybe you'll find this thread a bit helpful.
Here is an example on how to use a decompiled version of the GlassVoice.apk found on Glass:
https://github.com/pscholl/glass_snippets/tree/master/voiceMenu
which allows to display a menu (or not), display "ok glass" (or not) and add hotwords dynamically (or not). Offline without using the SpeechRecognizer API.

How do i display a progress bar for CardScrollView in Google Glass?

So I've got my little beginning of an app loading data from json into a CardScrollView. Sometimes this takes a few seconds, so I need a loading screen. Normally I'd do this with the progress action bar or a progress bar spinning around. I found a question around this:
https://stackoverflow.com/questions/20237873/google-glass-gdk-progress-indicator
So far so good, however I can't determine how to construct a layout for my activity so I see the progress loading and then when data load is finished, the card scroll view. What I'm doing now is first I set the loading view in the onCreate:
setContentView(mLoadingView)
Then later once the loader is finished I call:
mCardScrollView.activate()
setContentView(mCardScrollView)
Not only does this feel hackish, but it doesn't handle the case of reloading data. Normally I'd do this in android with a frame layout xml which would have the progress bar and list view in it and then toggle progress bar visibility / progress. But I'm not sure how to do this in glass. Maybe I'm not even following the right "glass paradigm". Any ideas?
Currently in the GDK sneak peek, you'll have to roll your own solution like you've already done. But you can track the feature request for a Glass-style progress here here on our issue tracker.

Is it possible to embed a command prompt in a win32 app?

In linux and when installing packages etc. There are some installers that have a progress bar and a dos window which shows the files being extracted etc. How can i add this window to my C++ Win32 programs so that i can have it showing the tasks im doing? I cannot find any documentation on MSDN.
Question: How can i add a console window (if that's what its called, sure looks like one) in my program to show the details of the task at hand being done?
Here is a window with what i am asking.. (personal info so I erased the details. :]
You cannot embed a real console window inside another window (although a windowed process can have a separate console window). While it looks like a console window / command prompt, it is just a matter of appearances. What you want to do is create a sub-window/control with similar characteristics as a console window and then redirect the console output from the application(s) being run to append to that sub-window. For more information on how to do redirect the console output in Windows, see http://support.microsoft.com/kb/190351.
That "dos window" is a regular edit control: CreateWindow(ES_MULTILINE, EDIT, ...
However, it has the font set to a fixed-width one (Looks like courier). This is done by sending WM_SETFONT to the edit control.
#user995048 says "You cannot embed a real console window inside another window". But "cannot" is a strong word! I can run an entire virtualized computer in a window if I wish. :) So one can quite reasonably intuit that there are ways of doing what you say.
Sure, it is true that what you've seen are almost certainly cases of output redirection into a custom widget, designed to mimic the simple appearance of a terminal. However...if you want to embed one application's window inside another, there are things you can look into which might fit. Cooperative methods exist like GtkPlug, for instance:
http://developer.gnome.org/gtk/2.24/GtkPlug.html
To actually capture a not-designed-to-cooperate app's window and throw it in your app would be trickier. But possible, just as screen captures and virtual machines are possible. Probably best to avoid that sort of thing unless there's really a cause for it, though...
Try this
http://www.codeguru.com/cpp/misc/misc/article.php/c277/
link. I think the solution provided is what you need.
I tried it many years ago and it worked. I have not tried it in newer versions of windows though.