I have seen many apps opening systems in built Equalizer (google play music, Spotify, Samsung stock music player). Directly, without having to write their own from scratch. How do these apps do that? I couldn't find a solution.
} else if (id == R.id.action_fx) {
Intent intent = new Intent();
intent.setAction("android.media.action.DISPLAY_AUDIO_EFFECT_CONTROL_PANEL");
if ((intent.resolveActivity(getPackageManager()) != null)) {
startActivity(intent);
} else {
Intent intent11 = new Intent(MainActivity.this, Help.class);
intent11.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent11);
// No equalizer found :(
}
return true;
Many Android OEMs have EQs in the sound section of the settings. Some devices do it better than others, but about half of them let you adjust device-wide audio through an EQ. Usually it's something close to a 10-band EQ along with some added stuff like Dolby Atmos or EQ presets.
On an Android phone, you will find the equalizer setting hidden in the Sound & Vibration section of the Settings app, though the exact menu location may vary depending on your device's manufacturer.
The following should work to start the default equalizer Activity
:
Intent intent = new Intent(AudioEffect
.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
if ((intent.resolveActivity(getPackageManager()) != null)) {
startActivityForResult(intent, REQUEST_EQ);
} else {
// No equalizer found :(
}
Spotify does the same basically, haven't checked the others.
The necessity of startActivityForResult()
is explained in the docs:
The intent carries a number of extras used by the player application to communicate necessary pieces of information to the control panel application.
The calling application must use the
android.app.Activity#startActivityForResult(Intent, int)
method to launch the control panel so that its package name is indicated and used by the control panel application to keep track of changes for this particular application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With