Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
 
LinkBack Thread Tools
Old December 19th, 2012, 10:36 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jul 2012
Posts: 14
 
Device(s): Galaxy Nexus, TF101, HTC Glacier, Dell Steak 7, Samsung Galaxy S II
Carrier: Not Provided

Thanks: 0
Thanked 1 Time in 1 Post
Default VideoView issue.

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"
androidrientation="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
androidrientation="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]

Advertisements
OberSchutze is offline  
Reply With Quote
sponsored links
Old December 19th, 2012, 06:54 PM   #2 (permalink)
New Member
 
Join Date: Dec 2012
Location: Butler, PA
Gender: Male
Posts: 7
 
Device(s): Sprint Samsung Galaxy Nexus with cyanogenmod 10.1(Jelly bean 4.1.2)(4.2) themed, rooted.
Carrier: Sprint/Nextel

Thanks: 1
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by OberSchutze
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"
androidrientation="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
androidrientation="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!
Rwhittaker13 is offline  
Reply With Quote
Old December 19th, 2012, 07:00 PM   #3 (permalink)
New Member
 
Join Date: Dec 2012
Location: Butler, PA
Gender: Male
Posts: 7
 
Device(s): Sprint Samsung Galaxy Nexus with cyanogenmod 10.1(Jelly bean 4.1.2)(4.2) themed, rooted.
Carrier: Sprint/Nextel

Thanks: 1
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by Rwhittaker13

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
Rwhittaker13 is offline  
Reply With Quote
Old December 20th, 2012, 06:29 AM   #4 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jul 2012
Posts: 14
 
Device(s): Galaxy Nexus, TF101, HTC Glacier, Dell Steak 7, Samsung Galaxy S II
Carrier: Not Provided

Thanks: 0
Thanked 1 Time in 1 Post
Default

On a side note, is is possible to embed a mp4 into an application so that the whole thing is self contained?
OberSchutze is offline  
Reply With Quote
Old December 20th, 2012, 05:00 PM   #5 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

Can you post your manifest file?
__________________
My blog, Inverted Keystrokes, is looking for aspiring developers (not necessarily with Android) to post articles. If you have any development experience and are interested in participating, please PM me. =)
jonbonazza is offline  
Reply With Quote
Old December 21st, 2012, 07:00 AM   #6 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jul 2012
Posts: 14
 
Device(s): Galaxy Nexus, TF101, HTC Glacier, Dell Steak 7, Samsung Galaxy S II
Carrier: Not Provided

Thanks: 0
Thanked 1 Time in 1 Post
Default

[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]
OberSchutze is offline  
Reply With Quote
Old December 21st, 2012, 08:08 AM   #7 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jul 2012
Posts: 14
 
Device(s): Galaxy Nexus, TF101, HTC Glacier, Dell Steak 7, Samsung Galaxy S II
Carrier: Not Provided

Thanks: 0
Thanked 1 Time in 1 Post
Default

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.
OberSchutze is offline  
Last edited by OberSchutze; December 21st, 2012 at 10:16 AM. Reason: Added update.
Reply With Quote
Reply
Tags
embedded mp4, videoview


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:14 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.