• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps VideoView issue.

OberSchutze

Newbie
Jul 19, 2012
14
1
Hello I am having an issue with a small application that I am making. The APK compiles and I am not receiving any errors, however when I go to open the application up it does not show up in my application list despite it saying it installed.

Here is my JAVA and XML files.

[HIGH]package com.AnVideoView;

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

public class AnVideoView extends Activity {

String SrcPath = "/sdcard/Video/video.mp4";

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
VideoView myVideoView = (VideoView)findViewById(R.id.myvideoview);
myVideoView.setVideoPath(SrcPath);
myVideoView.setMediaController(new MediaController(this));
myVideoView.requestFocus();
myVideoView.start();
}
}[/HIGH]

XML
[HIGH]<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:eek:rientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="My Video Player"
/>
<LinearLayout
android:eek:rientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<VideoView
android:id="@+id/myvideoview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>[/HIGH]
 
OberSchutze said:
Hello I am having an issue with a small application that I am making. The APK compiles and I am not receiving any errors, however when I go to open the application up it does not show up in my application list despite it saying it installed.

Here is my JAVA and XML files.

[HIGH]package com.AnVideoView;

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

public class AnVideoView extends Activity {

String SrcPath = "/sdcard/Video/video.mp4";

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
VideoView myVideoView = (VideoView)findViewById(R.id.myvideoview);
myVideoView.setVideoPath(SrcPath);
myVideoView.setMediaController(new MediaController(this));
myVideoView.requestFocus();
myVideoView.start();
}
}[/HIGH]

XML
[HIGH]<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:eek:rientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="My Video Player"
/>
<LinearLayout
android:eek:rientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<VideoView
android:id="@+id/myvideoview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>[/HIGH]

Hmmm.. this is a tricky bug. I'll study this and if I find something wrong, I will let you know. I am taking programming classes in java and C++, so I'm new to the developing world, but I will be of as much assistance as possible!
 
Upvote 0
Rwhittaker13 said:
Hmmm.. this is a tricky bug. I'll study this and if I find something wrong, I will let you know. I am taking programming classes in java and C++, so I'm new to the developing world, but I will be of as much assistance as possible!

I've had a similar issue when I tried installing QPST.apk on my phone. Installed correctly, but it showed as a system app, so it did not show up on my apps list
 
Upvote 0
[HIGH]<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.AnVideoView"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >

<activity
android:name=".AnVideoView"
android:label="@string/app_name"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>[/HIGH]
 
Upvote 0
I changed the minsdk to 15 and that seemed to have fixed the problem. Now I want to just have a stop play option without the forward or back and embed the video file into the apk. Is it even possible to embed a mp4 into a apk file?

EDIT: I was able to embed the video file into the APK, I am still stuck on making the control just have a stop and play button though.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones