I am trying to create Client-Server connection network over android devices via blue-tooth(as the connection platform).One device acting as Server and other 4 or five devices as Clients.I have tried many examples from git-hub repository but there is no multi-connectivity implementation.Here is the link I tried for multi connection via blue-tooth
https://github.com/arissa34/Android-Multi-Bluetooth-Library
First of all, you have to notice this library is for socket communication using RFCOMM protocol which is not Low Bluetooth
https://en.wikipedia.org/wiki/List_of_Bluetooth_protocols
If you want help, I need more informations, as your android version, a piece of your code and your logs as well.
Moreover, you can see this library in work on this game https://play.google.com/store/apps/details?id=com.drgames.domino Using one server and 3 clients in bluetooth.
Related
I am currently working on a project in MIT App Inventor, where I am connecting an Android device to an Arduino via Bluetooth.
Is it possible to connect multiple Android phones to this Arduino, and is there a procedure by which an Arduino could distinguish between them?
I assume, that you are using a serial bluetooth device, such as HC-06 or HC-05. As I know, even the master module HC-05 can only connect to one client at a time (which makes sense, since the serial connection on the other side is the same)(despite the fact, that bluetooth in principle allows handling multiple clients at a time, though it's a rather complex task). This means, that you would have to use one serial bluetooth module for each phone, you want to connect at the same time.
When using more than one bluetooth module, you have to connect them to the Arduino over serial, but only one device can use the serial connection at a time. Depending on the number of phones, you want to connect, you can use either the SoftwareSerial library to emulate more than one serial connection (so every connection can be identified by its own SoftwareSerial object), or you have to multiplex your data lines between the different serial bluetooth devices (so that you control the serial connection to the devices with for example setting digital pins). For the last mentioned possibilities, I'm not sure about the property limits in the serial connection. Maybe you can multiplex just only with a few transistors.
If you want not only distinguish between the different connections but directly between different phones (for example to remember special settings for only your phone, not the others) you would have to send an identification over bluetooth to the Arduino (for example the MAC adress of the phone).
For more help, you should state you question in a better way and telling more details
I have an application with an Android and an iOS version, both of which function primarily by connecting and sending/receiving messages to/from Bluetooth accessories.
iOS uses ExternalAccessory to connect to Bluetooth devices
Android uses BluetoothDevice to connect to Bluetooth devices
I want to write unit tests to make them reliable.
Note that I am not looking to test what it sends/receives to the bluetooth device based on input/output (I already have that tested with stream wrappers). I need to test behavior like:
The bluetooth accessory has disconnected in the middle of an operation
A connection has failed
How to go about it?
For iOS:
You can get a test framework like OCMock and create fake objects that represent what you would see in those scenarios.
OCMock project page.
I am working on a project that including an android phone that sends simple serial messages to a picaxe microcontroller(14m2) like '1','2','a' etc.
I searched alot on the web, and I only found a way that the android smartphone first "connecting" to the device and "discover" it, the problem is that PICAXE microcontroller is NOT a 'USB' device, and it can't be discoverd by the android, that means the android will not be able to send serial messages to the PICAXE.
if theres any way to send simple pulses from android to PICAXE, please let me know about it.
EDIT: There's any way to do that by connecting the AXE027 download cable with OTG?
I do some project with communicating over serial port. You can use chineese bluetooth adapters (see on ebay arduino bluetooth), those communicate with controllers via Usart and connect to phone by bluetooth. There is sample project Bluetooth chat from google about how to use bluetooth on android. On hardware iside, you can use arduino for receiving data by bluetooth and converting it in format of your controller. You wont have to use any wires
How can I do these steps in android (Eclipse)? In a simple example. I am beginner.
For transfer data over wi-fi.
Server device opens a socket and listens on it.
Server device broadcasts the local IP and Port it's listening on.
Client devices receive broadcast and initiate a connection.
Transfer data between server and each client or clients and server.
This is very broad and would require a lot of code to show, and therefore I recommend viewing
http://developer.android.com/guide/topics/connectivity/wifip2p.html
WifiP2P is very cool, but can be tricky to setup. If you want to start playing around with wireless communication you may want to look at the BluetoothChat Example.
Bluetooth and specifically Bluetooth Low Energy are emerging as the standard communication protocol for Internet of Things. If you want to start digging into what you can do the example should work right off the bat with the latest version of Android Studio.
I'm trying to develop an Android application which have to be able to transfer data/message between two Android mobiles, as a client server connection using their own Wifi, which having no network or routers nearby. I just tried using Tcp program to do this but it fails, its not connecting, I'm getting ConnectException and connection refused.
[Edited] Is it possible to achieve this using Android Portable Hotspot integrated with application? Is there any tutorial regarding this approach?
Any Ideas, how to do this?
Thanks.
You need to get the two devices networked to each other before you can worry about tcp usage of that network connection.
If one device is willing to perform access-point like functionality as part of a portable hotspot, and you select that as a wirelss network on the other, you may achieve a network connection between the two that can be used for custom traffic. Though there are ways the hotspot could be implemented where that would not work. Also of concern, the "client" device will now be sending all of its network traffic through the hotspot device, including not just foreground apps but anything it decides to do in the background.