not able to play file when set data source to the sdcard file

by Honest » Mon, 13 Apr 2009 17:55:06 GMT


Sponsored Links
 Hello,
I am trying to play file which is stored in SDCARD in emulator. I have
Linux O/S. So i need to provide command in run configuration.

I am providing following parameter.

-sdcard /usr/android/sdcard/mysdcard.iso -audio oss
[i]

The following is my code to play file.

try
{
mMediaPlayer.setDataSource("/sdcard/test_cbr.mp3");
mMediaPlayer.prepare(); // Giving error.
mMediaPlayer.start();

}
catch(Exception e)
{
System.out.println("exception="+e.toString());
}



It is giving me error when i am calling prepare(). Cans some one tell
me what could be wrong in it ? Am i using wrong separator in run
configuration ?


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



not able to play file when set data source to the sdcard file

by Nithin » Mon, 13 Apr 2009 20:10:22 GMT


 Hi,


Normally, this error occurs, when you didnt put sdcard in emulator.
Launch emulator with SDCard. You put the .mp3 file in "data/misc"
folder and try, if its working then the problem is launch emulator
with SDCard only..

Thanks
Nithin
nithinwarier.blogspot.com
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


not able to play file when set data source to the sdcard file

by Honest » Mon, 13 Apr 2009 21:30:51 GMT


 Thanks nitin for your quick reply. From you suggestion i solved my
problem but i am not geting why it is not able to access file from
sdcard even if the file is available there so there should be
something wrong in it. I also added the command line paramiter which i
am passing so please take a look and let me know if you found
something wrong in it.



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



Other Threads

1. Build fails with Error 41

Hello

Since quite some time now, every time I try to build Android from the
latest source, it fails with the same error. I seem to do it very
wrong but at least it once worked....

Lilith:mydroid Chrigi$ repo sync
Fetching projects: 100% (116/116), done.
Syncing work tree: 100% (114/114), done.
Lilith:mydroid Chrigi$ make
build/core/product_config.mk:232: WARNING: adding test OTA key
============================================
TARGET_PRODUCT=htc_dream
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=darwin
HOST_BUILD_TYPE=release
BUILD_ID=
============================================
build/core/copy_headers.mk:15: warning: overriding commands for target
`out/target/product/dream/obj/include/libpv/getactualaacconfig.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for
target `out/target/product/dream/obj/include/libpv/
getactualaacconfig.h'
build/core/Makefile:17: warning: overriding commands for target `out/
target/product/dream/system/etc/apns-conf.xml'
build/core/Makefile:17: warning: ignoring old commands for target `out/
target/product/dream/system/etc/apns-conf.xml'
build/core/Makefile:17: warning: overriding commands for target `out/
target/product/dream/system/etc/vold.conf'
build/core/Makefile:17: warning: ignoring old commands for target `out/
target/product/dream/system/etc/vold.conf'
build/core/Makefile:17: warning: overriding commands for target `out/
target/product/dream/system/etc/wifi/tiwlan.ini'
build/core/base_rules.mk:384: warning: ignoring old commands for
target `out/target/product/dream/system/etc/wifi/tiwlan.ini'
No private recovery resources for TARGET_DEVICE dream
Compiling SDK Stubs: out/target/common/obj/JAVA_LIBRARIES/
android_stubs_current_intermediates/classes.jar
out/target/common/obj/JAVA_LIBRARIES/
android_stubs_current_intermediates/src/android/view/inputmethod/
MutableInputConnectionWrapper.java:5: cannot find symbol
symbol  : constructor InputConnectionWrapper
(android.view.inputmethod.InputConnection)
location: class android.view.inputmethod.InputConnectionWrapper
public  MutableInputConnectionWrapper
(android.view.inputmethod.InputConnection base) { super
((android.view.inputmethod.InputConnection)null); throw new
RuntimeException("Stub!"); }
 
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
make: *** [out/target/common/obj/JAVA_LIBRARIES/
android_stubs_current_intermediates/classes.jar] Error 41

Does anyone know how to fix this?
--~--~---------~--~----~------------~-------~--~----~

2. set activity label in activity code

Hi Experts,

i need to change activity label on the title bar in my code.
at the moment i am setting it in manifest as below:

<activity android:name=".ToDoList"
                  android:label="my list">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

            </intent-filter>
        </activity>


i need to change label in my activity code, any solution?
--~--~---------~--~----~------------~-------~--~----~

3. How to I use touch screen to draw a straight line

4. HttpsURLConnection

5. multiple successive queries to a database

6. Place to feedback to Android Engineers?

7. broadcasts as communication path between custom views and activity