internet radio on android

All your problems with Audio, Video and Images.

internet radio on android

Postby drik_wen » Sat Jul 12, 2008 3:12 am

Is there someone can help me on how to make an internet radio on android..
U can give me a suggestion on how to make it or may be a source code if you have it..
I'm just a beginner on this side, so I meet a lot of problem on writing android program..
thx..
drik_wen
Freshman
Freshman
 
Posts: 6
Joined: Sat Jul 12, 2008 3:00 am

Top

Postby zrgiu » Sat Nov 01, 2008 5:57 pm

Hello

I would like some ideas in that direction too. I've tried several methods so far, and most of them worked with normal remote mp3 files, but none of them with radio streams (both aac and mp3)

Thanks
zrgiu
Junior Developer
Junior Developer
 
Posts: 10
Joined: Sat Nov 01, 2008 5:54 pm

Postby MrSnowflake » Sat Nov 01, 2008 6:50 pm

I thought playing shoutcast radio was possible?!
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby zrgiu » Sat Nov 01, 2008 9:40 pm

yeah, i thought too .. but simply using the media player with the radio uri doesn't work. Belive me, i've tried stuff for a few days now ..
zrgiu
Junior Developer
Junior Developer
 
Posts: 10
Joined: Sat Nov 01, 2008 5:54 pm

Postby shishir.bobby » Sat Feb 27, 2010 12:39 pm

hi there all,

it works

i hv been workling on radio app
and it is posible to run radio app


everything runs just perfect
but there is just 1 problem

its occur wen buffering happens

i mean

buffering starts, radio starts simultaneously, but due to internet connection speed, buffering gets hault,the main problem is, i am not able to keep playing the radio after buffering is done,

it should be automatic, like in utube


so wat i didi is i put one button beside it,
wen buffering stops, i hv to hit that button, than only i m able listen radio again

i hope i m very clear,about wat i am saying...


any suggestions, would be appreciated.


Thanks And Regards
Shishir.bobby
shishir.bobby
Experienced Developer
Experienced Developer
 
Posts: 76
Joined: Thu Apr 09, 2009 11:41 am

Postby Luki » Tue Mar 09, 2010 10:35 pm

Hmm, that means you can play an mp3-url? Can you post this link, as I am not able to play any mp3 stream yet. Or how you implemented it? For your problem, i have a suggestion. There is the MediaPlayer.OnBufferingUpdateListener, that is called whenever something changes in the buffering status. Also the amount of buffered data is given. So you could execute the action of the button automatically when buffering is 100% or something like that.

Cheers
Luki
Developer
Developer
 
Posts: 32
Joined: Fri Jul 24, 2009 12:59 pm

Top

Postby shishir.bobby » Wed Mar 10, 2010 7:46 am

yea sure ,will post here my code.

one thing

i can play mp3 here and also radio streams like http://129.7.48.199/
, but just wana knw,
iphones supports m3u,.pls etc files to.

so does android can play .pls file


Thank n regards
SHishir.bobby
shishir.bobby
Experienced Developer
Experienced Developer
 
Posts: 76
Joined: Thu Apr 09, 2009 11:41 am

Postby shishir.bobby » Wed Mar 10, 2010 8:17 am

hi there,

this will guide u to play .mp3


"http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/"

if u r not able to get this, just let me knw,will share my code than...
..can u eloborate with wat u were saying about buffering,or if u can help me out with writing a code.

regards
shishir.bobby :)
shishir.bobby
Experienced Developer
Experienced Developer
 
Posts: 76
Joined: Thu Apr 09, 2009 11:41 am

Postby shishir.bobby » Wed Mar 10, 2010 1:17 pm

i know this is not the right place to ask this question but anyways...


is there any way, to knw the that phone is currently connected to internet or not.
like radio app need to be connected to internet,in order to play streams.

when, user starts the application, the application itself should check whether it is connected to internet or not, that it should go forword.
any help will be appreciated



:)
regards
shishir.bobby
shishir.bobby
Experienced Developer
Experienced Developer
 
Posts: 76
Joined: Thu Apr 09, 2009 11:41 am

Postby Luki » Thu Mar 11, 2010 1:42 pm

Hehe, much questions for a single thread:

First:
I wasn't able to make the tutorial running. But it looks like the tutorial is for an application that streams a whole file from a webserver, but not an ongoing live stream as you have to provide the filesize when starting the custom mediaplayer. Were you able to play an ongoing live stream? Would be nice if you share some code or tell me how you did it.

Second:
All my tests with m3u and pls files didn't work, so i think it is not possible to play them. It's anoying that there are so few informations about supported media types.

Third:
You could check if the Google server on www.google.com is available. If not it gives you an exception.

Fourth:
First, you have to implement the interface MediaPlayer.OnBufferingUpdateListener into your activity. Then you have to make a method looking like the following:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public void onBufferingUpdate(MediaPlayer arg0, int percent) {
  2.  
  3.         Log.d(TAG, "onBufferingUpdate percent:" + percent);
  4.  
  5.  
  6.  
  7. }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Then, before you start the mediaplayer (mediaplayer.start()), you have to bind the OnBufferingUpdateListener to the mediaplayer:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. mMediaPlayer.setOnBufferingUpdateListener(this);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


From now on, everytime something changes in the buffering status, the onBufferingUpdate-method will get called and you the code in there will be run. You can check there how much data is already buffered and react on that.
Check the mediaplayer sample in the ApiSample Code of the SDK. There in the Videoplayer sample it is done exactly like that (it's similar to use with audio).
Am I clear?:-)

Cheers, Luki
Luki
Developer
Developer
 
Posts: 32
Joined: Fri Jul 24, 2009 12:59 pm

Postby asolanki » Wed Mar 24, 2010 6:45 am

Hi!!!

.m3u and .pls files are simply playlist file so just try to parse them and we will be able to play all the files...
asolanki
Senior Developer
Senior Developer
 
Posts: 151
Joined: Thu Jan 08, 2009 7:32 am

Postby shishir.bobby » Wed Mar 24, 2010 7:12 am

i already tried,but not able to play...........

regards
shishir.bobby
shishir.bobby
Experienced Developer
Experienced Developer
 
Posts: 76
Joined: Thu Apr 09, 2009 11:41 am

Postby asolanki » Wed Mar 24, 2010 8:07 am

Hi!!!

check this application.. it is able to play pls and m3u

http://sourceforge.net/projects/ambientmp/
asolanki
Senior Developer
Senior Developer
 
Posts: 151
Joined: Thu Jan 08, 2009 7:32 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 11 guests