Import and compile vlc-android in Eclipse, eclipsevlc-android
After the source code of VLC is downloaded in Ubuntu14.04, The Eclipse project of VLC is stored in the "vlc-android" directory.
root@dzt-VirtualBox:/home/dzt/android_vlc/android# lsandroid-headers-gingerbread compile.sh find_modules.sh NEWSandroid-headers-hc configure.sh gcc rename_package.shandroid-headers-ics COPYING gen-env.sh vlcandroid-libs dump-libs.sh java-libs vlc-androidassets env.sh Makefile
Follow the prompts on the official website
Package in Eclipse [optional]
In Eclipse, create a new Android Project from existing source by importing from the vlc-android path.
Import the three projects from the java-libs folder.
Export unsigned/signed apk.
Note: Building against JDK6 is recommended for optimal compatibility (Set Java Compiler Compliance to 1.6 ).
Import the vlc-android project under Eclipse in Windows
You also need to import several projects under the java-libs directory
Root @ dzt-VirtualBox: /home/dzt/android_vlc/android/java-libs # ls-l total usage 12 drwxrwxrwx 5 root 4096 July 21 15:59 appcompatdrwxrwxrwx 5 root 4096 July 21 15:59 smongoingmenudrwxrwxrwx 5 root 4096 July 21 15:59 wheelView
JDK6 is recommended on the official website.
The directory structure after the vlc-android project imports Eclipse is as follows:
The project. properties file is associated with three projects.
# This file is automatically generated by Android Tools.# Do not modify this file -- YOUR CHANGES WILL BE ERASED!## This file must be checked in Version Control Systems.## To customize properties used by the Ant build system use,# "ant.properties", and override values to adapt the script to your# project structure.# Project target.target=android-19android.library.reference.3=../SlidingMenuandroid.library.reference.1=../appcompatandroid.library.reference.2=../WheelView
So we also need to import the appcompat, SlidingMenu, and WheelView projects, all of which are stored in the same directory.
Here, we only use WheelView as an example.
1.
2.
3.
Imported WheelView Project
Right-click the VLC Project
Then Clean the VCL Project
The corresponding APK is generated.
After running
Related VLC source code download: http://download.csdn.net/detail/deng0zhaotai/7661753
The apk compiled by this project is only suitable for running ARM series Processors. For other MIPS and X86 processors, different libraries must be generated.
If you encounter a problem during installation, record
01-01 04:04:44.050 V/VLC/LibVLC( 1724): Initializing LibVLC01-01 04:04:44.050 E/VLC/LibVLC/Util( 1724): WARNING: Unable to read libvlcjni.so; cannot check device ABI!01-01 04:04:44.050 E/VLC/LibVLC/Util( 1724): WARNING: Cannot guarantee correct ABI for this build (may crash)!01-01 04:04:44.050 W/dalvikvm( 1724): JNI WARNING: JNI method called with exception pending01-01 04:04:44.050 W/dalvikvm( 1724): in Lorg/videolan/libvlc/LibVLC;.nativeInit:()V (GetMethodID)01-01 04:04:44.050 W/dalvikvm( 1724): Pending exception is:01-01 04:04:44.050 I/dalvikvm( 1724): java.lang.NullPointerException:01-01 04:04:44.050 I/dalvikvm( 1724): at org.videolan.libvlc.LibVLC.getDeblocking(LibVLC.java:301)01-01 04:04:44.050 I/dalvikvm( 1724): at org.videolan.libvlc.LibVLC.nativeInit(Native Method)01-01 04:04:44.050 I/dalvikvm( 1724): at org.videolan.libvlc.LibVLC.init(LibVLC.java:384)01-01 04:04:44.050 I/dalvikvm( 1724): at org.videolan.vlc.util.VLCInstance.getLibVlcInstance(VLCInstance.java:47)01-01 04:04:44.050 I/dalvikvm( 1724): at org.videolan.vlc.gui.MainActivity.onCreate(MainActivity.java:171)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.Activity.performCreate(Activity.java:4465)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.ActivityThread.access$600(ActivityThread.java:123)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)01-01 04:04:44.050 I/dalvikvm( 1724): at android.os.Handler.dispatchMessage(Handler.java:99)01-01 04:04:44.050 I/dalvikvm( 1724): at android.os.Looper.loop(Looper.java:137)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.ActivityThread.main(ActivityThread.java:4424)01-01 04:04:44.050 I/dalvikvm( 1724): at java.lang.reflect.Method.invokeNative(Native Method)01-01 04:04:44.050 I/dalvikvm( 1724): at java.lang.reflect.Method.invoke(Method.java:511)01-01 04:04:44.050 I/dalvikvm( 1724): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)01-01 04:04:44.050 I/dalvikvm( 1724): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)01-01 04:04:44.050 I/dalvikvm( 1724): at dalvik.system.NativeStart.main(Native Method)01-01 04:04:44.050 I/dalvikvm( 1724): "main" prio=5 tid=1 NATIVE01-01 04:04:44.050 I/dalvikvm( 1724): | group="main" sCount=0 dsCount=0 obj=0x40c41460 self=0x6d8e001-01 04:04:44.050 I/dalvikvm( 1724): | sysTid=1724 nice=0 sched=0/0 cgrp=[no-cpu-subsys] handle=107422208401-01 04:04:44.050 I/dalvikvm( 1724): | schedstat=( 0 0 0 ) utm=7 stm=11 core=001-01 04:04:44.050 I/dalvikvm( 1724): at org.videolan.libvlc.LibVLC.nativeInit(Native Method)01-01 04:04:44.050 I/dalvikvm( 1724): at org.videolan.libvlc.LibVLC.init(LibVLC.java:384)01-01 04:04:44.050 I/dalvikvm( 1724): at org.videolan.vlc.util.VLCInstance.getLibVlcInstance(VLCInstance.java:47)01-01 04:04:44.050 I/dalvikvm( 1724): at org.videolan.vlc.gui.MainActivity.onCreate(MainActivity.java:171)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.Activity.performCreate(Activity.java:4465)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.ActivityThread.access$600(ActivityThread.java:123)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)01-01 04:04:44.050 I/dalvikvm( 1724): at android.os.Handler.dispatchMessage(Handler.java:99)01-01 04:04:44.050 I/dalvikvm( 1724): at android.os.Looper.loop(Looper.java:137)01-01 04:04:44.050 I/dalvikvm( 1724): at android.app.ActivityThread.main(ActivityThread.java:4424)01-01 04:04:44.050 I/dalvikvm( 1724): at java.lang.reflect.Method.invokeNative(Native Method)01-01 04:04:44.050 I/dalvikvm( 1724): at java.lang.reflect.Method.invoke(Method.java:511)01-01 04:04:44.050 I/dalvikvm( 1724): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)01-01 04:04:44.050 I/dalvikvm( 1724): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)01-01 04:04:44.050 I/dalvikvm( 1724): at dalvik.system.NativeStart.main(Native Method)01-01 04:04:44.050 I/dalvikvm( 1724): 01-01 04:04:44.050 E/dalvikvm( 1724): VM aborting01-01 04:04:44.050 F/libc ( 1724): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1)01-01 04:04:44.050 I/dalvikvm( 1724): Wrote stack traces to '/data/anr/traces.txt'
I am using commands on the terminal.
sh-4.2# cp mnt/card/VLC.apk /system/app/
After the above error is reported, I checked the/data/org. videolan. vlc/lib directory and found it to be empty. Then I used the following command to install it.
sh-4.2# pm install -r /mnt/card/VLC.apk /system/app/ pkg: /mnt/card/VLC.apk ver: /system/app/Success
How to import existing Android projects into the Eclipse project
If the project to be imported is in the workspace directory, use import.
If it is not in the directory, you can create a new-> project and select an existing project.
After creating an android app in eclipse and importing the downloaded project source code, an error is reported, indicating that R cannot be resolved to a variable.
Possible causes:
Refresh the project
Check whether the package in AndroidManifest. xml matches your package.
Project Properties> Android> Project Build Target
Right-click the Project and there is an Android Tools> Fix Project Setup or something in it. Try again.
In short, it is very easy to have a strange problem. The most common thing I do is to copy the entire project to another path and re-import it, switching from vs c ++ to Eclipse Java is really not used to (but it is easier to say that Microsoft's stuff is a strange problem --)
Whether your R. java exists now. If yes, right-click the error file and choose> Source> Origansize Import