Android bluetooth data across multiple devices at the same time - java

I want one Android device to be a "host" device that transmits streaming audio data to x amount of other devices that have connected to the host device. I have an app that does this on iOS, but I'm unsure of how to approach this on Android.
Is it possible to stream audio from one device to x amount of other devices via bluetooth?
If so does Android have any built-in tools for transmitting data and connecting MULTIPLE bluetooth devices to each other?
As for the streaming, I imagine I would need to "packetize" the audio file and send it to the other devices. Does Android have a tool for reading streaming data?
It would be nice if there are some libraries available for this type of work.

Related

Audio Live stream from Android to my laptop

I have a project where I want to implement live audio stream from users with Android phones in my LAN Network and receive them in my laptop, off which I can filter, reduce noise, control volumes of each and write the audio to the speakers.
Please help. If possible Android and Java.

How to send serial data via Bluetooth to an unspecified device?

I use the following code for an Arduino Uno:
#include <SoftwareSerial.h>
SoftwareSerial device(2, 3);
void setup()
{
device.begin(9600);
}
void loop()
{
device.println("33,89,156,203,978,0,0;");
}
No specific device to send to is set.
If I want to receive the data on my laptop (running Ubuntu 14.04) I simply call:
sudo rfcomm bind rfcomm0 [MAC ADDRESS] 1
and
screen /dev/rfcomm0
in another terminal instance and it works.
How can I achieve the same behaviour with an Android app?
The following example code specifies a device. I cannot find any other code. Additionally it only works when I listen on the laptop for an incoming connection like this:
sudo rfcomm listen rfcomm0 [MAC ADDRESS]
I want my Android app to work exactly like the Arduino example. How can I achieve that?
Unfortunately Android doesn't appear to have low level Classic Bluetooth APIs which would allow you to do broadcast type behavior. This makes some sense as Android is intended to go into a power limited devices and active radios use energy. If you are required to use Classic Bluetooth (3.x) and Android to handle sending or receiving broadcast type behavior you'll probably need to write a custom ROM.
However there is specification called Bluetooth Low Energy (4.x) allows for less energy consumption but slower/less data throughput. Specifically the Advertising mode. Android devices which are scanning can pick up the short advertised data packet broadcasted by a device called a 'beacon'. Protocols which use this mode are Apple's iBeacon and Google's Eddystone.
Look here for sample apps involving Advertisements:
https://github.com/googlesamples/android-BluetoothAdvertisements
https://github.com/devunwired/accessory-samples/blob/master/bluetoothadvertiser
Also note that Android devices don't always support BLE Peripheral Mode which is what you will need for your Android device to act like beacon.
Related link:
Can an Android device act as an iBeacon?
And a nice list of what devices have been tested:
http://altbeacon.github.io/android-beacon-library/beacon-transmitter-devices.html
So in your case you should still be able to use your Sony Xperia Z3 as a Scanner, but will have to buy/build a beacon for testing.

Receiving audio and video on android over HDMI or USB connection

I am rather new to Android development but I wish to receive audio and video content on my phone from a pc. I am trying to record gameplay on my pc, and do not have the money to buy the hardware recorder, and I can not do screen capture and maintain acceptable fps.
What I had in mind was to send my screen and audio to my phone like a second screen, where my phone will handle the saving process, reducing cpu load on my pc. I don't think android phones can receive hdmi output, but I can do this with the USB via the android adb library "pull" command. However this requires that the file already be saved.
I can't seem to find any other way to do this, can anyone recommend a library I could use?
No. USBs are slow. And there is no way to transfer what's on your computer screen to your android device without first recording it on the computer itself and then having to pass through the slow USB device and then slowly writing it to your phone's hard drive. You'll be recording at a solid 0.5fps by then.

Remote monitoring system for CAPD

I know there are devices out there that monitors i.e. glucose of a CAPD patient. My question is do you know if I can read/access those data? I'm planning to create an Android app that read those data but I am hitting a wall as I dont know other devices.
You can read data off many medical devices, BUT the interfaces differ and the communication protocols also differ, AND not all devices support outside data collection. You will have to go device by device and write a device driver for each.
Kind of like you PC printer. Can they communicate with PC? Of course they can - but some connect over USB, some over PS2, some over LAN, some over Wifi, AND almost all of them require a device driver to 'talk'.

Creating our own A2DP profile using java

Many of us have used bluetooth headset/earphones or alike devices having in-built programmed A2DP (advanced audio directing profile) so that they can recieve streaming audio from a standard device.
But I wanted to design (code and implement) my own bluetooth A2DP profile using java which can be installed on a mobile device so that very device can recieve and ouput streaming audio recieved from another device.
For instance: My laptop has a bluetooth stack as well as my cellphone has.
As an ordinary cellphone it does not have a A2DP profile
But what if my cellphone is connected to an amplifier and I want to dorect my laptop's audio to that amplifier wirelessly.
Proposition: if I design a installable java based (java, because its widely accepted as mobile device's supportive language) A2DP bluetooth profile then my cellphone can be used as a bluetooth based audio reciever.
But the main question is how and from where to start off?
why do not you use your Bluetooth Headset instead.This ways you can connect your bluetooth device to Amplifier and it can stream audio from both your cell as well as laptop.

Categories

Resources