visual studio 2015 android添加库问题

时间:2017-02-12 13:53:46

标签: android opencv visual-studio-2015 android-ndk java-native-interface

我在VisualStudio2015中有一个NativeActivity应用程序项目。 它使用的是opengles 3.0,我可以在手机上成功构建和安装。我想添加opencv,因此我将Include header fileso file添加到了我的项目属性中。构建成功,但在手机上安装时会发生错误。

这是一个NativeActivity应用程序项目,因此我在AndroidManifest.xml中添加了android:hasCode="false",因为项目中没有Java代码。

<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="19"/>

<!-- This .apk has no Java code itself, so set hasCode to false. -->
<application android:label="@string/app_name" android:hasCode="false">

    <!-- Our activity is the built-in NativeActivity framework class.
         This will take care of integrating with our NDK code. -->
    <activity android:name="android.app.NativeActivity" android:label="@string/app_name" android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden">
        <!-- Tell NativeActivity the name of our .so -->
        <meta-data android:name="android.app.lib_name" android:value="$(AndroidAppLibName)"/>
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
</application>

也许我应该添加

static { system.loadlibrary("opencv_java3")}

但是如果项目中没有Java代码,我怎么能这样做呢?

0 个答案:

没有答案