Android app communicate peer-to-peer using wifi-direct - android

I would like to do an Android app (not for an assignment. It is a community event and I volunteered to make this app) that can send messages to peers using wifi-direct.
Basically, each phone running the app acts as a jeopardy buzzer. When a person presses the "answer" button, it disables the buttons on other people's phones (who are physically in the same room). When a question is over, all the phones have enabled "answer" buttons and so on.
I found this link below that shows how to create an app that uses wifi-direct.
http://www.mediafire.com/download/f022u9hghja7cvs/WifiDirectDemo.zip
so the question is: how do I get phones to communicate with one another through my app? Assuming their phones have wifi-direct capability, how does one phone send a message/data to other phones so that their 'answer' buttons get disabled/enabled.
I am fairly new to Android development. I have 2 days of experience with it so any kind of guidance would be useful. Thank You!

Related

How can I do Bluetooth testing for a P2P mobile application for multiple devices?

I am making a small school project. I am developing a P2P android mobile application that will detect other similar devices(devices that are using the same app) around.
My question is how can I test it while developing? Can I somehow run 2 physical devices at the same time and then check their Bluetooth functionalities(If yes, then please link a video, article etc.)? Or is there any other solution for this?
Thank you

How to use proximity sensors on a mobile device to enable 2 android devices to communicate?

I am a student studying software development currently, and we were asked to come up with a project of our choice to work on for the next few months.
I want to create an android application as this is where my interests lays.
Now, the idea i have is not fully developed yet but hopefully you guys can help. The idea is:
If i create an app, and this app is enabled/installed on 2 android devices, as long as this 2 devices are in range of a certain distance I would set, they can communicate.
It could turn out to be a messaging system, or image sharing etc. But my question is, is it possible to use proximity to enable 2 android devices with the app installed to communicate?
Keep in mind, I am no expert in Android but I am no beginner either.
Any help appreciated.

Control the smartwatch via bluetooth

I am doing some feasibility research for a project and I am not an expert. I would like to control my smartwatch via Bluetooth Low Energy (BLE) from a device which is not a smartwatch. Nothing really fancy, no app running difficult tasks, no login/security, no external DB, just some controlling like: turning screen on, swiping back and forth, selecting and using basic functionalities embedded in every smartwatch let’s say by default (e.g. email, phone calls, sms, play music), and turning screen off. Basically, instead of interacting with the smartwatch via touchscreen, I want to interact to the smartwatch via BLE. Instead of using the smartwatch’s touchscreen as the source of inputs, I want to use another device as its source of inputs. Targeted OS is mostly Android (but any other is useful to know!).
1) Is there any smartwatch that allows developing such functionalities in the smartwatch itself, without developing in the smartphone (i.e. I deploy some APIs in the smartwatch that handle the BLE module and implement the tasks above mentioned)?
Can I pair my smartwatch with multiple devices also not necessarily smartphones?
I know that Pebble Time is highly developable and a solution like this one can be (or will be able to be) implemented, I am curious if there are any other models that can allow this amongst Android and iOS devices.
2) As I don’t expect many devices that allow what asked in 1, a smartphone app is to be implemented. All that I would like this app to do is bridging the BLE connection between a devices and the smartwatch. This means that I don’t want to implement a new email client app, or a new music player. I would like to use the apps present already in the smartphone/watch, but control them from another device via BLE (i.e. rather than via the smartwatch touchscreen). So basically the signals/controls will go from device to smartphone, and from smartphone to smartwatch (and from smartwatch back to smartphone, but due to the application that I am using). In short, I don’t want to develop a proper smartwatch app, but a smartphone app that controls a smartwatch (no app deployed in the smartwatch itself).
Are the APIs to do so from the smartwatch (swipe left, scroll down, select, etc. - basically the same exact APIs used by the smartwatch touchscreen driver) available for Android and/or iOS?
Your wisdom and ideas are more than welcome (please remember I am not a coding guru), thanks for reading!
Dan
I'm not familiar with the other smartwatch platforms, but I can speak for the Pebble.
Unfortunately, the things you want to accomplish aren't possible with the Pebble. We do have a private BLE SDK for developers that lets them write apps that can use BLE to talk to other devices, but we don't have any API's that let you simulate button clicks, controlling of system apps, etc.
Best of luck!

How to listen from two Bluetooth devices simultaneously into an android mobile application?

I am working on an android app which needs to communicate with two external Bluetooth devices simultaneously and read the data from those ,process the data and show on the screen.
Will it be possible?
your question is similar to another post
Multiple bluetooth connection
There you can find your answer.
Regards

Bluetooth concurrent connections

For a fest at my college, we are planning a quiz contest.
For the buzzer round, I was thinking of writing 2 app for android (we have a few handsets), one for the quiz master and the other for the contestants
The contestants will be connected to the quiz master through bluetooth.
After reading the question, the quiz-master clicks a button in his/her app, the button in the contestant apps will be enabled for X seconds. As soon as a contestant clicks his/her button, the quiz master's app will flash the name of that contestant.
My questions:
Is it even possible to have multiple connections and accept concurrent (or multiplexed) messages from them in bluetooth (something similar to select() in unix/c)?
If possible, where should I look for any examples? What kind of problems will I face trying to develop this (I know reliability is an issue here) and how to avoid them?
I had tried this on laptops before and failed. But maybe I gave-up very early. Please help.
EDIT:
I gave-up the project (too many connection drops). I'm keeping the question open though.
Bluetooth supports piconets, in which a single (quiz) master can communicate with up to 7 slaves.
So, at the Bluetooth level, this should be doable. I'm not the person to say if it's possible to implement using Android's Bluetooth API:s, though.
Have you read though this and the rest of the information available specifically for Android?
http://developer.android.com/guide/topics/wireless/bluetooth.html
Aside: When I was in college we did trivia nights the old fashioned way (paper and pencil) but on the plus side you didn't have to worry about having expensive phone handsets in the hands of drunken college students! ;-)

Categories

Resources