XJimmyPageX
Lurker
Hi, im very new to eclipse and and android, im trying to do the following simple thing -
i wanna play a video.
ive copied the video - sample.3gp file into Raw/sample.3gp , used the layout and dragged a VideoView, other than that i think my code is enough to understand -
package video.hello;
import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.widget.VideoView;
public class HelloVideo extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
VideoView theView = new VideoView(getApplicationContext());
theView.setId(R.id.theView);
MediaPlayer mp = new MediaPlayer();
mp = MediaPlayer.create(theView.getContext(),R.raw.samp le );
mp.start();
}
}
I get sound but no video, the screen is plain black.
Obviously im getting something totaly wrong, give me a hand here please
Thanks!!
Roei
i wanna play a video.
ive copied the video - sample.3gp file into Raw/sample.3gp , used the layout and dragged a VideoView, other than that i think my code is enough to understand -
package video.hello;
import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.widget.VideoView;
public class HelloVideo extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
VideoView theView = new VideoView(getApplicationContext());
theView.setId(R.id.theView);
MediaPlayer mp = new MediaPlayer();
mp = MediaPlayer.create(theView.getContext(),R.raw.samp le );
mp.start();
}
}
I get sound but no video, the screen is plain black.
Obviously im getting something totaly wrong, give me a hand here please
Thanks!!
Roei