Making VideoView play automatically

by Miguel Paraz » Sat, 25 Apr 2009 14:40:17 GMT

Sponsored Links
How can I make a VideoView play immediately, without the user having
to select the MediaPlayer UI Play button? Thanks!

Making VideoView play automatically

by Nithin Varamballi » Sat, 25 Apr 2009 14:55:56 GMT

          Create one one obect of VideoView
         then give objectname .start();

Thank You
Nithin N V


Sponsored Links

Making VideoView play automatically

by Miguel Paraz » Sat, 25 Apr 2009 16:27:03 GMT


Thanks for the reply!

Nothing happens, though. No logcat logs.


Making VideoView play automatically

by Nithin Varamballi » Sat, 25 Apr 2009 16:33:05 GMT

 Try this code... This code woks for me......

package mypack.mydemos;

import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class demo extends Activity {
    /** Called when the activity is first created. */
        private VideoView myVideo,myVideo1;
        private MediaController mc,mc1;
    public void onCreate(Bundle savedInstanceState) {
                        mc1=new MediaController(this);

Thsnk You
Nithin N V


Making VideoView play automatically

by Miguel Paraz » Sat, 25 Apr 2009 18:31:55 GMT


Yes, it works!

The key is to start() before attaching the MediaController.

Thank you.

Making VideoView play automatically

by l hx » Tue, 28 Apr 2009 20:21:01 GMT

 now i found a matter in my device,but the emulation is ok. that is, when  i
use the movieview in camera to play video ,but when i come back to another
activity in my app. the orientation of the screen is also transverse. who
know why?


Other Threads

1. OpendGL ES porting on hardware accelerators on android

Hi All,
As i am beginer to android & openGL ES, i have some queries regarding
porting OpenGL ES on Graphic accelerators. Could you please tell me
how do i start with the porting activity?
- Is there any tutorial which talks about this.
Can anybody give some some direction so that i can start learning
these things...



2. How to create world readable file

I am trying to launch package installer to install an APK file that I have
already installed:

    private void installApk(String file) {
        Uri pkgUri = Uri.parse("file://" + file);
        Intent intent = new Intent();
Now, this is all fishy, I know, depending on undocumented (?) behavior of
PackageInstallerActivity. My problem is I need to give a file that
PackageInstallerActivity can read.

I tried many things:

FileOutputStream fout = Context.openFileOutput("xxx.apk",

But this file is created in a directory /data/data/<app>/files, which is
mode drwx------, so other processes cannot read it.

File dir = Context.getDir("downloader", Context.MODE_WORLD_READABLE);

But there's no way for me to create a File inside the <dir> with world
readable permission

(3) this one works, but is extremely convulsing:

            SharedPreferences pref =

            SharedPreferences.Editor editor = pref.edit();
            editor.putInt("text_size", 0);
            file = mReader.getFilesDir().getParent() +

I tried this, and I was actually able to invoke the PackageInstallerActivity
to install my APK file. I tested on cupcake and 1.0 emulator.

On well....

I looked at the Browser, and it uses a permission


But this doesn't seem to be documented either. (See

3. Need someone with a phone to confirm our app works

4. Getting Current Location on my Device works on emulator but not on my device

5. Writing widgets *without* persistent services

6. music player crash

7. How to start other activity by code