May 11, 2015
Jan 28, 2017 (Retired)
Thomas Barthélémy (tbarthel-fr)
Vincent Barthélémy (vbarthel-fr)
Source code

Cheerleader is an Android open source library designed to easily support an artist in an Android application thanks to a SoundCloud account. This project is developed by two Android enthusiasts during their free times.


The library is based on RxJava, if you aren't familiar with it, the following links are strongly recommended :

The library is composed of two main classes :


Why Cheerleader?

Find out our motivations.


Cheerleader is a open-source library developped by two Android enthusiasts during their spare time. Cheerleader is provided "as it" and may present a few bugs on some smartphones. Please, feel free to show your support to this open-source project by leaving your feedback.

Don't forget to read the SoundCloud terms of use.

Please keep in mind that the main goal of this project is to help independent artists reach more fans and bring more visibility through an Android application. If you plans to monetize your app (please don't use Ads), check the Commercial Use section and be sure to pays the artist and SoundCloud for bringing diversified musics for free.

Gradle Dependency

Promoted on Maven Central :

compile 'fr.tvbarthel.cheerleader:library:1.0.2'


As any client, the CheerleaderClient will provide a bridge between your app and the data stored on the SoundCloud servers.

Severals features have been implemented to avoid too many access to the SoundCloud API as well as trying to provide a better user experience :

  • Data will be cached in RAM as long as the client isn't closed (artist and tracks data are unlikely to change every minutes).
  • Response will be stored in a local database for offline usage (see "download track" feature in the TODO list for complete offline mode support).


  mCheerleaderClient = new CheerleaderClient.Builder()

Note that only one artist can be supported at the same time, any new attempt to build a new client for another artist will automatically close the old one.

##Features Currently, only few features are available. Have a look to the TODO section to check incomming features.

Artist's profile

Once a client has been build for a given artist, the complete SoundCloud profile can be retrieved (name, avatar url, description, followers count, etc.) :

            .subscribe(new Action1<SoundCloudUser>() {
                public void call(SoundCloudUser soundCloudUser) {

Artist's tracks

Public tracks of the supported artist are also available (title, artwork url, duration, wave form url, etc.) :

            .subscribe(new Action1<ArrayList<SoundCloudTrack>>() {
                public void call(ArrayList<SoundCloudTrack> soundCloudTracks) {


In addition, comments of a given track can be retrieved :

            .subscribe(new Action1<ArrayList<SoundCloudComment>>() {
                public void call(ArrayList<SoundCloudComment> soundCloudComments) {


Designed to simplify the implementation of the library, we kept the possibility to display some logs in the LogCat :

  mCheerleaderClient = new CheerleaderClient.Builder()

Note that a pipe can be used to chain log levels.


The player encapsulate the whole playback logic including :

  • An internal playlist;
  • Phone Notification, small and expanded (Artist name, track title, track artwork, actions -play, pause, previous, next-);
  • Wear Notification (Artist name, track title, track artwork, actions -play, pause, previous, next, volume up, volume down-);
  • Lock screen enhancement while playing (track artwork);
  • Audio focus compliant (pause when headset is unplugged, pause/resume while hanging up the phone, etc.);
  • Support of third app equalizer.


  mCheerleaderPlayer = new CheerleaderPlayer.Builder()


By default, no pending intent is attached to the notification. In order to link your player activity just add the following lines to the Builder :

  mCheerleaderPlayer = new CheerleaderPlayer.Builder()

Note that small icon as well as small icon background (Lollipop+ only) can also be customized through the Builder.


Pre-Lollipop Post-Lollipop Nougat

Android Wear

Cheerleader now fully supports Android Wear ♥

Player Controls

Note: the color of the control background is extracted by Android from the artwork.

Player interface

The public interface of the Player should allow to perform all actions expected from a player.

   mCheerleaderPlayer.addTrack(track, playNow);

Check the java doc as well as the sample for more information on any variants of the methods above.

Player Listener

In order to provide meaningfull callback to the user, two diferent kinds of listener can be registered.


Listener used to catch any events related to the playback including thoses from the notification / lockscreen controller.

     * Called when a track starts to be played.
     * @param track    played track.
     * @param position position of the played track in the playlist.
    void onPlayerPlay(SoundCloudTrack track, int position);

     * Called when a the player has been paused.
    void onPlayerPause();

     * Called when the player complete a seek action.
     * @param milli time in milli of the seek.
    void onPlayerSeekTo(int milli);

     * Called when the player has been destroyed.
    void onPlayerDestroyed();

     * Called when the player paused due to buffering more data.
    void onBufferingStarted();

     * Called when the player resumed after having buffered enough data.
    void onBufferingEnded();

     * Called when current position time changed.
     * @param milli current time in milli seconds.
    void onProgressChanged(int milli);

See also java mCheerleaderPlayer.registerPlayerListener(listener) and java mCheerleaderPlayer.unregisterPlayerListener(listener)


A second listener used to catch any events performed on the internal playlist.

     * Called when a tracks has been added to the player playlist.
     * @param track track added.
    void onTrackAdded(SoundCloudTrack track);

     * Called when a tracks has been removed from the player playlist.
     * @param track   track removed.
     * @param isEmpty true if the playlist is empty after deletion.
    void onTrackRemoved(SoundCloudTrack track, boolean isEmpty);

See also java mCheerleaderPlayer.registerPlaylistListener(listener) and java mCheerleaderPlayer.unregisterPlaylistListener(listener)

Release Notes

  • 1.0.2:
    • Notification layout for Android N.
    • Use last build tools / libraries dependencies.
  • 1.0.1:
    • Allow multiple app using Cheerleader to be installed at the same time (x
    • add SoundCloudArtworkHelper#getCoverUrl(SoundCloudUser user, String size) method to retrieve user artwork url for different size.
  • 1.0.0:
    • No API break to mention.
    • Add the support of Android Wear notification.
    • Improve stability of the playback service.
    • Use last version of RxJava and Retrofit.


  • Add the possibility to download the tracks localy.
  • Support Android Auto.
  • Support Chromecast.

Methods Count

    |cheerleader 578
    |    |client 264
    |    |player 201
    |    |offline 43
    |    |media 29
    |    |remote 22
    |    |helpers 3


Contributions are welcome (: You can contribute through GitHub by forking the repository and sending a pull request.

When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. For this project, we tries to follow the code style guidelines of the Android open source project.

Don't forget to run gradlew :library:check to ensure static analysis tools won't break the build.


Credits go to Thomas Barthélémy and Vincent Barthélémy as well as The SoundCloud API Team for providing an API which allow the developers to build apps upon their services.


Copyright (C) 2015 tvbarthel

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Special Thanks to ...

Ivan B , for his daily support and motivation through his lyrics.