Scrobble to Libre.fm from Android
Update: This hack is no longer necessary, since the version of SLS now available on the market has been patched to enable scrobbling to Libre.fm as well.
This tutorial will enable you to scrobble your played songs from the Android music player to Libre.fm. Thanks to JonTheNiceGuy for explaining to me how to do this, he did basically all the work!
Warning: Attempt this hack on your own risk. This might break your phone, your computer or blow up your house! The Linux Outlaws cannot be held responsible for any consequences anyone might suffer from hacking their phone in this way.
Prerequisites
You will need the following stuff before we can begin:
- Install Version 1.5 of the Android SDK and set it up (this might also work with the newer Version 1.6, although I didn’t test that)
- Install Eclipse 3.4 or 3.5 and configure it for the SDK as explained here
- Make sure you have enabled “USB debugging” on your phone (do this under Settings → Applications → Development)
- Install svn if you haven’t already done so (on Ubuntu, this is a simple
aptitude install subversionaway)
If, like me, you are using the Samsung i7500 “Galaxy”, you also need a special workaround to get the ADB working with your phone:
- Create the file /etc/udev/rules.d/51-android.rules and paste the following text into it:
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666" - Reload udev:
sudo /etc/init.d/udev restart - Replace the ADB binary in the tools directory of your SDK with this one
- Plug in your phone and start DDMS
Hacking Simple Last.fm Scrobbler
Once you did all of that, you are ready to start on the main part, hacking Simple Last.fm Scrobbler to report to Libre.fm instead of its “evil” counterpart:
- Make yourself a new project folder, change into it and get the source code of SLS with svn:
svn checkout http://a-simple-lastfm-scrobbler.googlecode.com/svn/trunk/a_simple_lastfm_scrobbler - Attach your phone to the computer
- Open a new Android Application project in Eclipse and import the source code you just fetched
- Navigate to src → com.adam.aslfms.service and open the Handshaker.java file
- In this file, change the FQDN in line 187 to
http://turtle.libre.fm - The whole line should now read:
String uri = "http://turtle.libre.fm/?hs=true&p=1.2.1&c=" - Save the file and push the green Run button in the Eclipse toolbar, in the popup choose “Android Application”
- The modified application should now be installed on the phone and will be started automatically
- Just sign in with your Libre.fm username and password — happy scrobbling!

If you should be adventurous enough to try this, please give me some feedback on how you got along in the comments section. I will also try to answer any questions you might have, of course.