How to change Bluetooth device class on an Android phone? - android

Is it possible to make an Android phone present itself as not being from the Phone device class when connecting over Bluetooth? For example, imagine I wanted to pretend my phone was a Bluetooth keyboard to another device.
I've been looking around the Bluetooth API and I don't see anyway to change it.

COD(Class of device) cannot be changed from the application. For bluez stack in phone, COD is defined in adapter.c . Though if u want that ur phone can act as a keyboard to some other device, may be adding SDP record can help. If peer device searches for the services supported on your phone, it can recognize as HID device with the SDP record

Related

How to setup device as a bluetooth headset?

Let us suppose we have a two devices with Android:
Custom android device with microphone, speaker, bluetooth and without GSM part.
Android smartphone (like a Nexus 5 or SGS4).
We need to make calls programmatically from first device through second via Bluetooth. What we are need to do to implementing it? Setup first device as headset? Or something else?
Step by step tutorial: http://developer.android.com/guide/topics/connectivity/bluetooth.html
One device as server, one device as client.

screencasting in android using HDMI wifi dongle

I have been searching a lot for implementing screen cast(miracast) in android and got more confused. I have a HDMI wifi dongle. Now as i plug the dongle and open my app need to search for available devices and as user selects devices the mirroring should start and my screen need to reflect to the device which has plug the device. For now From settings we need to go to display and turn wireless display on and connect to them. As of now i tryed to do this by WifiP2pManager class and got a list of device and connected to my device. But it is not showing as connected on settings wireless display which need to be connected for screen casting. Now my question is can i start that casting from my app and how ?
there is no public API that allows you to manipulate directly the connection, but you can integrate an action that should do what you want, through the MediaRouteActionProvider
Using this, you can display a button inside your action bar. When the user will click on it, it will show the list of paired devices and do a quick scan. From there, the user will be able to directly initiate the connection to an available device.
It's working on most devices, simply not returning the action on those that don't have any paired devices or don't support Miracast (+some Samsung's that don't use the MediaRoute system for Miracast connection).
I need to have have a button that simply starts miracast(mirroring)
That's not possible through the Android SDK, sorry. Whether there is a way for an app running with superuser privileges on a rooted device to do it, I cannot say.

Bluetooth pairing without pin code

I am a newbie working on bluetooth, and I would like to get some advice regarding the pairing process. I have googled this but I did not find much information ...
My goal is simple: I want to do a pairing to a headset without entering a pin. I have an android (nexus S running Android 4.1.2) and an iphone (3GS running ios 6.1.3).
If I connect to a device like a Jabra BT3030 (bluetooth headset), the pairing is performed without asking me any pin code.
Now I want to do the same from an Ubuntu (with BlueZ 4.6), i.e. I fake a bluetooth headset by enable only the correct service and so on. I disabled the authentication.
When I pair my iphone to this device, no pin code is required (as expected), but when I connect from my Android device, it still asks me for a pin code, whereas I would expect to have the same behavior than with the Jabra.
Would you have any idea of what I am missing here?
Thanks in advance,
Best regards,
Guillaume
Android Uses UUID for pairing and connection for two devices...for two devices conneting, one device should send request and one should accept and for both UUID should be same...
Like also used bluetooth there I need to intall my android app to both the devices then only I can pair the two devices...because only that app is knowing the UUID. and for iPhone it may be different so if from the native code of iOS u can know the UUID ur android device can be paired through app...
The Standard password for a Jabra BT3030 is 0000. Many other bluetooth devices have a standard password. For the Case a system only accepts devices with passwords, and u cant enter a pasword on a device without keys :D
Maybe the solution is implementing the standard passwords for mutliple devices and use them instead f forcing a connection without password.

How to use Android device as a bluetooth headset for another mobile phone?

I want to make my android device working as a bluetooth headset.
I search the Android APIs, but I just find some interface which
can make Android device working as a masters, not as a device(bluetooth headset).
I'm also ready to modify the source codes of Android OS, and rebuild the OS.
What I hope is, when Android devices connect to a mobile phone with bluetooth, the Android devices can work as a bluetooth headset.
I don't know whether there are interfaces can do this, or I should modify the Android OS?
Thank you!
You need to implement HFP profile in your android device, normally phone role is AG(Audio gateway) and headset roles is HF(Hands free) , think its as a server and client role. Connect RFCOMM channel to phone using UUID defined for HF , have SDP record updated,changes will be required to handle AT Commands as well.
These will be the initial changes, once done you will need to handle audio packets(SCO packets) for voice calls

Incomplete scan of bluetooth devices

I am trying to scan for bluetooth devices using a processing based android app. I would like to use processing to communicate to my microcontroller board via bluetooth as shown in the example below:
http://webdelcire.com/wordpress/archives/1045
I was successful in launching this app on my android tablet. However, I am not able to list the bluetooth device on my tablet. The only bluetooth device that my tablet recognizes is the bluetooth adapter on my computer. Why am I not able to list all the bluetooth devices? My computer is able to recognize the microcontroller's bluetooth device.
Probably your embedded target board identifies itself erroneously as a Bluetooth Device.
The computer's Bluetooth adapter accepts this error, while Android does not.
If you can change the SDP records (Bluetooth search discovery protocol) of the embedded target board, maybe Android will see the device (try making it look as a headset or hands free device!).
The quick way is to change the 'magic numbers' defining the SDP class, service id, etc. The numbers are inside this document. Then see if Android sees your board.
You can also read the Bluetooth Core Spec if you have the time.
See this tutorial for more on the formal aspects, and "Bluetooth for programmers" for a lighter introduction.

Categories

Resources