Speech recognition and speech to text on Android without any Google services - java

I am trying to make an application which uses speech to text for command input. I am making this for Android 6.0.1 and 5.1.1. I started by trying the examples with Google services, but none of them seem to work on my devices. Most of the time there is no clear error or a crash. I have gotten the no network error while using wifi and mobile internet. For the record, I did try to use the Google app speech recognition directly, but this gave no error nor answer. After that I have tried other examples which seem to not use Google services. I would also prefer for the example to work offline, but this is more of a preference than a requirement. I am looking for an example for android speech recognition which does not use any of the google services.
Some of the examples that I have tried:
Did not work on a device without Google -
https://github.com/gotev/android-speech
I got a ERROR_INSUFFICIENT_PERMISSIONS error (RECORD_AUDIO and INTERNET were allowed) -
http://www.truiton.com/2014/06/android-speech-recognition-without-dialog-custom-activity/
My main question is if such thing is at all possible and if yes then how (an example please)?
edit 1:
Fixed the insufficient permissions error using the example from:
https://inducesmile.com/android/android-6-marshmallow-runtime-permissions-request-example/
Now I am getting ERROR_CLIENT error (I have no idea what it means).
edit 2:
the project
logcat output

Android devices ship with Google Mobile Services and some platform level functionality, such as an implementation of a RecognitionService which is used by SpeechRecognizer. The built-in service has support for offline functionality (and you can actually specify via option you prefer offline use). When not using offline support, it will need INTERNET permission.
However, your issue is most likely with the RECORD_AUDIO permission, particularly on Android 6+. Starting with Android 6 (Marshmallow, API 23) you have to use the runtime permissions model to gain access to any dangerous permission (which RECORD_AUDIO is.)

Related

How come Java TinyB does not see the same devices hcitool does?

I want to write a Java app that scans for a specific BLE device. I decided to use TinyB library and start with testing some examples.
Unfortunately, these do not see my device (it does not show up in BluetoothManager.getDevices()) even though hcitool lescan shows it. Examples can detect my phone, so it looks like library works, but not for BLE devices.
How do I make it find the same devices hcitool does? Maybe I should use some other library?
I guess I'll be polling hcitool lescan and messaging my app whether device was found.

MapBox Android SDK: How to download offline map during app installation?

I am new to the development. At the moment I am working on Android app that is supposed to allow navigating offline. I am using MapBox SDK for this app.
Currently I am searching for how to download an offline region during app installation. As of now I have found solely examples on how to download a region while you are online. But is there a way to provide a chosen region from the start, so that a user isn't obliged to have internet connection to start using the app? And where are downloaded regions stored on the device?
Also Offline plugin seems a bit obscure - https://docs.mapbox.com/android/plugins/overview/offline/
I could not find many examples of its implementation.
I have already followed exemples from official documentation - https://docs.mapbox.com/android/maps/overview/offline/ But this doesn't solve my problem. As it shows downloading a region while being online.
Ideally I would love at the app launch to check connection and if offline, provide user with preloaded app (downloaded during app installation). If online update all resources at the background.
The type of implementation you’re referring to is called “offline sideloading.” It is definitely possible as long as you’re building with one of the more recent versions of the Maps SDK. This section of the documentation goes into greater detail on this process: https://docs.mapbox.com/android/maps/overview/offline/#offline-sideloading
⚠️ Disclaimer: I currently work for Mapbox ⚠️

FRONT_CAMERA not supported d error: Video Chat Feature powered by Applozic

I have the following issue (since about a week) and unfortunately I have not been able to resolve it:
I'm using applozic especially as a video chat feature for my app. I want to deploy it on an android 6.0 powered smart glasses devices. The app starts, connects to the applozic server, all functions from my app work well and then, when I try to connect a WebRTC video call, this is what happens:
01-31 11:02:41.331 3580-3580/com.package.name W/System.err:
java.lang.IllegalArgumentException: FRONT_CAMERA is not supported on
this device [...]
Audio works, the chat feature works, so I "believe" the error message that is thrown. Is there anything I can do from my side to fix this issue, or is applozic simply not supporting devices that only have one camera?
I already tried the following:
Uninstalled and reinstalled the camera app
Installed a different android camera app
Added all additional manifest permissions I could think of
Logged into the web app (Java Script API) with the device and it works
Tested it with 5 different smart phones and it worked well, which made me
believe applozic does not support devices that only have 1 camera.
Compiled + Targeted a higher and a lower SDK
After contacting applozic (they responded very fast what I appreciated), I was presented with a workaround approach by inserting a modified audioVideo module. After tweaking this module a little bit, I'm now able to use a device that either only has a front, or back camera when doing a live video call.
So I suggest that if you run into the same issue, you contact applozic support: https://www.applozic.com/ and refer to this stackoverflow thread.

How to make MediaBrowserService accessible from Android Auto?

I have implemented a MusicPlayerService by following the official guide from the Android Developers site. At multiple places, I have found the information that this should be enough to make my app ready for Android Auto.
But if I open that (just the phone interface because I don't have a compatible car at the moment), the list of music providers just contains Google Music and the already installed VLC media player. To verify I also downloaded, compiled and installed the Universal Music Player example, which isn't showing up either.
Do I have to enable something or even upload the app to Google Play first?
EDIT: I now tested it with the Desktop Head Unit and it works. Afterwards the service is also visible on the phone interface. But this is not the expected behavior, right?
Only apps installed through Google Play will be shown in Android Auto. If you want to test your app with the phone interface, you'll need to enable developer mode and the 'unknown sources' option in the developer settings.
https://developer.android.com/training/auto/testing/index.html#phone

Google Play Services "Not Authentic" on Glass

I'm attempting to get a user's current location on Glass.
Calling mLocationClient.connect() fails without any resolution. Then I checked if Google Play Services was available on the device with:
GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
This returns ConnectionResult.SERVICE_INVALID, which according to the documentation means that "The version of the Google Play services installed on this device is not authentic."
The Setup Google Play Services SDK guide does not describe that scenario.
Does this appear to be a bug on Glass itself? If so, I'll file a bug report.
Google Play Services is not available on Glass at this time. You may have unpredictable results if you attempt to use it, or related features.
If this is something you care about, please let Google know. File an issue in the Glass platform issue tracker and, if possible, describe a use case you're working on that requires it. This helps the Glass team prioritize features.

Categories

Resources