Android App code for BLE UART communication - android

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

Related

Which one do I have to use if I want to make bluetooth connection between Android app and Arduino nano 33 IOT? (BLE or Classic)

I am trying to make a android app which can make connection with Arduino nano 33 IOT device.
I realized that Arduino nano 33 IOT has BLE module on it, so I used <ArduinoBLE.h> to advertise the device.
When I was making android app which can make connection with Arduino nano 33 IOT, I tried two different ways. first one is use classic bluetooth(BluetoothAdapter), and the second is use BLE bluetooth(BluetoothLeScanner).
But it is a little confusing which one I have to use. If I use classic, the App can search device but connect. If I use BLE, the App cannot even Search devices.
I asked a question on stackoverflow one week ago, and a kind person answered me that I have to use BLE.
So I tried it, but it is still not working...
is it ok to use classic version to make connection with BLE? or not?
You can use either BLE or classic Bluetooth on the Arduino nano 33, however, my recommendation is to use BLE as well. This is because you'll find more resources online on how to develop and use BLE, and also your application will end up using less power (hence the name BLE).
I would start with the Arduino BLE page itself which you can find here:-
https://docs.arduino.cc/tutorials/nano-33-ble-sense/ble-device-to-device
The copy the peripheral example which you can find on the page above. After that, as a sanity check, I would use the nRF Connect app on Android or iOS to make sure that the peripheral example is working as ukBaZ suggested. If everything is working by then, then you're good to start developing the Android app.
The Android app isn't going to be straight-forward but luckily there are a lot of resources that can help you get started, including the following:-
The ultimate guide to Android BLE
BLE programming on Android tutourial
Making Android BLE work
After that you should hopefully be able to connect and talk to your Arduino nano from an Android app. Remember that your Android app has to be the central that connects and reads the data, while your Arduino nano has to be the peripheral that advertises and hosts the data.

How can I create a OBD 2 Android application like torqe? Are there any software simulators available or I need a car to test application?

I want to create a OBD 2 android application like Torque. Are there any software simulators available for testing or I need a car with OLM adapter to test the application?
I got to know about the github library https://github.com/pires/android-obd-reader/releases/tag/2.0-RC4 , is there any other library/tool available or I can get all possible data from this?
I did run into a obd II simulator I found in the google app store which I installed on one of my development phones https://play.google.com/store/apps/details?id=com.beastovest.obd.simulator
On a second phone I installed the Car Scanner from the store (free)
https://play.google.com/store/apps/details?id=com.ovz.carscanner
The setup is pretty simple. Just pair the device from the simulator to the scanner.
In the simulator I can change engine values and I can see the commands and the changes in the scanner. You can see the rest of the communication as well. The simulator is $5. Very nice for that price. I can also see the complete communication which I need for my app development. I also speed up the understanding of the ELM327 commands. Here is the spec: https://www.elmelectronics.com/wp-content/uploads/2017/01/ELM327DS.pdf
Hope that helps anybody.
Yes, there is a free software simulator with simple GUI, called OBDSim. It works on Windows, Linux and OSX (among others).
There's also a hardware simulator ECUSim 2000, which isn't free and also isn't cheap.
That GitHub repo you linked to is actually an Android application, capable of acquiring OBD data from a car. It is not an OBD library, however it is based on one (by the same developer, pires).
Now to (partially) answer your second question: no, you can't get all the data OBD offers (PIDs on wiki, but there are more manufacturer specific ones) using this library. However you can get all the interesting data that you'll need if you won't be doing something really specific. I don't know if there are other similar libraries but I found this one well written, well documented and well performing.

Android OBD-II Bluetooth API sample code not working

I need to develop an Android app that retrieves data from a OBD-II Bluetooth dongle. As first step, I downloaded the API from https://code.google.com/p/android-obd-reader/ and tried to run the Sample Application in it, but it didn’t work for me. Can someone tell me who used that API and where is the error on that code? There are lots of packages and classes on it. I’m unable to clarify them.
It is very difficult to know which can be your problem. I have used the library you mentioned and it includes an application example that can help you to understand how the library works.
I recommend you to use the application called obdgpslogger (http://icculus.org/obdgpslogger/) that includes an OBDSim module (http://icculus.org/obdgpslogger/obdsim.html).
This module can work as an emulator of the ELM327 device. Using it under linux you will be able to emulate a Bluetooth ELM327 dongle. Using this application you will be able to get a log the Bluetooth connection and disconnection, the configuration AT commands sent to the ELM327 device and the querying rate.
I think it will be more easy than using a real vehicle.
I know that it takes some time to understand everything, but you can do it.
I hope it helps.

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

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.

Android Bluetooth HID implementation on different OS

Well, I believe this should be able to be implemented on the Android.
Recently, I found some Android developers created the Android remote controller(KB/MOUSE) app by
installing an app onto the server side(could be Windows or Mac or Linux) system and interact each other by bluetooth.
However, I believe it shouldnt be necessary to install an app onto host side if
we can take advantage of standard Bluetooth HID profile.
I have implemented the Android Bluetooth HID application which can make your android device play as a bluetooth kb/mouse input device.
to control my Ubuntu without installing any host side daemon.
The engineering approach involves Bluez deeply so it doesnt work on Mac or Windows.
Please bear my lack of bluetooth knowledge. I am really curious about the possibility of this matter.
If any of you has any approach or idea about this, please kindly share.
Thank you.
well, it seems this question is not yet implemented by the developer.
However, if any of you is interested in how to do this for Linux system. Feel free to write me an email. I would be happy to share the skill.

Categories

Resources