How to avoid PlayerDriver "invalid percentage value" error?

by Androide » Tue, 15 Jun 2010 15:43:30 GMT


Sponsored Links
 I want to play a live streaming in mp3, but when i call prepareAsync,
"invalid percentage value xxx" shows. This is a example of live
streaming:

 http://83.231.187.202 :80/rtve/radio1.mp3

And this is my simplified code:

mp = new MediaPlayer();
        try {
                        
mp.setDataSource(" http://83.231.187.202 :80/rtve/radio1.mp3");
                } catch (Exception e) {
                }
        mp.setOnPreparedListener( new OnPreparedListener() {
                        @Override
                        public void onPrepared(MediaPlayer mp) {
                                mp.start();
                        }
                });

        Button button = (Button) findViewById(R.id.Button01);
        button.setOnClickListener( new OnClickListener() {
                        @Override
                        public void onClick(View v) {
                                mp.prepareAsync();
                        }


I understand why this is happening, but other apps use this method and
don't show any error in logcat. How can i get this?


Regards.

--



Other Threads

1. Android and Blackberry Enterprise Servers

My entire organization is on the Blackberry Enterprise Server and I
was wondering if there was any plan related to penetrating this
portion of the RIM Business Market with the Android platform and
phones.  Or even better yet if somehow there may be compatibility to
incorporate them somehow.  I know there is intense interest around the
Verizon Google partnership but how can users transition from a
Crackberry to an Android in the business environment?  Or is that just
totally out of reach?

--~--~---------~--~----~------------~-------~--~----~

2. GUI Modifier thread

Hello.

Getting start with Android, I'm trying to create a "Game of life"
software. My application has a TableLayout filled with ImageView for
each cell. I'm trying to run/stop the game once a button has been
click (same button for both). Anyway, what I'm trying to do is to
change my GUI from the thread that run the game. I cannot change the
GUI from a new thread. Ok.

Then I'm trying to use the AsyncTask class to avoid this problem.
Using this mechanism, I still get a "android.view.ViewRoot
$CalledFromWrongThreadException: Only the original thread that created
a view hierarchy can touch its views" Exception.

I'm really stuck and lost with this, any help would be more than
welcome.

Here is the revelant code: http://fr.pastebin.ca/1597363
The Exception is raised in the method drawBoard when I try to set the
image of the ImageView.

Thanks.

I.

--~--~---------~--~----~------------~-------~--~----~

3. Passing messages from BroadcastReceiver to Activity

4. Is there a Java API Spec for Android

5. ListView setAdapter in onCreate, getChildCount is zero in onStart?

6. Design Issues

7. Can't find documentation on end-user FW upgrade process