Rdio Android SDK v2.0.0 has been released. It contains the following improvements:
- Login flow that doesn’t depend on the official app
- Developers must now explicitly initialize playback
- When on WiFi, use high-quality streams
Rdio#cleanup() now works (#54)
- Unicode handling for API requests
Improved login flow
Since the Android SDK no longer requires the official Rdio app to function, you’ll need to authorize users with the included
OAuth1WebViewActivity. The activity results will include an access token and secret or an error code and description. This access token and secret should then be passed to
Previously the SDK required the user to also have the Rdio for Android installed to authorize your application.
We’ve made playback initialization an explicit step instead of automatically making an API request at launch to retrieve a playback token. Previously you needed to wait for
RdioListener#onRdioReady() before using the SDK. This callback has been removed, you can now start using the SDK right away.
When you know you’ll want the user to listen to music, you’ll need to call
Rdio#prepareForPlayback() and then wait for
RdioListener#onRdioReadyForPlayback(). Note that if you prepare for playback before setting the access token and secret, you’ll only be able to playback 30-second samples. Once you’ve set the access token, you can call
Rdio#prepareForPlayback() again to receive a new playback token.
The reason for this change is that some developers do not use the playback feature and the API request was a waste of resources. It also reduces the time to initialize the SDK.
High Quality Streams
Before this release, the SDK only used low-quality streams. If your application has the
ACCESS_NETWORK_STATE permission, the SDK will detect if the user is connected to the Internet via WiFi and use high quality streams. Note that the SDK does not require this permission, it will detect if your application has it and then take advantage of it. If your application doesn’t have the permission, the SDK will default to low quality streams.
Download the latest release, checkout the getting started guide, and let us know what you think.