How to I get video to play from storage?

by » Wed, 03 Dec 2008 14:28:06 GMT

Sponsored Links
 Hi there,

I am very new to android/programing and would like some help
please :)

I have the android SDK running on eclipse and was wondering how to
create an app that:

1. Plays a specific video I want to release (For example; I publish
the application with a 90 sec video, my app plays it, allows users can
forward, rewind ect.)

I do NOT want the users to be able to play their videos, just mine :)
(For the moment, then I wish for users to interact w/ it, but first
let me make my video play)

Any help will be very very appreciated, especially commented code; (I
am a complete noob remember)

Thank you for your time,
Kind regards,


How to I get video to play from storage?

by Girish » Wed, 03 Dec 2008 19:27:26 GMT

 Dear Turk ,

if you just want to play a video on android emulator these are the

go to this location

                    path = "/sdcard/Yourfilename"; //add your file
name here

Save and quit

run make command .

This will buiild out/target/product/generic/data/app/ApiDemos.apk

Now do adb install out/target/product/generic/data/app/ApiDemos.apk

Now place the videofile (Yourfilename) in /sdcard like this
adb push Yourfilename  /sdcard

Go to apidemos ->media- >mediaplayer -> play video from local file

This should start playing the video which u place in the /sdcard.

Please let me know if you have any other question


On Dec 3, 7:58am, "[EMAIL PROTECTED]"


Sponsored Links

How to I get video to play from storage?

by mangesh » Fri, 05 Dec 2008 06:27:12 GMT

 hi Girish

I am working on android ported on  beagle. While playing video from
media player it is not able to draw anything & giving error going out
of memory . About 25 MB memory is still free. Can u tell me how much
memory is required by media player to play video



How to I get video to play from storage?

by Turk » Wed, 17 Dec 2008 04:37:30 GMT

 Thanks for the help, I got as far as going to the

but didn't know which path to edit; then didn't know how run make
command so I pressed run; to get emulator;  that's is as far as I got
any help please?

Sorry for the silly questions like I said I'm new :):)

Kind regards,


How to I get video to play from storage?

by Girish » Wed, 17 Dec 2008 12:07:10 GMT


Which OS you are using ? I use ubuntu OS. If you have the source code
then you need to build it using make command or using eclipse IDE....

For example change the path to path = "/sdcard/test.3gp"

First try executing Helloworld program as is given in this link. Then
you can try out for playing the audio/video files. 



How to I get video to play from storage?

by hc huang » Wed, 17 Dec 2008 22:05:47 GMT

 Hi Girish
I want to a audio.I go to this position
then save and re-install,but when I go to apidemos ->media- >mediaplayer ->
play audio from local file,it doesn't work.No voice .I hope you could help
me to analysis
this problem.Thank you!


How to I get video to play from storage?

by Dave Sparks » Fri, 19 Dec 2008 03:05:37 GMT

 t seems like you're trying to play the file from your workstation. I
assume you are testing in the emulator. If so, you need to be aware
that the emulator has its own file system and it cannot directly
access your workstation files. Instead, it mounts a file that contains
an image of a FAT file system. You can create the file with the
mksdcard tool and then specify the file to use with the -sdcard
command line option in the emulator.

With the SD card image mounted, you need to push the data file to your
SD card image like this:

adb push /home/huang/sdcard/onelove.mp3 /sdcard

which copies the file to /sdcard/onelove.mp3. Now you can pass the
path to the media player by setDataSource("/sdcard/onelovemp3");

On Dec 17, 6:05am, "hc huang" <> wrote:


How to I get video to play from storage?

by hc huang » Fri, 19 Dec 2008 17:21:41 GMT

 i ,Dave Sparks.
Thanks for your help,Now the solution you give works well.And the problem
has already solved.I find that when I pass the path to the media player,what
I use is like this-setDataSource("/home/huang/sdcard/onelove.mp3"),but not
by setDataSource("/sdcard/onelovemp3");because the emulator has its own file
system,so I use the wrong file path.
Thank you!

On Thu, Dec 18, 2008 at 5:07 PM, Dave Sparks <>wrote:


Other Threads

1. Force alarm sound


Is it possible to force the volume up? I have an alarm that should
wake the user even if the phone is on silent mode.. Is that possible?

Thank you,

2. Questions on opencore in Android


   After having gone through the discussions on "OPENCORE" in Android, the
idea one would have is "opencore 2.x is supported only in master and all the
other branches/tags are based out of opencore 1.x". My local repo is
initailized using "repo init -u git:// -b android-sdk-1.5_r1", I do
see the OPENCORE git is checked out with respect to "android-sdk-1.5_r1"
tag. As I'm in the process of porting the source code corresponds to
"android-sdk-1.5_r1  TAG", I would like get some answers for the following

   1. Assume I have some third party OMX plugins that have been ported for "
   opencore" sources release as part of "android-1.1"  version, what would
   be best appraoch while migrating to "android-sdk-1.5_r1", should I move to
   opencore-1.x or stay with opencore-2.x ?
   2. How exactly do you differentiate between opencore-1.x and opencore-2.x
   in terms of features (for example video encoding/recording capability) ?
   3. Would it be a good idea to manually checkout "master" in opencore in
   the "android-sdk-1.5_r1" repo ? Will this break the build or loose some
   features ?
   4. Is there any documentation that gives a better view of related points
   ? If any, please let me know.
   5. Is there any specific reason to stick to opencore-1.x in
   "android-sdk-1.5_r1 tag" though the master has been migrated to opencore-2.x

Warm Regards,


3. Accessing sdcard filesystem through dev machine filesystem - possible?

4. putExtra

5. problem with AutoCompleteTextView

6. Recording audio with AudioRecord

7. Android 2d Shooter Game AirAttack Follow My Blog!