Finding Services of peripheral - android

I'm working with a Laird BT900 Bluetooth dongle which I can program to be a peripheral. When I add a service to it I can find it with a Bluetooth explorer on windows but on android I can find them.
Anyone knows what the problem can be? I'm open for suggestions.

What tool are you using on android? I generally use Nordic Semiconductor's NRFconnect tool for android to debug these kinds of issues, as it can provide raw Hex dumps for these kinds issues.
Also check, that you are configuring the service properly, as some modules need to be reset before service changes take place.
If you are writing your own app for android, the NRFconnect tool still comes in handy, as it can help debug something that is wrong in your service discovery code.

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

How to perform mobile app packet analysis?

I've written a an app and I'm having issues finding a solution to tcpdump data from the Android device running said app.
Android:
The only solution I've found is to root your phone (https://code.tutsplus.com/tutorials/analyzing-android-network-traffic--mobile-10663). Although this is not always possible. There needs to be a way to perform analysis via adb or Android Studio. Unfortunately I have not found a way to do that.
Additionally I've tried PCAPdroid which is an app. This does not seem to be giving me all of the packets I expect to see.
iOS:
Apple provides a feasible solution to create a virtual interface with a connected device where you can then tcpdump all traffic leaving said device.
https://developer.apple.com/documentation/network/recording_a_packet_trace?language=objc

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.

How do you develop Android apps with Bluetooth?

How do you effectively develop, debug, and test an android app that is based on Bluetooth.
I have been googling and searing stack overflow for the answer to this question and I am not getting a clear answer.
I understand that the emulators do not support Bluetooth. I also know of various guides explaining the functions, classes, and such, and I know people have mentioned that setting up a Bluetooth emulator is possible with Virtualbox. I even came across some old projects like BT-Sim that seemed like a way to create fake BT signals (though if my android emulator doesn't support BT, it doesn't help too much)
But no solid guide on how to get this going. It just likes a few scattered puzzle peaces that need to be stitched together. It makes me wonder how app developers reliably make BT enabled apps?
Are there any guides that dissect how to do this process? I imagine the steps to accomplish are:
Create a custom emulator on Virtualbox that can simulate Bluetooth?
Get the AVD Manager to talk to this emulator so my compiled Android code will work with it
Run a Bluetooth simulator to send BT signals over a port in your computer
(I don't really know how to do either of those 3 though!)
My overall goal is as follows:
Create an app that will collect data from a Bluetooth transmitter
But first, create a simulator on my computer that can talk to my android emulator as if it were the real thing
I'll be honest, I do find it odd that the Google folks don't allow Bluetooth emulation on their AVD. I understand not allowing real telephone calls, but I don't see how Bluetooth can be abused like that.
Anyway, any help in setting up Bluetooth would be greatly appreciated and hopefully help many others out there!
NOTE: I am using the standard Eclipse + Android SDK setup with AVD to do my Android development. Planning to use API 10. However, if I need to use a different set up, I am fine. As long as it comes with a step by step guide! That would be very nice.
Old question, but it's still unanswered. If you have a physical device, that seems easiest way to go. If, like me, you don't have a device it's still possible to develop with bluetooth and android.
Download an android x86 iso, load it into virtualbox with bridged network setting and install it.
Plug in your bluetooth dongle and select the device from the 'usb' menu, alternatively you can set a device filter in the vm's settings page.
Now just use adb and connect to it, you can find the ip by going to console (alt+f1) and typing netcfg or ifconfig eth0. You may also need to type adbd on the android console - I do, but I don't see many people mention it so seems it's not always needed.
It still works with eclipse, and is much faster than the emulator. Even when I'm not doing bluetooth dev I use the vm rather than the emulator.

Analog video capture to Android phone

I am looking for a way of displaying an analog video stream on an android phone. On a pc/mac/etc you can achieve this using a cheap usb analog-digital converter such as a grabby: http://www.terratec.net/en/products/Grabby_82248.html, and then view on VLC, for example.
Would such a thing work (in theory) on android if the proper drivers were available? (ie. are there any hardware issues which make this impossible?)
Does anyone know if such a device with android drivers is available?
Ultimately I want to make an app which interfaces with the grabby (or similar device) and allows the user to view video on the android and capture and send short clips.
First of all the Android device needs to support USB Host. This limits your userbase significantly.
Then there is the problem with power. Some USB Host devices will be incompatible simply because an Android phone will not be able to push enough power through to port to get it running properly.
I'm not sure about the drivers, but I'm 99% sure it won't work "out of the box".
You should certainly take a look at THIS project. It is pretty similar to what you are trying to do. Maybe you should consider getting in touch with that person.
EDIT:
Based on what it took to get that DVB-T dongle running in the project i mentioned above the chances of creating an app that everyone will be able to simply download and use are EXTREMELY slim. Getting that dongle running required using a modified kernel and special scripts. Of course I could be wrong. You can continue the research yourself or wait for someone with more experience than me to reply.

Categories

Resources