flyingdutchman Posted April 10, 2022 Share Posted April 10, 2022 @maxmp Music Playlist Manager (MPM) accesses the Poweramp media database to manage playlists etc. One of the functions it offers is to play a playlist or track which works fine BUT as MPM is the active app and has the UI, Poweramp itself remains in the background Is it at all possible to bring Poweramp into full view replacing MPM, using some api call.? Link to comment https://forum.powerampapp.com/topic/23453-bring-poweramp-to-the-front/ Share on other sites More sharing options...
6b6561 Posted April 14, 2022 Share Posted April 14, 2022 I have absolutely no clue about what I'm writing about... I just got intrigued by the API and trying to understand what can and can't be done... I stumbled upon https://github.com/maxmpz/powerampapi/blob/master/poweramp_api_lib/src/main/java/com/maxmpz/Poweramp/player/PowerampAPI.java And the following caught my eye: /** * Sent by your app to Poweramp<br> * Opens main screen<br> * Should be sent with Context.startActivity */ public static final String ACTION_OPEN_MAIN = "com.maxmpz.audioplayer.ACTION_OPEN_MAIN"; No idea if this would do what you are asking for or if it's something else. Link to comment https://forum.powerampapp.com/topic/23453-bring-poweramp-to-the-front/#findComment-108172 Share on other sites More sharing options...
flyingdutchman Posted April 14, 2022 Author Share Posted April 14, 2022 @6b6561 much appreciate your contribution. My app relies heavily on the api and there is so much to read and understand. I have found that when max does not respond it usually means the answer is there so this might be it. I will check my code and experiment a little Link to comment https://forum.powerampapp.com/topic/23453-bring-poweramp-to-the-front/#findComment-108173 Share on other sites More sharing options...
flyingdutchman Posted April 14, 2022 Author Share Posted April 14, 2022 @6b6561 after a little further searching, this now works as intended. I just needed the first paragraph too. Thank you for pointing me in the right direction public void playSelectedPlaylist(Context mContext, long playlist_id) { Intent intent = new Intent(PowerampAPI.ACTION_OPEN_MAIN) .setClassName(PowerampAPIHelper.getPowerampPackageName(mContext), PowerampAPI.ACTIVITY_STARTUP); mContext. startActivity(intent); PowerampAPIHelper.sendPAIntent(mContext, new Intent(PowerampAPI.ACTION_API_COMMAND) .putExtra(PowerampAPI.EXTRA_COMMAND, PowerampAPI.Commands.OPEN_TO_PLAY) .setData(PowerampAPI.ROOT_URI.buildUpon() .appendEncodedPath("playlists") .appendEncodedPath(Long.toString(playlist_id)) .appendEncodedPath("files") .build()),FORCE_API_ACTIVITY); } Link to comment https://forum.powerampapp.com/topic/23453-bring-poweramp-to-the-front/#findComment-108178 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now