Skip to content

Armadillo Blogpost #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 29, 2021
Prev Previous commit
Next Next commit
Update the Armadillo post and prepare for publication
  • Loading branch information
rtyler committed Jun 1, 2021
commit 78dcbb54b10cec33a10255ace3ba50c60763692f
4 changes: 4 additions & 0 deletions _data/authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,7 @@ gregr:
name: Greg Reznik
github: imfromthebay


nathans:
name: Nathan Sass
github: NathanSass
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
---
layout: post
title: "Android Audio player tutorial with Armadillo"
title: "Armadillo makes audio players in Android easy"
tags:
- android
- kotlin
- audio player
author: NathanSass
- armadillo
- featured
author: nathans
team: Android
---

![Armadillo Image](https://i.ibb.co/LzTK79B/armadillo.jpg)

In this tutorial, we are going to explore how to build an audio player in an Android app using Armadillo. We are going to do that by discussing what goes into designing an effective audio player as well as some best practices for handling audio in an app.
Armadillo is the fully featured audio player library Scribd uses to play and
download all of its audiobooks and podcasts, which is [now open
source](https://github.com/scribd/armadillo-and). It specializes in playing HLS
or MP3 content that is broken down into chapters or tracks. It leverages
Google’s Exoplayer library for its audio engine. Exoplayer wraps a variety of
low level audio and video apis but has few opinions of its own for actually
using audio in an Android app.

## What is Armadillo?
![Armadillo Image](https://i.ibb.co/LzTK79B/armadillo.jpg)
<sup>Icon made by [Freepik](https://www.flaticon.com/authors/freepik) from [www.flaticon.com](http://www.flaticon.com/) <sub>

Armadillo is the fully featured audio player library Scribd uses to play and download all of its audiobooks and podcasts. It specializes in playing HLS or mp3 content that is broken down into chapters or tracks. It leverages Google’s Exoplayer library for its audio engine. Exoplayer wraps a variety of low level audio and video apis but has few opinions of its own for actually using audio in an Android app. The leap required from Exoplayer to audio player is enormous both in terms of the amount of code needed as well as the amount of domain knowledge required about complex audio related subjects. Armadillo provides a turn-key solution for powering an audio player and providing the information to update a UI.
The leap required from Exoplayer to audio player
is enormous both in terms of the amount of code needed as well as the amount of
domain knowledge required about complex audio related subjects. Armadillo
provides a turn-key solution for powering an audio player and providing the
information to update a UI.

- **Easy-to-use** because it outputs state updates with everything needed for a UI or analytics. Works in the background state.
- **Effective** because it uses Google’s Exoplayer as the playback engine.
Expand All @@ -24,16 +34,18 @@ Armadillo is the fully featured audio player library Scribd uses to play and dow
required for a high quality audio player.

## What does it include?
- Support for HLS and mp3 audio

- Support for HLS and MP3 audio
- Exoplayer for downloading and playback
- MediaBrowserService so the app can be played in the background, browsed by other apps, and integrated with Android Auto.
- MediaSession to support commands from media controllers, ex. a bluetooth headset.

## Installation:
## Getting Started:

The library is hosted with Github packages so you will need to add the Github registry with authentication to your build.gradle file. See the official docs on authenticating here. But you will need to:
Step 1: Generate a personal access token from your Github account.
Step 2: Add the Github package registry with authentication to your build.gradle file.

1. Generate a personal access token from your Github account.
1. Add the Github package registry with authentication to your `build.gradle` file.

```kotlin
maven {
Expand All @@ -46,8 +58,6 @@ maven {
}
```

## Getting Started:

It is as easy as adding this code snippet to your Activity / Fragment to play your first piece of content.

```kotlin
Expand Down Expand Up @@ -77,6 +87,7 @@ That’s all you need to get started!

## Next Steps:

For a more complex example, please see the TestApp included in the library. If you have any problems, don’t be afraid to open up an issue in the repository.
For a more complex example, please see the [TestApp](https://github.com/scribd/armadillo-and/tree/main/TestApp) included in the library. If
you have any problems, don’t be afraid to open up an issue [on
GitHub](https://github.com/scribd/armadillo-and).

<sub><sup>Icon made by [Freepik](https://www.flaticon.com/authors/freepik) from [www.flaticon.com](http://www.flaticon.com/) <sub><sup>