What code i have to right to play/pause, volume control using buletooth earphone in android studio.?

170 Views Asked by At

I want that my music player app should play/pause and volume control using bluetooth earphone. They user don't have to go to my app to stop the music manuualy they can directly play/pause using bluetooth headset.

I want that my music player app should play/pause and volume control using bluetooth earphone.

They user don't have to go to my app to stop the music manuualy they can directly play/pause using bluetooth headset.

1

There are 1 best solutions below

0
Marcus Müller On

Your music player software doesn't need to care about Bluetooth. That's part of the operating system you're using -whatever that might be, you forget to tell us.

All your application needs to do is play music and react to the operating system telling it about media control events. How these are exchanged between programs and operating system really depends on the operating system and in which framework you're programming. Some systems, these button presses are converted into virtual keyboard presses. Other os/framework combinations send signals to slots. Other ones have a socket on which you get information about user input.