Modify Bluetooth Chat Sample Code to connect with non-Android Devices - android

I am making an App based on the Sample Bluetooth Chat given on the Official Android Developer website. My App works fine whilst chatting with another Android Phone. However, it does not work when I connect it to a non-Android Device (namely some electronic circuit that my team has made).
Internet Research has shown that the Sample Code is only meant to communicate between two Android Devices.
So, how do I change the Sample Code to make it work with other non-Android Devices as well.

I figured out the Answer through analysing the source-code of the BlueTerm App. Effectively, I only needed to change the UUID that I was setting in the App from fa87c0d0-afac-11de-8a39-0800200c9a66 to 00001101-0000-1000-8000-00805F9B34FB"
I'm not an expert on this area so I can't say WHY that is the case, but it does help solve my problem. The BlueTerm SourceCode is available on Official Download Website of Pymasde

the UUID is specifically for serial port connection and it's a standard.

Related

Android App code for BLE UART communication

I am working with a peripheral device that communicates with an app via BLE UART.
To test and modify the peripheral’s firmware, I want to find a starter Android app that can communicate with the peripheral. I want to be able to modify the app along the way as I modify the peripheral firmware.
I got the Nordic nRF Toolbox app working in Android Studio and running on my tablet. However, when I look through this project it is far too difficult for me to understand right now. I have worked through several tutorials that offer a far simpler solution, however not a single one of them has ever fully compiled correctly at the end – I assume they are all out of date. So it has been a difficult journey so far.
I need the app to be able to scan for devices, and allow the user to connect to one – and then be able to communicate with the BLE peripheral via UART.
Can anyone point me to (a) a starter app with code on GitHub or similar, that they have tried recently, or (b) a tutorial / walk-through, that they have successfully completed recently?
Thanks in advance for any suggestions
Garrett

Does a Korg Microkey Air work over Android Bluetooth?

Their website documentation stated that operation is not guaranteed. Was there a known instance that it did work or not? I've seen this product works in IOS Bluetooth and Bluetooth is supposed to be product agnostic. So I don't understand why operation is not guaranteed.
I got the below information from a friend:
Well, it seems the keyboard supports Android just fine.
From this(https://www.amazon.com/product-reviews/B01IP4ENCS) page: "I
held off buying this keyboard for a long time because I read comments
that said it did not work with Android. But that is not correct (at
least in 2019) ... the keyboard works just fine with Android over
Bluetooth. I tested with Android 8 and up, using the app FluidSynth
(which allows you to use downloadable sf2 soundfont files).
The only tip: you must connect to LE Bluetooth from inside the
Fluidsynth app, not from Android's system."
And this(https://pianopenguin.net/best-bluetooth-midi-keyboard/) page:
"This simply means that you can connect it with any Mac, Android or
Windows device that uses Bluetooth."
Therefore, this proves enough that the Korg microKEY Air does work on Android Bluetooth.

Communicating with an xbee module using Android 3+ phone

I want to connect my Xbee module to my android phone and communicate with it by sending AT commands.
I do know of the USB host facility provided by Android phones, but I do not know how to send data to it.
I have the java-Xbee API and I am able to talk to the Xbee using my computer but since my project involves using the Android OS, any help on this topic will be appreciated.
According to this Google Code Page, the java-Xbee API requires Java >= 5 and RXTX. Considering those two requirements:-
RXTX on android is not an out of the box lib and may require some hacking which may or may not work.
I'm not a Java VM expert, but i know desktop OS JVMs work differently from Dalvik.How well would Dalvik run code developed for JVM? Here is a nice StackOverflow topic discussing the two.
Faced with the above challanges, are you brave enough to boldly go where no man has gone before?
Could you also consider the following well documented and supported approaches:-
Ytai Ben-Tsvi & Sparkfun's IOIO-OTG
Saves you the headache writing android 3.1+ USB host code and thus allows you to use cheaper phones that run droids 1.5 to 2.3 (without hacking the latter).
Digi's WiFi to Xbee
Allows you to link your android phone (or any other programmable wifi enabled computer) to your device over the internet.

RFCOMM based bluetooth communication between two android devices

For some requirement analysis I want to test a RFCOMM based bluetooth communication between two android devices.
I need to send some 1 MB of data to from Android device 1 and Android device 2 should receive it and display/save the data. I need to do this using Bluetooth SPP (RFCOMM) profile .
Can any one suggest some available app/code to do this?
Under the bluetooth documentation for Android Developers. There is the Bluetooth Chat application example which will contain an activity for facilitating the communication between two devices, as well as the service connection. This will be your best example for what you are looking to do. Here is the link to the Tutorial, you will also find a link to the BluetoothChat application under here:
http://developer.android.com/guide/topics/connectivity/bluetooth.html
To see the BluetoothChat application you will first need the Android SDKs, and then you will be able to find the source.
Generally, do some research first, as here is another question of the same sort that has a little more detail, and shows the user made a good attempt first.
Bluetooth Examples for Android
After following the BluetoothChat application, or the written tutorial on the Android Docs, if you run into bluetooth errors, and other problems with your code. Stack Overflow is definitely the way to go for receiving quality answers to your troubles!

Android Bluetooth connection to embedded device

I am creating app in which I had to send data to phone via embedded device.
Is it possible to send file via embedded device to Android phone with Bluetooth?
I don't find any of example of it and I think I need another embedded device like dongle for implementing obex protocol.
You need to read in the bytes of the file that is being submitted by your device. Sample code that connects the android to a separate device can be found in this SO post. There is also a robust documentation of the API as well as a specific sample application. Be aware that many people are finding issues when using the sample application to try and connect the android to a separate device. The issue is explained in this SO post (see the accepted answer), but essentially the connectivity problem is caused by calling listenUsingRfcommWithServiceRecord.
I myself ran into problems with Bluetooth, but using the above resources have been able to quite successfully connect my android with an embedded device. Hopefully this aggregate of information will be of use to you.
You can use the very common UUID for SPP devices: ("00001101-0000-1000-8000-00805F9B34FB");

Categories

Resources