Jump to content

Can I send current song info to a web server


Bluescreen2001

Recommended Posts

Hi,

I built a big LED matrix display for displaying the current song info of my antique DOS based player (see www.trektech.de if you like).

But today I mostly use Poweramp for laying music, so that display keeps dark :-(

Can I somehow get the current song info from Poweramp to the display's webserver? Lets say a plugin do an http-get on song change containing the sng info like this:

http://mydisplay/cmd?name=songname&artist=artistname

Poorly I have no programming skills on Android, so maybe someone can help?

Thank you

Thorsten

Link to comment
Share on other sites

Poweramp sends current track info via own API and via standard Android API, so you can listen to one of those (with Broadcast Receiver) and re-send to whatever target you need (e.g. http server). Check our SDK for example app.

Thanks!

Link to comment
Share on other sites

  • 3 months later...

Hi,

I built a big LED matrix display for displaying the current song info of my antique DOS based player (see www.trektech.de if you like).

But today I mostly use Poweramp for laying music, so that display keeps dark :-(

Can I somehow get the current song info from Poweramp to the display's webserver? Lets say a plugin do an http-get on song change containing the sng info like this:

http://mydisplay/cmd?name=songname&artist=artistname

Poorly I have no programming skills on Android, so maybe someone can help?

Thank you

Thorsten

 

You'd need to learn how to get an app running on Android. Once you do, the API calls are pretty easy for this.

 

In the Activity's onCreate (you'll know what this means when you start coding) you enter:

IntentFilter iF = new IntentFilter();iF.addAction("com.maxmpz.audioplayer.TRACK_CHANGED");registerReceiver(mReceiver, iF);

That registers the broadcast receiver so your app gets notified when the track changes. Then you'd have to create an onReceive for the mReceiver registered in the above code. In that onReceive, you can use this:

Bundle track = intent.getBundleExtra("track");string artist = track.getString("artist");string title = track.getString("title");

Now that you have your artist and title, you can call your HTTP GET command.

 

Hope this helps!

Link to comment
Share on other sites

You can also use Tasker. I set up a task to receive that intent broadcast and i could get the artist and title. It requires no android programming! Only problem is, I don't think Tasker parses bundles, it just gives it as a huge string. So you'll have to parse the string in your website code.

Link to comment
Share on other sites

  • 11 months later...

I successfully set tasker as in your example above to send track name and other info to a server  (thanks a lot), but how to obtain the same result on STATUS_CHANGED event instead of TRACK_CHANGED event?

 

With TRACK_CHANGED I have the bundle string on %track, but with STATUS_CHANGED (eg. after play/pause) %track is empty

 

 

acording to doc track should exist:

		 * STATUS_CHANGED status value - track has been started to play or has been paused.		 * Note that Poweramp will start track immediately into this state when it's just loaded to avoid STARTED => PAUSED transition. 		 * Additional extras:		 * 	track - bundle - track info 		 * 	paused - boolean - true if track paused, false if track resumed		 *



			
		
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...