Android and Bluthooth communication - android

I want to communicate my circuit (PIC based) with Android devices.
I tried to communicate using Bluetooth but it always ask to pair.
I tried to search more on communication where problem is,pairing is required.
Can i achieve communication without pairing? I found that pairing of devices is an essential factor.
Can i use Bluetooth 2.1/ 3.0 versions for communication?
Can somebody recommended any specific Bluetooth modules at circuit end?
Hope to get the right answers
-Abhimoh

I don't think that communication without pairing is possible at all.

I have used a Bluegiga WT32 module with a PIC. It works well, and communicates through UART.
Pairing is required, but easy to do.
The WT32 uses 2.1

Related

Android: Two Bluetooth modules

I am in the planning stages of a project and potential issue has come up and I can't find the answer.
I am going to use a raspberry pi 4 with Android installed. To achieve my goal I will have to use a Bluetooth USB adapter with an external aerial. Because the raspberry and pi already has an onboard Bluetooth module, how will the OS cope with a second module being plugged in?
Can I disable the on board Bluetooth or force Android to use a particular module exclusively e.g the usb module?
Thanks
Unfortunately this is either not doable or at least not straight-forward. The reason is that the Android OS was designed to have one adapter only that does the Bluetooth functionality (as can be seen here and here). Even if you find a way to do it on the OS level, I would personally advice against it as there's very little resources on how that is done and you might soon find yourself stuck on another issue.
Is there a reason why you wouldn't use Linux and the BlueZ stack instead? There are many resources and examples on how to do this and with BlueZ and you should be able to use multiple adapters without an issue. If using Android is a must, then another recommendation is to use another MCU to connect to the Bluetooth dongle and do the translation from BT/USB and then have the Raspberry Pi connected to the external MCU over USB.
Below are a few links with people having a similar problem:-
How to use two Bluetooth adapters in Android
Are multiple Bluetooth adapters under Android possible
If the Android version doesn't matter, there's even AOSP BlueZ for Android.

How to simulate a BLE device using a Nordic BLE stick so that it is discovered by an app

Here's the setup, I have an Android app that discovers BLE devices, and to do some test automation I'd like to write a program that simulates, mocks, one or several BLE devices.
I have a Nordic BLE USB stick (PCA10031), and thought I'd use that, since the actual device uses a Nordic BLE chip as well.
This is a broad "question" but I'm not sure how to start. It doesn't seem to be any JAVA or Python APIs, how do I mock a device with this setup?
Thanks to all who read my clumsy question
I don't understand your question completly.
Can you be more precise? I assume you want to write your own app to communicate on BLE with the Stick in server role? What's you target from which you want to run your stick?

Android <-> iOS direct communication (Bluetooth). Is it possible? [duplicate]

This question already has answers here:
Is it possible, in principle, for an Android device to interface with an iPhone over Bluetooth/GameKit?
(7 answers)
Closed 9 years ago.
First of all I am an Android developer, so the question goes to all the iOS developers.
Is it possible to achieve an Android <-> iPhone/iPad direct communication?
Some claim it is not possible, others claim it is.
I guess two possible technologies would be Bluetooth and/or Wi-Fi Direct.
Wi-Fi Direct is not recommended because it is not supported by Gingerbread and as far as I know, it is not supported by iPhone either (maybe iPhone 6, as I have heard from rumors)
It is already known that Bluetooth communication is achieved between iOS devices using GameKit and here is a reference.
I don't understand what is so special when communicating with GameKit??
Are the messages wrapped in some way with extra bytes at the beginning and ending of the message? Fine, we can wrap the messages the same way in Android!
Are the messages encrypted?!! And if so, could we decrypt them when they are received in an Android device?
Any ideas, workarounds, or other hackerish solutions are mostly welcome!
There are three frameworks available in iOS using which you can develop the bluetooth applications:
1. GameKit: This is the publicly available framework . But using this you can only establish and communicate between only two iOS device. So this framework having its own limitations .
2. BluetoothManager: This is private framework .I used this framework to discover the non iOS devices . I have established the connection also . But cant able to do the data exchange. I think it is still under development. For the reference you can refer this link
3. CoreBluetooth: This is also the public framework. This can only discover BLE enabled devices . I have successfully used this to transfer the data between the BLE enabled devices.
iOS does not implement any standard Bluetooth protocols that would allow it to communicate with other OS'es. GameKit is proprietary and if it were easy to hack it then people would have already done so (and Apple would have closed the hole).
Bluetooth LE is only supported by few Android devices (it is not in AOSP yet) so it is not really useful yet, even if it did support peer-to-peer.
I've read that it is possible to do what you are after via Wi-Fi direct, e.g. with this library:
https://www.alljoyn.org/
It says that it supports both Android & iOS - I haven't tried it myself, but it appears to do what you are after.
For devices on the same local network, Bonjour (a.k.a. zeroconf) can be a good way for processes on different machines/devices to discover and interact with each other.
See apple bonjour for android for some pointers to an Android implementation of Bonjour.

Passing values from an android device to another

Is it possible to pass a value from an android device to another? I mean, without using the Internet. My project will be implemented only on a localhost. The two android devices are only connected through the router. If it is not possible on the local area network how can I do this? Are there other ways? I'll use the Internet or any other options if possible. Links to open source code, if you have any particularly regarding on this topic, would be appreciated too. Thanks!
If your target is Android4.0+ you can use wifi direct as #pgsandstrom stated.
In other cases if you want to make client/server comunication with two android decices you should look at this thread Socket Server/Client with two Android devices and the awser to this question may be usefull to you too How to write an Android SocketServer to listen on wifi.
If you can restrict usage to Android 4.0 or later, then have a look at wi-fi direct. It doesn't use a router thou, so I hope that isn't a restriction. If you need to support older devices, I think you have to go with bluetooth.

Android tablet communicate with ARM development board via bluetooth

I am new to embedded programming and I am given a project to establish Bluetooth communication between an Android tablet and an ARM development board with Bluetooth capabilities.
Please tell me whether this project can be done or not ??
If it can be done then how should I approach it ??
Thanks
Check out this page: http://www.amarino-toolkit.net/
They are using the arduino board with a bluetooth component to connect to android. You can check the source code of their library to see how they establish and use the connection here:
http://code.google.com/p/amarino/
If what you want is a simple and robust communication method over Bluetooth then SPP is definitely the way to go.
The only issue could be the bandwidth, but if the throughput of a traditional serial cable connection is enough for your application then there certainly won't be any problems there. IIRC then most modules have > 1 Mbit throughput using SPP.
Some information about using SPP on Android is here.
But we need a little bit more information to give suggestions about what you need to do on your ARM kit. Maybe you could post a few details about its type, which Bluetooth module is in use there, how it is connected to the ARM MCU etc.
If you're lucky then your kit's BT module can function as a serial cable replacement and you can treat it as if the Android device is connected to your MCU's UART. Of course prior to that, some configuration is needed over some interface (could be the same UART, depending on module type) to establish a Bluetooth connection.
Oh and to answer your first question: yes, it certainly can be done :)
I haven't worked with Android to ARM board via bluetooth but I have done some work communicating between an Android device and an Arduino using bluetooth. I tried to document what I learned in a series of examples. There are several that might be helpful.
http://digitalhacksblog.blogspot.com/2012/05/arduino-to-android-basic-bluetooth.html
http://digitalhacksblog.blogspot.com/2012/05/arduino-to-android-turning-led-on-and.html
http://digitalhacksblog.blogspot.com/2012/05/android-example-bluetooth-simple-spp.html
The first two examples show how to setup communication via bluetooth from an Android device to an Arduino with a bluetooth board. I would expect that to get some initial connectivity between the Android and the ARM the Android side of things would be the same.
The third example shows how to setup a simple spp client and server between an Android device and a PC running windows.
Hope this helps.

Categories

Resources