Skip to content
Launch offer: Free installation on every Extended license this month! Shop now
  1. Home
  2. Blog
  3. ExoPlayer Radio Streaming in Android: A Beginner Guide

ExoPlayer Radio Streaming in Android: A Beginner Guide

A friendly beginner guide to ExoPlayer radio streaming on Android. Learn how live audio playback works, which stream formats to use, and how to keep music playing in the background.

November 03, 2026 8 min read Mobile Apps
ExoPlayer Radio Streaming in Android: A Beginner Guide

If you want to build an Android radio app, exoplayer radio streaming is one of the most reliable ways to play live audio on phones and tablets. ExoPlayer is the media player library behind many popular Android apps, and it handles the hard parts of live streaming for you, such as buffering, network changes and different audio formats.

In this beginner guide, we will walk through what ExoPlayer is, how a radio stream actually works, the basic setup steps, and the common mistakes that cause silent or stuttering playback. You do not need to be an expert. A basic understanding of Android and Kotlin is enough to follow along.

What Is ExoPlayer and Why Use It for Radio?

ExoPlayer is an open-source media player created by Google. Today it lives inside the AndroidX Media3 library, so new projects should use Media3 ExoPlayer rather than the older standalone version.

Android also has a built-in MediaPlayer class, but it is limited and harder to customise. ExoPlayer is the better choice for radio because it:

  • Supports common live formats like MP3, AAC and HLS
  • Handles buffering smoothly when the internet connection is weak
  • Works well with background playback and lock screen controls
  • Can read stream metadata, such as the current song title on many stations
  • Gets regular updates as part of the official Android libraries

For a small radio station, church broadcast, or online music channel, this means a more stable listening experience and fewer complaints from listeners.

How Live Radio Streaming Works

Before writing code, it helps to understand the bigger picture. Your app does not create the audio. It simply connects to a stream URL and plays what the server sends.

The three parts of a radio setup

  1. The broadcaster: software or a DJ tool that sends live audio to a server.
  2. The streaming server: usually Shoutcast or Icecast, which shares that audio with many listeners at once.
  3. The player app: your Android app, using ExoPlayer to play the stream URL.

If you do not have a streaming server yet, a dedicated radio hosting plan can give you one. Anow Hosting offers SonicPanel radio plans (Radio Lite, Radio Pro and Radio Max) on the hosting plans page, which give you a stream URL you can plug straight into your app.

Choosing the right stream format

Most radio stations stream in MP3 or AAC. These are simple, continuous audio streams that ExoPlayer plays easily. HLS (stream URLs ending in .m3u8) splits audio into small chunks and can adjust quality to the listener's connection. For beginners, a plain MP3 or AAC stream over HTTPS is the easiest place to start.

Setting Up ExoPlayer Radio Streaming Step by Step

Here is a simple, beginner-friendly overview of the setup. The exact code may vary with library versions, so always check the latest Media3 documentation.

Step 1: Add the Media3 dependencies

In your app module's Gradle file, add the Media3 ExoPlayer library. If you plan to play HLS streams, also add the Media3 HLS module. For background playback and notification controls, add the Media3 session module too.

Step 2: Add internet permission

Your app needs the INTERNET permission in the AndroidManifest file. Without it, the player will never connect to the stream. If you will use a foreground service for background play, you also need the foreground service permissions required by newer Android versions.

Step 3: Create the player and load your stream

The basic flow is short and easy to remember:

  1. Build an ExoPlayer instance with ExoPlayer.Builder(context).build().
  2. Create a media item from your stream URL with MediaItem.fromUri(url).
  3. Pass it to the player with setMediaItem().
  4. Call prepare(), then play().

That is the core of exoplayer radio streaming. Within a few lines of code, your app can play a live station.

Step 4: Release the player properly

When the player is no longer needed, call release(). Forgetting this is a common cause of memory leaks and battery drain. Always release the player when the service or screen is destroyed.

Keeping the Radio Playing in the Background

Radio listeners expect music to keep playing when they lock their phone or switch apps. If your player lives inside an Activity, the audio may stop when the user leaves the screen.

The recommended solution is to run your player inside a MediaSessionService from Media3. This does several useful things:

  • Keeps playback alive as a foreground service
  • Shows a media notification with play and pause buttons
  • Adds lock screen controls automatically
  • Lets headphones, Bluetooth devices and Android Auto control playback

Your Activity then connects to this service using a MediaController. This separation makes your app cleaner and much more reliable.

Handling audio focus

When a phone call comes in or another app starts playing audio, your radio should pause or lower its volume. ExoPlayer can manage this for you when you set audio attributes and enable audio focus handling. It is a small detail, but listeners notice it.

Common Problems and Simple Fixes

Even with a correct setup, beginners often run into a few familiar issues. Here are the most common ones.

No sound at all

Check the stream URL first. Open it in a browser to see if it plays. Next, remember that Android blocks plain http:// traffic by default. Use an HTTPS stream URL, or allow cleartext traffic for that specific domain in your network security configuration.

Playback stops after a network drop

Live streams can fail when users move between Wi-Fi and mobile data. Add a player listener that watches for errors and tries to reconnect by preparing the player again. A short delay before retrying helps avoid endless loops.

Song titles not showing

Many Shoutcast and Icecast streams send song titles as ICY metadata. ExoPlayer can read this through the player's metadata callbacks. If nothing appears, the station may simply not be sending metadata.

Long delay before audio starts

Buffering settings control how much audio loads before playing. You can adjust the load control to start faster, but going too low may cause stuttering on slow networks. Test on real devices with weak signals.

Build It Yourself or Start With a Ready-Made App?

Learning exoplayer radio streaming from scratch is a great skill, but a full radio app needs much more than a player. You also need a clean design, station management, ads, notifications and Play Store publishing.

If you want to launch faster, a ready-made script can save weeks of work. For example, the Single Radio app with PHP admin panel includes native Android (Kotlin) and iOS (SwiftUI) apps for a live radio station. If you want a directory of many stations, you can browse the radio directory scripts and other options in our products section.

Prefer something built just for your brand? Our Android app development team builds native Kotlin apps with Material UI and helps publish them on Google Play.

Final Tips for Beginners

  • Start simple: get one MP3 stream playing before adding extra features.
  • Use Media3: it is the current home of ExoPlayer.
  • Test on real phones with poor signal, not only on emulators.
  • Plan for background play from day one with a MediaSessionService.
  • Use a stable stream server so your app has reliable audio to play.

With these basics, exoplayer radio streaming becomes far less intimidating, and you can build a radio app your listeners will enjoy every day.

Ready to launch your own radio app? Whether you need a custom Android app, a stream setup or help installing a radio script, tell us what you need and get a free quote from our team today.

Frequently asked questions

What is ExoPlayer used for in a radio app?

ExoPlayer is a media player library for Android that can play live audio streams such as MP3, AAC and HLS. In a radio app it handles buffering, playback and reconnecting to your station's stream URL.

Is ExoPlayer now part of Media3?

Yes. Google moved ExoPlayer into the AndroidX Media3 library, so new projects should use the Media3 ExoPlayer dependencies instead of the old standalone ExoPlayer packages.

How do I keep radio playing when the app is closed?

Run the player inside a MediaSessionService (a foreground service) so Android treats it as active media playback. This also gives users lock screen and notification controls.

Which stream format works best for ExoPlayer radio streaming?

Common Shoutcast and Icecast streams in MP3 or AAC work well, and HLS is a good choice for adaptive quality. Always use an HTTPS stream URL if possible, because Android blocks plain HTTP by default.

Do I need my own streaming server for a radio app?

The app only plays a stream URL, so you need a station server that broadcasts your audio. A radio hosting plan such as a SonicPanel package can provide that stream for your app.

#ExoPlayer#Android radio app#live streaming#Media3#Kotlin#online radio
Share:

More articles