Kanaiya Katarmal
Kanaiya Katarmal

Reputation: 6108

how to know devices is mobile or printer in android?

I want to print from android mobile via Bluetooth.
i get all the devices in the list with a Bluetooth adapter.
i just want to know which of the devices in the list is mobile and which is printer.
Is there any code, method or function to find this out?

Upvotes: 0

Views: 613

Answers (1)

Its not blank
Its not blank

Reputation: 3095

Every Bluetooth Device implements set of Bluetooth Profiles these set of profiles decide the type of device. Put it this way profile defines the capability of Device. So devices like BT mouse or joystick implements HID(Human Interface Device) this way your System identifies them for those tasks. Even while you are scanning devices on your Handset you will see different icons in front of devices with different capability

Every profile has specific UUID that you will need to identify that device. here is the List of UUID

So a printer might implement BPP profile.Whenever you give a print job via BT what happens is your system searches for all the nearby BT devices.then for each those devices the list of profile it implements is searched and then best matching device is given to you for confirmation to print. Now since the profile are identified by their UUID ,system looks for specific sets of UUID.

Based UUID you can identify printer to some extent. However you cannot be always sure(I think).

Upvotes: 1

Related Questions