Android Wifi P2P communicate multiple devices - android

I want to develop a streaming app, where I have to communicate with multiple devices using wifi.
I have tried P2p, By using this link, i can connect between two devices, but there is no clear documentation for creating group and transferring data between devices.
I even checked some questionnaire related to this topic, but none of them is useful.
Please help me get started in right direction.

Have a look at this sample project. I started with this and I can tell you it's straight forward and easy.

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 make multiple bluetooth connections in android

I have been trying to connect multiple android phones to my app using bluetooth multiple connections concurrenlty.
Have followed the solution of a chatting app shared on android samples for bluetooth.
But I am able to only connect my phone to only one device(phone) at a time.
My code is exactly the same as that given in the sample demo on android devloper site.
any help would be really appreciated.
Thanks in advance.

Can you manipulate Raspberry Pi sensor data on an Android smartphone?

I am new to using the RPi and just got the A+ model which I have been using to generate different types of data from external sensors. I was wondering if it is possible to send this data it is gathering to an android device in real-time, and if so the best method? I want to be able to notify the user (through a an app made with the Ionic framework) when the data enters a particular range etc.
And also is it possible to do this whilst the user is walking around with both the devices in hand?
The short answer to the question is: Yes, you can ;-)
The longer answer is much longer, since there are many ways to do this.
The one I personally would choose as the simplest is classic Bluetooth (not LE) using the SPP profile, which basically makes the BT link a serial connection between the RPi and the phone.
On this serial link you invent you own streaming protocol suitable for the data you want to transfer.
On the RPi side you install a module such as this: https://www.sparkfun.com/products/12577
(There are many alternatives, but the RN42 module is very foolproof...)
Don't know the level of your hardware skills, you might need something more plug and play if you feel uncomfortable hooking up the 4 wires needed for 3.3V power and serial communications between the Pi and the BT Module...
On the phone side you install https://github.com/don/BluetoothSerial, which gives you an API reachable from Ionic where you can receive the BT data stream.
With that and a bit of coding on both sides you are good to go.
I've used a Raspberry Pi in combination with an Android smartphone & Lego NXT.
Communication was achieved using Bluetooth on Raspbian. I used a cheap $1 USB Bluetooth dongle. The Bluetooth stack had to be compiled for Raspi, which may not be necessary anymore. Steps can be found here: Bluetooth error: Native Library bluecove_arm not available
Bluetooth seems most logical to me.
I'm at work at the moment, hence the lightweight answer, if you'd like to discuss this further then please leave a comment and I'll be happy to provide more verbose response.
You can upload the data to any cloud services. You can use Xively/Box. Xively is specially made for real time data collection.
To connect RPi to Xively, refer this: https://xively.com/dev/tutorials/pi/
For Box, refer this: http://www.sbprojects.com/projects/raspberrypi/webdav.php
You can then use Xively API in your android app. You can see GitHub for this
Google app store already has some apps for you, if you want to use
It might look a little complex. But its really simple once you follow the above methods.

WiFi Direct the right choice? Trying to make chat app - Android

I'm trying to make a simple chat app on Android for learning purposes. I would like it to have the following features: Different "rooms" which people can create/join. Working of Bluetooth/WiFi Direct (Preferably WiFi direct). Passwords on rooms.
I'm having a number of problems however. I don't fully understand WiFi Direct. I've read and re-read the guides and references on developer.android.com and I've asked multiple times on #android-dev on freenode to no avail. Would someone be able to explain if what I outlined is even possible using WiFi direct and if not, what should I use?
TL;DR: Explain WiFi Direct's network structure and capabilities and provide resources for learning if possible.
It is possible using WiFi direct.A room can be considerd a P2P group(1 group owner+ one or more clients) .The person who starts a "room" becomes a P2P group owner and whoever wants to join a group has to undergo the authenticatio process.A client can directly communicate with owner but to communicate with other clients in the group it has to go through the owner.
For detailed understanding of wifi direct better go through the wifi p2p tecnical specification v1.2 which can be found in WiFi alliance website under published specs. Or for a overview Click [here] (http://enjambre.it.uc3m.es/~agsaaved/papers/2012_camps_wircommag.pdf).
It is possible in theory but currently the framework of wifi-direct is too unreliable..
I have tried it and the connection is very unreliable ,it breaks abruptly for no reason. Also beyond 3 devices it doesn't scale very well ,though i tested it on tablets having very less processing power (maybe on good phones it might allow one or two more connections).
So i would recommend you use wifi for communication . it would be the best suited for your needs and easier to work with as well

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!

Categories

Resources