Adding the "ok glass contextual voice menu" within an immersion activity - android

Is there a way to insert the "ok, glass" trigger into an immersion activity on Glass? I want to make the launch of my application as seamless and quick as possible. Making an immersion application seemed to be the way but I can not find a way to bring up the "ok, glass" footer trigger within my activity to launch my application menu to be navigated hands free. Any clue as to how this works?
Note: I have a voice trigger to launch the app from the Glass home screen.
I'm not creating a card but rather just using an XML layout as I'm changing text on the screen dynamically to user interaction using an AsyncTask. Any advice would be great.

Contextual voice commands are not yet supported by the platform, feel free to file a feature request in our issues tracker.
UPDATE: as mentioned in the comments and the other answer, contextual voice commands are now part of the platform for Immersion: https://developers.google.com/glass/develop/gdk/voice#contextual_voice_commands

As of XE18.1 and GDK Preview 19, contextual voice commands are available in the GDK. Documentation is available at https://developers.google.com/glass/develop/gdk/voice.

Related

Android - how can i make a minimizable app?

So , i want to make an app that can i can minimize and move over other apps.
I saw this feature on the twitch app and did some research but didn't find how they did it.here is an example of this feature.
Thank you for your answers in advance.
The example you showed is Android's Picture-in-Picture feature: https://developer.android.com/guide/topics/ui/picture-in-picture
However, it's not exactly a minimized app. Picture-In-Picture mode is simply a way for your content to be shown when users switch to other apps.
Due to this, there's a number of restrictions and guidelines, such as you're encouraged to hide all UI elements when in PIP mode besides the content that is displayed.
You're allowed to provide a list of Actions for the user to interact with, such as media controls. But note that there's a limit to how many actions that can be provided.
So it's not exactly a minimized app in the sense that its a smaller version of your app. Instead, it's more like the main viewing content of your app has been plucked out of your app and it's displaying over other apps.
If that's all your app needs, then Picture-In-Picture mode will work well.
But if you want a real mini-version of your app, you're going to have to consider Floating Windows instead. Floating Apps create a UI through a Service instead of an Activity.

Using google speech recognition on android wear without showing specific ui

This is my first question here on stackoverflow, so sorry if i am doing something wrong.
I have an app on android wear, where the user shall select an item from a list.
I want to enable the user to select the item via voice commands. I managed to do it as suggested in the google documentation, but i have to implement a button to start speech recognition, and it will show up as a fullscreen activity.
I want the user to be able to see the list while speech recognition is active. Is there any solution for this?
EDIT: I might have found the solution i was looking for. It is the speech recognizer, which seems to be able to do just what i want. I will have to dig into that and will update this post if it is the solution.

App above all anothers

with which functionality of Android is it possible to make a App callable from everywhere like the Facebook Messenger Chat:
You cannot have a "full app" above all others. However, you can achieve a convincing simulacrum with a trick.
Applications with the android.permission.SYSTEM_ALERT_WINDOW (displayed as "draw over other apps" in Play Store) can create windows from a service and show them over all other content.
There is an open source library called StandOut which provides this behavior in an easy to use manner. You might want to take a look at it.
That's called Chatheads and uses a custom Window backed up by a Service. Then you need to implement your click logic and bring up an activity (with an Intent).
A good tutorial is here

Can an Android app interact with another app?

I want to be able to tap the statusbar and the contents in the displayed app to be scrolled up to the top.
Is it technically possible that an app intercept my tap and send the appropriate command to the active app? I have noticed for example that AntTek quick settings shows a drop-down window when swiping down from statusbar. While using the app I did also notice that even by just tapping the statusbar (before beginning to move the finger down), the app seems to already interact with the touch as it dims the screen brightness in preparation to display it's "window" (sorry I use the MS Windows term), so clearly a statusbar tap CAN be sensed by an app.
Starting from this, I wonder if such an app could then send a message to the active program telling it to scroll up.
Is that possible? And if yes, the message must be customized to a particular app (let's say the browser as the most important) or is it standardized so the apps speak the same language between themselves?
I am not a programmer so answers with codesamples might be less helpful than a plain english explanation. Finding out that is possible would lead rather to pursuing a programmer to implement the idea rather than starting to develop it myself.
Thanks :-)
There is an XPosed-module which seems to do exactly what you want.
To use XPosed-modules, you'll need to root your phone and install the XPosed-framework.
The XPosed-module is called "Statusbar Scroll to Top" and its repository can be found here:
http://repo.xposed.info/module/com.mohammadag.statusbarscrolltotop
This will work for almost all app-lists, but for example won't work for browser-content.
If you want to scroll to the top of the page in a browser, then you'll probably do best to get a browser which can do that on its own. (For example Habit Browser has it built-in and respective plugins are available for Firefox.)
Yes it is possible. HiroMacro and Frep can do this, but it requires root. https://play.google.com/store/apps/details?id=com.prohiro.macro&hl=en
(how do they simulate mouse and keyboard interactions on other applications? i have no clue :/ anyone?)
Is it technically possible that an app intercept my tap and send the appropriate command to the active app?
No. One app cannot send fake input to another app, for security reasons.
An android app comprises of several activities. Each activity display a GUI that allows the user to perform a specific task. To take the user from one activity to another, app must use an Intent to define our app’s intent to do something.
An intent can be explicit in order to start a specific component (a specific Activity instance) or implicit in order to start any component that can handle the intended action.
Interacting one app to other app in android
google docs link

Android App - mediaplayer always available

this is my first post on stack overflow so hoping you can help.
We are developing an Android App, that requires an audio player to always be available, no matter what activity you are on. Ideally, we want this to be a "pop up" style player that is accessible when you tap the screen or tab an always visible button (e.g. on the action bar). However, the player needs to overlay the activity you are on, and continue playing the audio as you move between activities and (ideally) multi task within your device.
I have looked into various options for this, and wonder if a service is the best way to go. The other option I am considering is a transarent activity. But I am open to suggestions!
Can anyone offer any guidance? Thanks in advance.
I think that service, playing the tracks is the best way to go.
For the player visual interface, you should have one view, which will be included wherever you need it.
When you open this view, you will get the information from the service (what track are you on, where exactly in the track) and initialize with those results.
At least this is my suggestion approach to the task. Good luck!
Have tried considering making it an android widget? It remains on the home screen and user can play music and get back to other tasks.
But not sure if it will meet your overlay criteria(Which I quite didn't understand.. :))
Check out Androids MediaPlayer-Class. This should prevent you with all nessesary playback functions. On how to create your player-controll-interface on Androids Action-Bar, check Googles Tutorial. But note that the ActionBar is available since Android 3.0, not in previous version!

Categories

Resources