##This version of the library is abandoned. I'm rewriting it in Dart.
Libepimetheus is an Android library to connect to Pandora Music's REST API, documented here. It's the same API the web app uses. Libepimetheus doesn't enforce ads or skip limits.
The library can optionally use a free smart DNS service, Portaller, to access Pandora from outside the US.
I'm building a Pandora client for Android with this, check it out.
- Browse functions
- Functions to get song details (lyrics, etc.)
The library is available through JitPack. Add the JitPack repository to your app module's build.gradle
file:
repositories {
...
maven { url 'https://jitpack.io' }
}
Then, add the library in the dependencies
closure.
dependencies {
...
implementation 'com.github.EpimetheusAndroid:libepimetheus:1.0'
}
Alternatively, you can manually use the library aar
and sources jar
from the releases page. Make sure to add the following dependencies if you do:
dependencies {
...
// Not necessary when using JitPack
implementation 'androidx.media:media:1.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
}
KDoc, generated in GFM Markdown, is available in the docs
directory in this repository.
Continue reading to get started.
To authenticate with Pandora, create a User
object. The last boolean enables Portaller, a free smart DNS service, to access Pandora outside the US. User
objects are Parcelable
.
val user = User("username", "password", usePortaller = true)
Get a list of the user's stations with the Stations.getStations
function. This will return a list of Station
objects. Station
objects are Parcelable
.
val stations: List<Station> = Stations.getStation(user)
Get a station playlist with the Station.getPlaylist
function. This will return a list of (usually) four Song
objects.
val playlist: List<Song> = stations[index].getPlaylist(user)
To get more songs, call getPlaylist
again.
playlist += stations[index].getPlaylist(user)
Song
objects have many properties, like:
// Song name, album, artist
song.name; song.album; song.artist
// Audio URI
song.audioUri
// Art URL (returns the URL for the nearest larger existing size)
song.getArtUrl(preferredSize)
// Rating
song.rating
Add and remove feedback with the feedback functions:
song.addTired(user)
song.addFeedback(thumbsUp = true, user)
song.deleteFeedback(user)
You can use this function to make a custom API request.