I'm repling you directly here it could be useful for other ppl too... or someone could help us too...
As far as I have understood atm there's no way to get android.resource:// to work property, I tested it using an inside browser in my app and it always bring me to a 404 error. Btw using the internal web browser I managed to reach at least files under assets directory using file:///android_asset/namefile.ext It works fine in loadUrl, eg. I tried to place there a .mp4 file and it returns a white screen (instead of the 404 error) so I think it is able to reach that file. I'm testing this with VideoView (because I'm managing to play a local video instead of a local sound) but it doesn't work :( It seems that both file:/// and android.resource aren't working fine with VideoView and Mplayer both atm. On 23 Set, 10:44, Matteo Crippa <[EMAIL PROTECTED]> wrote: > I'm an Android novice, but what do you think about this solution? > > MediaPlayer mNotify; > mNotify = MediaPlayer.create(this, R.raw.beep); > mNotify.start(); > > It should play your audio file without problems > > On 23 Set, 04:13, CG <[EMAIL PROTECTED]> wrote: > > > Hey, > > > I try to play a local sound in a notification. The issue I meet is the > > folowing : I am unable to load the file. > > > My code is : > > > Uri uri = Uri.parse("android.resource://com.xirgonium.android/raw/ > > beep"); > > mNotify.sound = uri; > > > The package name is the one described in my manifest. > > > I get the error : > > > 09-23 01:55:12.692: WARN/NotificationService(47): error loading sound > > for android.resource://com.xirgonium.android/raw/beep > > 09-23 01:55:12.692: WARN/NotificationService(47): java.io.IOException: > > Prepare failed.: status=0xFFFFFFFC > > 09-23 01:55:12.692: WARN/NotificationService(47): at > > android.media.MediaPlayer.prepare(Native Method) > > 09-23 01:55:12.692: WARN/NotificationService(47): at > > android.media.AsyncPlayer$Thread.run(AsyncPlayer.java:76) > > > Now if I try (as defined here > > :http://code.google.com/android/reference/android/content/ContentResol... > > Uri uri = Uri.parse("android.resource://" + PACKAGE_NAME + "/" + > > R.raw.beep); > > I get the error : > > 09-23 02:05:05.690: WARN/NotificationService(47): error loading sound > > for android.resource://com.xirgonium.android/2131034112 > > 09-23 02:05:05.690: WARN/NotificationService(47): java.io.IOException: > > Prepare failed.: status=0xFFFFFFFC > > 09-23 02:05:05.690: WARN/NotificationService(47): at > > android.media.MediaPlayer.prepare(Native Method) > > 09-23 02:05:05.690: WARN/NotificationService(47): at > > android.media.AsyncPlayer$Thread.run(AsyncPlayer.java:76) > > > I am pretty sure the package name is correct because I have the > > folowing apk in my emulator : > > -rw-r--r-- system system 263463 2008-09-23 02:04 > > com.xirgonium.android.apk > > > I just try to load a .wav file. > > > Can anyone help me on this point (code snippet is sufficient :-)) Or > > how can I be sure the file is in my apk ? > > > Thanks for your help ! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---