views:

114

answers:

1

First:

Does anyone know the filepath for an Archos? I'm trying to get some media/audio to play, and it just won't find it...

 public void onClick(View v1) {               
                final MediaPlayer mp = new MediaPlayer();
                try {
                    mp.setDataSource("ARCHOS5:/Music/manowar.mp3");
                    mp.start();
                    Toast.makeText(Textbox.this, "Working", Toast.LENGTH_LONG).show();
                    mp.setLooping(true);
                } catch (IllegalArgumentException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (IllegalStateException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        });

What is wrong with that code?

Second:

I can't get audio files in "R.raw.'filename'" to play...

It works PERFECTLY on the emulator, but when I press the play button (a different one) on the Archos, it just crashes...

Can someone give me some advice?

Thanks alot...

James

A: 

You should use openRawResource() to access items in R.raw. To access the SD card, check out resources like this post.

Felix
Ahhhh, thank you so, so so much =] I knew I might be missing some code =] -Testing it shortly...
James Rattray
Hmmm, how can I use this? -like what context?
James Rattray
In any Activity/Service/ContentProvider in your package, I guess? Never used it myself, I just knew about those resources.
Felix