When my application starting, I want to check whether the android device is connected to a Bluetooth mouse, and listening to the connected event.
How can I do it?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using the Android Bluetooth APIs, you can get a list of connected devices like so:
There’s no good way to tell what type of device is connected, but you can run through the devices and their names by iterating through the
pairedDevicesSet. The Android Bluetooth Guide has a lot more details on Bluetooth.