Bluetooth HID in Android (Java) - java

I have a Wii remote and I want to connect it to my android phone with just Java if possible. I have tried to look for libraries and other things like that but there was nothing. I am new to Bluetooth development, I don't know how it works entirely. Other than that, I would love to get some links on how to connect a Bluetooth device as an HID and send data to a specific address. Thank you all!!!!

Related

how to get list of all connected devices to the one router programmatically in android?

I am developing an app in which I want to shows list of all devices which are connected to one router using wifip2p same like in xender. I don't know how to do this because I am new in Android programming.
This GitHub Repo called Android Network Discovery might help you to get list of all contected devices.

How to check WiFi hotspot(AP) is enabled an Android app

I am making an Android app that will communicate via Bluetooth with other devices. These devices need to check WiFi hotspot. How can I, from inside the app, check if the phone is an WiFi hotspot?
I don't need to turn hotspot on from the application, just check if it has so I can tell the user to turn it on manually to be able to use the app.
EDIT:
I just realized the question is not really correct.
The phone with the app I am developing connects to internet via wifi. Then it needs to share internet with other devices via Bluetooth. The answers here worked fine to check if WiFi hotspot is on. But I need to check if it can share internet via Bluetooth with other devices.
The phone gets internet via wifi, but the devices have to get internet via Bluetooth.

Make an Android App receive data from a non-Android App using Wifi

I am working on an app that will act as a dashboard for an electronic card installed in cars and trucks.
I need the application to be able to receive data from this card, so I can display it in various ways on the app.
We chose Wifi for the communication method. To access the card, my app is able to connect to a Wifi network created by it.
I would like to receive JSON sent by the card every second.
I need help on where to start to make the two devices communicate, and what are the good practices on implementing this kind of communication.
The app basically act as a client, and the card as a server.
I found something about sockets, but it seemed to use two Android devices, a server and a client, so I'm kinda stuck here.
I use Android Studio 2.1.2 with the Android APIs ranging from 19 to latest.
One option is to broadcast with UDP the data within the local network. The moment the android device connects to the wifi network it will be in its local network. So the data can be received at the android end with a multicast receiver(check out http://jgroups.org/ ).
Refer example
It may also use the p2p sharing with TCP and bind the device with static IPs for communication. Create a simple socket receiver at the android end and a service at the device end. Depends on the way you choose it.

Is it possible to establish more than one bluetooth communication in android

I have android application the scan a Bluetooth device around, and connect them to start exchanging text.
I want the application to establish a communication with each Bluetooth device in the surrounding area and send text to all of them at once.
Is that possible to have multiple communication in android ? and if you have any examples ?
For sure it is possible. You are talking about Bluetooth BR/EDR (2.x, 3.0) or Bluetooth low energy(4.0)?
For Bluetooth BR/EDR, use the official documentation to get started.
Just do a SDP to find all devices in range that support your UUID. Here is how.
Then connect to each of them using a RFCOMM Connection as a client.
Obviously, the other devices should accept this connection. If those are Android as well, see the 'connecting as a server' chapter. (Basically it means waiting for a connection...).
For things not covered in the Android Official Documentation, see this.
You can also just take all paired devices, and try to connect to them(obviously only those in range will connect).

Detected android device connected to PC

I have an android devic, i wish to know when it is connected to the pc via java/.net
i know its possible - the Samsung New PC Studio is doing it, when ever i connect an android device it lets me know. how can i achieve the same?
You have to listen for one of this notifications
http://developer.android.com/reference/android/content/Intent.html
If you're using it as a mass storage device then use this
http://developer.android.com/reference/android/content/Intent.html#ACTION_UMS_CONNECTED
Other USB events aren't clearly described in the documentation
EDIT:
If you want to read on the computer side I would read this article
http://today.java.net/article/2006/07/05/java-and-usb
and then check which kind of devices are connected to the usb port. if it is a mobile phone, then you can try to send a short message to it. on your phone you make a small piece of code which returns an appropriate answer so you can detect thats its really android/your phone/this phones you want to identify
java device detection
This site have a guide on how to detect device with java web and java core
http://51degrees.com/Support/Documentation/Java/GettingStarted.aspx

Categories