Jump to content

Poweramp API Lib and Sample Applications [updated 06 March 2014]

Recommended Posts

Здравствуйте. Я пишу плагин для часов Sony SmartWatch для управления Poweramp'ом и возникла загвоздка с отображением обложки. Когда дисплей телефона включен я получаю BroadcastIntent(ACTION_AA_CHANGED) через powerampApi(и соответственно успешно отображаю обложку на часах), но если телефон заблокировать(или он сам потушит экран по таймауту) - Intent c ACTION_AA_CHANGED powerampApi больше не посылает. Хотя, например, ACTION_TRACK_CHANGED я получаю даже с отключенным дисплеем.

Я так понимаю это сделано в целях экономии энергии или же ACTION_AA_CHANGED отсылавется не сервисом. Как можно обойти эту проблему?


Share this post

Link to post
Share on other sites


This is prototype application utilizing Poweramp AA (Album Art) widget functionality. AA Widget is basically sort of app widget in Poweramp Album art area in main player screen. It's possible to display almost everything the app widget developer wants, and get user interaction events back in the app.

Poweramp manages multiple AA widgets internally and shows appropriate UI for them - Close button (which remembers it's state), and selectable icons to switch between AA widgets.

Example use of AA widgets are providing song lyrics, song extended information (e.g. pulled from internet), artist/album info, etc.


The download for this seems to have dissapeared - could you upload/link it again? I'd like to play with adding an AA widget but have no idea how without the example!

Share this post

Link to post
Share on other sites


I have some trouble with API.

Sometimes player cant send broadcast

03-27 17:49:46.564: WARN/BroadcastQueue(399): Failure sending broadcast Intent { act=com.maxmpz.audioplayer.AA_CHANGED flg=0x10 (has extras) }


at android.os.BinderProxy.transact(Native Method)

at android.app.ApplicationThreadProxy.scheduleRegisteredReceiver(ApplicationThreadNative.java:1009)

at com.android.server.am.BroadcastQueue.performReceiveLocked(BroadcastQueue.java:373)

at com.android.server.am.BroadcastQueue.deliverToRegisteredReceiverLocked(BroadcastQueue.java:439)

at com.android.server.am.BroadcastQueue.processNextBroadcast(BroadcastQueue.java:487)

at com.android.server.am.BroadcastQueue$1.handleMessage(BroadcastQueue.java:140)

at android.os.Handler.dispatchMessage(Handler.java:99)

at android.os.Looper.loop(Looper.java:137)

at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1485)

Can you help me?

Share this post

Link to post
Share on other sites

- PowerampAPI and Sample app updated with Scanner API support. This is supported by Poweramp build 551+.
- Updated reference resources to match build 550+

Share this post

Link to post
Share on other sites

Hello. i'm trying to solve one problem with Poweramp control from external app.

So the task is to toggle play / pause, forward and other actions from another application.
On the first sight there is something in PowerampAPI.java:

/**	 * Poweramp Control action.	 * Should be sent with sendBroadcast().	 * Extras:	 * 	- cmd - int - command to execute.	 */	public static final String ACTION_API_COMMAND = "com.maxmpz.audioplayer.API_COMMAND";

Ok, great, seems that this is what i'm looking for.
So i put that in my code:

Intent poweramp_intent = new Intent("com.maxmpz.audioplayer.API_COMMAND");poweramp_intent.putExtra("cmd",3);MainActivity.this.sendBroadcast(poweramp_intent);

It didn't work. Then i read carefully some examples from Poweramp.apiexample.
There are some explicit intents there, like this:

startService(new Intent(PowerampAPI.ACTION_API_COMMAND).putExtra(PowerampAPI.COMMAND, PowerampAPI.Commands.TOGGLE_PLAY_PAUSE));

But i'm not very familiar with android, and it seems to me that that isn't very possible to create such explicit intent from the other application. 
So what is the most tru way to controll Poweramp from external apps?


Same story in russian:
Добрый день. Не подскажите, какой самый правильный способ управлять Poweramp'ом из стороннего приложения? Согласно PowerampAPI.java

можно послать броадкаст и я попытался сделать это, но не сработало. 
Я так же не уверен, что из стороннего приложения можно послать explicit intent к Poweramp api. По крайней мере у меня не получилось, делал так:

Intent pwramp_intent =   new Intent(PowerampAPI.ACTION_API_COMMAND);pwramp_intent.putExtra(PowerampAPI.COMMAND, PowerampAPI.Commands.TOGGLE_PLAY_PAUSE);startService(pwramp_intent);

и оно валится с:

 java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.maxmpz.audioplayer.API_COMMAND (has extras) }

Возможно я просто неправильно собираю интент.

В какую сторону покопать? 




Deal with it.

Since 5.0.1 all intents to startService must be explicit.

So the right way to construct intent is smth like this


Intent pwramp_intent = new Intent(PowerampAPI.ACTION_API_COMMAND);pwramp_intent.setPackage(PowerampAPI.PACKAGE_NAME);pwramp_intent.putExtra(PowerampAPI.COMMAND, PowerampAPI.Commands.TOGGLE_PLAY_PAUSE);startService(pwramp_intent);




Share this post

Link to post
Share on other sites

Congrats, Very nice!

I've been expecting this for a while, now I can share my

current tracks with my friends over Twitter or Facebook

with Seesmic. Last night I used the Poweramp API in a

simple app to expose the current track info for a simple

sharing Intent.I love it.

Share this post

Link to post
Share on other sites
On 3/29/2011 at 6:26 PM, admin said:

The code is available here: https://github.com/maxmpz/powerampapi

Changes:- PowerampAPI and Sample app updated with Scanner API support. This is supported by Poweramp build 551+.- Updated reference resources to match build 550+v. 1.2- now available on Github- package name is now com.maxmpz.Poweramp- added Widgetpack base classesv. 1.1- fixed few seekbar issuesv. 1.0- initial release


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now