Is it possible connect android only to bluetooth board hc-06? - android

i'm developing an app in android using eclipse and this aplication needs to connect a bluetooth board hc-06 with arduino.
Is it possible connect android only to bluetooth board hc-06? for example, i search bluetooth devices with my app and if i connect with another bluetooth device (without hc-06) the app shows a message like "wrong device".

Set the HC-06's name to something you want. In your Android code check for the name of the Bluetooth connected device. Or, you could check the Bluetooth id, etc.

Related

connect to HID keyboard device as input device in android pragmatically

I have HID BLE keyboard which normally when I want to connect to it in android os environment, I go to Bluetooth page, search for it then tap on keyboard name and connect to it.
now I want to know that can I write an app that automatically finds the device and then connect to it as an input device or not?
I'm already read the documents about BLE communication in Android, but none of them does not explain how to connect HID keyboard as an input device looks like android itself connect to it.
No the public API does not allow you to activate the "use as only device" switch shown in the Android Bluetooth Settings UI.
However up to Nougat you can do it with Reflection. Just read the source code of the Settings app and do the same thing.
Yes! you can search the nearby bluetooth devices and you can connect to the device.
The transmitting of data is depends on the Device UUID. as per bluetooth standards bluetooth UUID standards you need to use UUID = 00000011-0000-1000-8000-00805F9B34FB to connect HID devices
Here is the link for a sample project.

app that simulates bluetooth device (printer)

Is it possible to create an andorid application, that can simulate bluetooth device? I want make Android OS to think, that it is connected to the bluetooth device, which is actualy simulated by my application.
Scenario: user will install my app, and voilĂ , there is my virtual bluetooth device - actually, it is printer. I need it to work on non-rooted devices.
Reason: some guys are too lazy to support other bluetooth printers, so I want to simulate the supported bluetooth printer and print the data on another bluetooth printer.
FYI: I did't found, that it is not possible. I know, that emulator can not simulate it, but ShadowBluetoothAdapter from robolectric can.

Bluetooth in Android to connect with arduino

I want to get two values from arduino board via Bluetooth in my android application. The arduino board is already paired to my device. How can i receive those values. Anyone ??
You need to write two applications. one on android and the other on Arduino board. you can refer the following tutorial to connect to bluetooth device from android app.
communicating with bluetooth device from android app

Bluetooth serial connection between Android and Ubuntu

I'm working on an Android application and I have to make a Bluetooth serial communication between an Android device and a Computer with Ubuntu OS. I don't know what to do and how to connect them. I'm looking for good references and someone who can help me.
I made a button which navigates to the Bluetooth settings of our Android device. I don't know what else I should do.
Pair the devices. This has nothing to do with any software, so it has to be done via the phone settings
Once paired, look at 'Bluetooth Chat' example by Google. It has drop in code for connecting two devices. A serial connection is done via Serial Port Profile that is established over RFCOMM. The UUID for SPP is well known, again, you'll find it in the Bluetooth Chat example.

Bluetooth RFCOMM connection: read serial data from com port in Windows 7

I am working with the Android Bluetooth Chat sample application. I am trying to read serial data from the Android device in Windows 7.
I have been able to pair the Android device to the Bluetooth adapter on my laptop. I replaced the UUID in the sample application with the following per some other discussions:
private static final UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
When I run the Android application I am able to connect to the laptop. In the "Hardware" properties of my Android device there is a "Device Function" entry called "Standards Serial over Bluetooth link (COM10)". When I attempt to connect CoolTerm to COM10 I receive "error 1168" (there is no additional description for the error).
Am I misunderstanding something about the process of sending serial data via Bluetooth to a Windows com port?
Be sure that you are selecting the correct COM. In my last Android application that required SPP (Serial Port Profile) Bluetooth communication, when Windows 7 paired I had several COM's open up.
If COM10 is not working, verify that it is the "incoming" COM (or maybe it's outgoing, I can't remember b/c it's been a few months).
You have to use the proper Bluetooth API from your Windows application to call and connect to your Android device, that is:
do an 'Inquiry' of all nearby devices, discoverable and exposing an SPP service/profile (SPP=Serial Profile Protocole). This profile has the aforementioned GUID {00001101-0000-1000-8000-00805F9B34FB}
once all found, select the one you're searching for (either by Name or MacAdress)
at this point, you can do a 'Discovery' of its Services and check out that it has the proper service exposed (SPP or RFCOMM)
then connect to it, using the Bluetooth socket API...

Categories

Resources