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

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.

Related

How to send apk file from android device to wearable device?

How to send apk file from android device to wearable device?
Having studied the official instructions, I did not understand what is best suited for this and is anything suitable for this at all? It seems like DataLayer is suitable for this, but it seems like Asset, and understand what is needed for this. I am sorry for my English! The problem is that I need to write an application that will download a watch face from a third-party resource from a link. More precisely, it is, but the code that works on the phone does not work on wearable devices.
From what I know you have to sideload your apps.
There is a tuto, i haven't tested myself but it should work: install legacy WearOS apps

How to use driver.startActivity on IOS?

Hi I was building some tests for Android and now I want to run the same tests on IOS. Sometimes in my code I have to open google chrome then go back and launch the app, for that I use
driver.startActivity("com.consul.android.smartbeer.staging", "com.whirlpool.ted.View.SplashActivity");
and
driver.startActivity("com.android.chrome", "com.google.android.apps.chrome.Main");
My question is:
how can I use a similar command for IOS? I know that it has driver.launchApp(); but If I insert the Bundle_Name it doesn’t work. Is there another way?
To get quiet the same functionality for iOS with Appium you might look into using deep links:
driver.get('deep_link_url')
It allows navigating directly to appropriate screen of your iOS app.
However:
deep links should be implemented in your iOS application
it works only for Simulators at the moment.
You can track progress on getting it work with real devices here

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

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.)

Live-stream video from one android phone to another via bluetooth

I am intended to make an app that stream live videos from one android phone to other one via Bluetooth,i need a simple player and there is no need to save the file,just play it.
My knowledge about stream in java is not enough and I really don't know where to start!
Please help me in finding any solution. Any help will be appreciated.
There is a sample android project to do streaming live video and allows you take photos and record videos from remote phone via bluetooth.
BluetoothCameraAndroid
Android allows you to get frames as byte array using camera, you can use that api to get frames and send it across. But the problem is throttling the sending rate. That also has been handled in that project.
In marshmallow and above devices, you have to give permissions
manually in settings. This project does not include runtime
permissions
Xuggler is a Java opensource library that works with streaming and modifying media on the fly. you can start from it at:
http://www.xuggle.com/xuggler/

How to emulate/test bluetooth chat?

http://developer.android.com/resources/samples/BluetoothChat/index.html
As you know, the emulator does not have bluetooth support. My question is: is there any workaround to test the bluetooth chat from the sample?
The documentation states there is no Bluetooth support for the emulator. And you really should just test with devices if you have access to them.
I have never tried this, but I have read over before just finding a spare device. So if you are really stuck with just the emulator you can give this a shot. It's not a guarantee but it's something to look into.
https://github.com/cheng81/Android-Bluetooth-Simulator
Last I checked it supports:
switch on/off the "radio"
discovery devices (only other android emulators)
creating bluetooth services
connecting to bluetooth
services
You probably have to test/debug with real devices - IMHO there's no way to get bluetooth working on the emulator, not even a workaround

Categories

Resources