An Android library to help you manage Audio Focus in your app with minimal code.
It is important to control audio focus in your app if you want to play any sound (media, voice call, alarm, etc.) It would not be a pleasant situation to the user if two or more apps simultaneously play different sounds. The system of granting and abandoning audio focus makes sure that no two apps play their sounds at once. Therefore, before playing any sound, you must request the system for audio focus.
This library makes it easy for you to request audio focus, thereby reducing the number of lines you have to write.
Please see here: https://wrichikbasu.github.io/AudioFocusController/#quick-setup-guide
Available here: https://wrichikbasu.github.io/AudioFocusController/javadoc/index.html
This repository comes bundled with an app that not only demonstrates how to use the library, but is also helpful in testing whether your app behaves correctly if it loses audio focus.
Please create an issue with as much details as possible. Bugs will be dealt with seriously and fixed as soon as possible.
Ideas for improvement and feature requests are always welcome. Please post them in the Feature requests category under Discussions.
We will try to answer all questions and help you in using this library. Please post your questions in the Q&A category under Discussions.