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. Draw a Circle when the user touches the screen

Hi, I've this code:

Java: ( )


import android.content.Context;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;

public class Game extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        setContentView(new Ground(this));

    class Ground extends View {

          public Ground(Context context) {

          public void onDraw(Canvas canvas) {


          public boolean onTouchEvent(MotionEvent event) {

               if (event.getAction() == MotionEvent.ACTION_DOWN) {
                    //TODO: draw the circle
               return true;


And I want to draw a circle when the onTouchEvent is called but I
don't know how to get the canvas Sad

Can you help me?


2. Adding view resource

there is a problem with  .java code.
it gives an error when i build it i am using eclipse.
it says for a resource id that is not in project i have taken the code
from internet .
how can i add a resource id that has view type data structure.


3. Accelerometer shake side-to-side detection issue

4. help around using accelerometer sensor

5. How to add a new kernel module?

6. Android Developer's Challenge 2: Minors can't participate?

7. How to compile a kernel module to Android Linux Kernel 锛