Live Streaming Radio

Hello friends, In this blog I am going to share my ideas about ‘Live streaming radio’. It’s bit intresting and it involves using of android MediaPlayer and interacting with the ‘URL’ to stream the music. So, friends let’s get started.

First of all start a new project on android studio. Here I am going to use Android Studio for this, you can also go with Eclipse whichever suits you.

Now follow the instructions-

Project name – Live Radio > Choose empty activity > Activity Name- MainActivity > Finish.

Before proceeding to code make sure you have the following permissions in your AndroidManifest.xml –

For reference check the image given below –

Then make sure your .xml or layout file is coded as given below-

When you will get your your layout file updated as the code given above it will look like the image given below.

Now code your .java file or Activity file as given below-

While operating button’s background colour and button’s text changing be carefull else it well all get mess up.

Now I am showing you some of the screenshots of my live radio while operating.

Check the button’s text and button’s color at each on click.It will help you how to deal with such an operations.

Friends, the first image will be displayed when the device is connecting to the server to fetch media data. Second one will pop up when the media data is loaded and ready to stream. And the last one will be available when the media is playing and user wants to pause it.

Thank you for visiting this tutorial. If you have any doubts or queries regarding this, you can comment below in our comment section.

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *