How to integrate Vitamio into Android Studio?

I tried to integrate the VitamioBundle into my Android Studio project and it did not work here, these are my steps

  • I created a new Android project "Empty Action"
  • I choose File> New Module> Import Existing Project Image
  • I got this import list Summary Image
  • Now I went to file> Project Structure> Applications> Dependencies and added a library

enter image description here


Then i got this error

enter image description here

I found out that if I delete android:label="@string/vitamio_name"in AndroidManifest.xml from the imported library, the error will disappear


i followed the directions from here to Vitamio Bundle

activity

   import android.app.Activity;
   import android.net.Uri;
   import android.os.Bundle;

import io.vov.vitamio.widget.MediaController;
import io.vov.vitamio.widget.VideoView;


public class MyActivity extends Activity {

VideoView videoView;

private void test_2(){
    String httpLiveUrl = "http://-------------.mp4";
    videoView = (VideoView) findViewById(R.id.VideoView);
    videoView.setVideoURI(Uri.parse(httpLiveUrl));
    MediaController mediaController = new MediaController(this);
    videoView.setMediaController(mediaController);
    videoView.requestFocus();
    videoView.start();
}


public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_my);
    test_2();
}
}

Layout

 <io.vov.vitamio.widget.VideoView
    android:layout_height="fill_parent"
    android:layout_width="fill_parent" android:id="@+id/VideoView">
  </io.vov.vitamio.widget.VideoView>

manifest

     

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MyActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="io.vov.vitamio.activity.InitActivity"
        android:configChanges="orientation|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
        android:launchMode="singleTop"
        android:theme="@android:style/Theme.NoTitleBar"
        android:windowSoftInputMode="stateAlwaysHidden" />

</application>

Error

         09-12 13:48:27.020    1786-1786/com.stream.myapplication E/AndroidRuntime﹕ FATAL 
          EXCEPTION: main
        Process: com.stream.myapplication, PID: 1786
        java.lang.ExceptionInInitializerError
        at io.vov.vitamio.MediaPlayer.<init>(MediaPlayer.java:96)
        at io.vov.vitamio.MediaPlayer.<init>(MediaPlayer.java:78)
        at io.vov.vitamio.widget.VideoView.openVideo(VideoView.java:221)
        at io.vov.vitamio.widget.VideoView.access$2200(VideoView.java:62)
        at io.vov.vitamio.widget.VideoView$9.surfaceCreated(VideoView.java:461)
        at android.view.SurfaceView.updateWindow(SurfaceView.java:572)
        at android.view.SurfaceView.access$000(SurfaceView.java:86)
        at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:175)
        at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:847)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1871)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
        at android.view.Choreographer.doCallbacks(Choreographer.java:574)
        at android.view.Choreographer.doFrame(Choreographer.java:544)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
        at android.os.Handler.handleCallback(Handler.java:733)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5017)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
        at dalvik.system.NativeStart.main(Native Method)
         Caused by: java.lang.NullPointerException
        at io.vov.utils.CPU.getFeature(CPU.java:101)
        at io.vov.vitamio.Vitamio.<clinit>(Vitamio.java:129) ...... 

, ... Vitamio Android Studio?

+4
2

?

    public void onCreate(Bundle b) {
        super.onCreate(b);
        if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(this))
        return;
        // your code
   }

vitamio, , , - . vitamio AndroidManifest.xml .

!

+3

Vitamio, Vitamio build.gradle

 jniLibs.srcDirs = ['libs']

.

0

All Articles