1. Check out our companion app, Forums for Android! Download from Google Play

VideoView issue.

Discussion in 'Application Development' started by OberSchutze, Dec 19, 2012.

  1. OberSchutze

    OberSchutze Member
    Thread Starter
    36

    Jul 19, 2012
    14
    1
    36
    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]
     

    Advertisement

  2. Rwhittaker13

    Rwhittaker13 Member
    6

    Dec 14, 2012
    7
    1
    6
    Male
    None as of now
    Butler, PA
    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!
     
  3. Rwhittaker13

    Rwhittaker13 Member
    6

    Dec 14, 2012
    7
    1
    6
    Male
    None as of now
    Butler, PA
    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
     
  4. OberSchutze

    OberSchutze Member
    Thread Starter
    36

    Jul 19, 2012
    14
    1
    36
    On a side note, is is possible to embed a mp4 into an application so that the whole thing is self contained?
     
  5. jonbonazza

    jonbonazza Well-Known Member
    163

    Jul 13, 2010
    1,934
    458
    163
    Male
    Can you post your manifest file?
     
  6. OberSchutze

    OberSchutze Member
    Thread Starter
    36

    Jul 19, 2012
    14
    1
    36
    [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]
     
  7. OberSchutze

    OberSchutze Member
    Thread Starter
    36

    Jul 19, 2012
    14
    1
    36
    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.
     

Share This Page

Loading...