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???

有帮助吗?

解决方案

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.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top