Question

I am writing a security application for Laptops and I began writing the DiscoveryListener in J2ME But it displays all device types like mobiles. But I want it to find only computers.

Any help regarding this???

Was it helpful?

Solution

There's no way to search for a specific device type. The search itself will always find all device types.

You will have to filter out unwanted devices yourself. When a device is found, deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) is called. The DeviceClass tells you what kind of device it is. So simply ask.

if (cod.getMajorDeviceClass()==0x100) // Yes, it's a computer of some sort.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top