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. emulator - ADB install - user request for permission dangerous protectio


I m working with the cupcake emulator and installing apps using ADB

However, I m never requested (at user level) with the permission
request (even if declared as dangerous) and even if the ADB install is
done when the emulator is running.

Any reason for that ?
How could I check and simulate these permissions requests using the


2. How to draw a circular region of a Bitmap?

Thanks, there were some helpful examples in the API Demos (I guess that's
the purpose).

For those curious, here's how I solved my problem:

    int targetWidth = 100;
    int targetHeight = 100;
    Bitmap targetBitmap = Bitmap.createBitmap(
    Canvas canvas = new Canvas(targetBitmap);
    Path path = new Path();
        ((float)targetWidth - 1) / 2,
        ((float)targetHeight - 1) / 2,
        (Math.min(((float)targetWidth), ((float)targetHeight)) / 2),
    Bitmap sourceBitmap = BitmapFactory.decodeResource(
        new Rect(0, 0, sourceBitmap.getWidth(), sourceBitmap.getHeight()),
        new Rect(0, 0, targetWidth, targetHeight),
    ImageView imageView = (ImageView)findViewById(;


3. Class Cast Exception after classLoader.loadClass() and newInstance!

4. Running Scripts from an Application

5. If you are interrested in LINUX

6. on the status ba

7. SlideME: Looking for Volunteers to Write