Why does Android (Jelly Bean) ignore an additional RecognizerIntent (Kõnele)? - android

I installed the open source Kõnele (source code) for the purpose of studying how to write and register a custom speech recognition service. As first step, before delving deep into the source code, I tried to verify that it indeed works as I expected. So, I went to my phone's System settings > Language & input > Voice recognizer and selected Kõnele as the system's recognizer:
I then tried various application in the phone that present the keyboard with the microphone option, expecting that when I touch the mic symbol, Kõnele will be used. Instead, however, the system always pops up Google's built-in voice search.
Why is that?
Have I missed additional settings that I need to configure (as a user) in order to make this work?
Is this a "by design" limitation of the Android OS?
Is it possible to tell Android to always use a different RecognizerIntent that isn't Google Voice Search? If so, how?
Update: I managed to find one app that seems not to ignore the additional RecognizerIntent: Google Maps:
To me that suggests that this has something to do with Android intent resolution. But then why do some apps do not trigger that "Complete action using" dialog, while Google Maps does?

I think you have done everything that you can as a user, but an app that wants to use the speech recognizer is of course free to ignore your configuration. E.g. it can directly choose a particular speech recognizer implementation by constructing the recognizer something like this:
SpeechRecognizer.createSpeechRecognizer(this,
new ComponentName("com.google",
"com.google.Recognizer");
);
In this case, your only option is to uninstall or disable this particular implementation and hope that the app falls back to the general method:
SpeechRecognizer.createSpeechRecognizer(this);
Unfortunately, at some point Google started promoting the idea that apps directly link to the Google speech recognizer (see Add Voice Typing To Your IME). So many keyboard apps now do that (see e.g. the issue that I raised with SwiftKey), and your only option is to find one that does not...
It can also be that the app sends an intent that Kõnele does not support (the supported intents are listed in the manifest), but which would make sense to support in a speech recognition app. In this case it would be a feature request for Kõnele.

Related

Replacement of text in any EditText view of any app

There are apps like Texpand which are able to replace text in any EditText view - even of views which are part of other apps. Looking at the app-info this is happening without any requested permissions. I'm scratching my head how this is done - my (rookie) understanding is that each app resides in its own separated sandbox, so it should not have direct access to other apps views?
I looked for possible global events which could be provided by any central manager, but found nothing. More likely I would expect the replacement to be done passively (that means without the app being aware of the actual EditText), but checking for possible bindings or user dictionaries I found nothing promising either.
Looking at my Android system it seems the app is neither using permissions nor installing a keyboard. Additionally I don't see any entries in my user dictionary. Does anybody have an idea how the described functionality could actually be achieved?
Texpand's Google Play posting indicates that it uses Accessibility Services. Accessibility services are a set of APIs Android offers to help build tools to allow non-standard interactions with apps (such as audio descriptions/voice commands) to expand access to the platform to people with an impairment that might otherwise prevent them from using a touch-screen/smart-phone.
These include the ability to take action on the behalf of a user, such as filling in text fields.

How do you convert a standard Android IME to an Android wear IME?

making an IME for android wear. i've got a few questions before i go about doing this.
i have a keyboard IME already designed and written.. for Android. (i was told to go ahead and write a normal android IME before using it on android wear)
so, i have this IME and zero idea of where to go next to get it on the android wear. do i just install to my phone and go into development mode and enable the IME on the watch? do i add lines of code somewhere to make it specifically for the android wear?
i know for a fact you can use IMEs on the android wear. there's things everywhere about how to install minuum or whatever and enable input methods on the watch.. my question, are the keyboards for android wear all full-blown SMS apps that just have a keyboard in them as part of the app? do i need to write an SMS app? or will my keyboard just pop up when i hit reply to a text message popup on the watch? (such as the normal popup from the standard android messaging app that comes with the phone.. as currently, hitting reply opens it on the phone, whereas reply with voice lets you talk to it.) or will it bring up another option to reply with an IME?
any help is useful. thanks so much. i know those are probably stupid beginner questions, but i must be overlooking some shred of information somewhere because i'm unable to answer this myself. any relevant links or info would be extremely useful. if any more info is needed, just ask.
IMEs rely on editable text fields, such as made with EditText. You'll note that no included app (nor the vast majority of installable apps) use any editable text fields as there is no concept of a selectable IME on Android Wear (as noted in the Minuum on Android Wear instructions).
Therefore while you could publish and get a IME installed on Android Wear, users would never be able to select the IME (there is no UI) nor would you be able to use it to replace the default reply option (as that is system behavior, not something controlled by the current IME).

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.

How to stream screen content to Chromecast

I have an Android app that I would like to add the ability for the user to "cast" what is displayed on the app to a Chromecast. It could just be a local JPG but I would prefer the user to actually see actual "live" content of the app. Does anyone know if this is possible? I know there are apps like AllCast but wasn't sure if they were using supported features of the SDK or if it was a hack. I found some mention of the Default Media Receiver but could not find any documentation on how to use it with local content. Any advice or direction would be appreciated.
There is no Cast api to do that directly; you can look into WebRTC or something of that nature.
The way I do it is to use the Presentation class. The only problem is that you do need to use the ChromeCast app to start screen mirroring before you start your app.
I have not yet found a way to start mirroring my app (or, to be more precise, to show the contents of your Presentation class) from a ChromeCast UIButton within my app, even though I have been able to get that cast button working and connecting ... just not to start app-mirroring when using only my in-app chromecast button.

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

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.

Categories

Resources