Combining audio with data control from android over bluetooth


What is the best way to send both SPP data and audio from android to a bluetooth device, except using JAVA?

I was wondering if i can create an app using MIT App inventor to send both SPP data and Music over bluetooth to a bluetooth module such as RN52 which supports both SPP and A2DP profiles? I have already done the first bit regarding SPP using another bluetooth module then i decided to stream also music over bluetooth, but not sure if MIT App inventor supports that, any ideas? (something like this will be great !! sending music as Bytes

What about "send list of bytes" block in MIT App inventor? Could audio be sent over it and how if yes?

Thanks in advance!

What did you think this was, an Android programming forum? ? ?

It's rather useless to send audio data to an Arduino in the first place due to how slow most of them are.

Hi. I started my task to master Arduino to Android Bluetooth communications 3 years ago. It took ME about 4 months to learn the Android Studio and Java tree structure before I had success to deploy Android application I had written from scratch to connect to Arduino through a HC-05. I use it for my keyless entry, automatic start for my old trucks since I can't stand carrying around keys and losing them anymore.

The Android Studio has extremely poor examples and very vague information - I actually struggled to find active forums with other active programmers.

Never had I struggled so difficult to try to get the BLE 4.0 modules to work with Android. The Android Studio core forces the application to request user permission to a GPS LOCATION (for reasons unknown) just to connect to a BLE device. I tried night and day for months to figure out with little progress and plenty of failure - including scavenging the internet to find others to help me on the Android side of BLE 4.0

Get BLUETOOTH to work with Arduino is a piece of cake, most the information is there and you can connect to other BLE 4.0 devices, should you be able to figure out the other device to connect to that ISN'T an Arduino.

You can stream music, data, video - do whatever you want - until it disconnects, then prepare for months worth of trial and error to figure out what microwave oven suddenly turned on that interrupted your bluetooth data stream. Then have fun "GRANTING PERMISSIONS" to reconnect to the same BLE device.

Maybe there is new information since November 2016 since I stopped trying, due to my lack of success - I don't know. But I spent a whole bunch of time, trying to learn figure it out - and am very disappointed, and failed. I hope you have better success than me. The tutorials make it sound like "OH YEA JUST CONNECT THESE 5 WIRES, and you can just turn any light on in your house!" but beyond making a light blink, a few times - after the devices refuse to automatically re-connect, is a game I am no longer interested in playing.


thanks for your reply and sharing your experience..

using bluetooth connection with any other device is all about understanding both profiles on both sides, as for for data control we need SPP profile which works like RS232 and for audio we need A2DP..

after searching for few days i think combinig both audio and data control over bluetooth is one of the challenges that face android programmers and as you said there are lack of tutorials even using android studio which i do not prefer coz i am not JAVA fan..

i was lucky maybe at the beginning coz i learnt to programm an app using MIT APP inventor in just two or three days and it worked perfectly, then i decided to develop it and add the audio bit , but as i see MIT APP inventor looks like doesnt support this bit at the moment..

i posted my question in many forums and got unfortunately no answers, so i am thinking now maybe to use wifi for audio

I can share my experience, to transfer audio to arduino, you need to convert it from analog to digital. But I don’t know how to do this in the app inventor

Ferhad88: What about "send list of bytes" block in MIT App inventor? Could audio be sent over it and how if yes?

It depends on what kind & how many bytes of audio you want to send. If you want to transfer HD audio in a very short time, then SPP profile may not be a good option. A2DP profile implemented compression and decompression mechanism (e.g. SBC) which makes the audio transmission more efficient, SPP profile doesn't have that advantage. Otherwise, if the audio is a file with fewer bytes, you can try transferring over SPP.

Not familiar with MIT app inventor..