<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      android jni demo

       

      第一步:編寫kt代碼

      class NativeLib {

      /**
      * A native method that is implemented by the 'netconfig' native library,
      * which is packaged with this application.
      */
      external fun stringFromJNI(): String

      companion object {
      // Used to load the 'netconfig' library on application startup.
      init {
      System.loadLibrary("netconfig")
      }
      }
      }

       

      第二步:編寫C代碼

      #include <jni.h>
      #include <string>
      
      extern "C" JNIEXPORT jstring JNICALL
      Java_com_larack_netconfig_NativeLib_stringFromJNI(
              JNIEnv *env,
              jobject /* this */) {
          std::string hello = "Hello from C++";
          return env->NewStringUTF(hello.c_str());
      }

       

      第三步:編寫CMakeLists.txt

      cmake_minimum_required(VERSION 3.18.1)
      
      
      project("netconfig")
      
      
      add_library( # Sets the name of the library.
                   netconfig
      
                   # Sets the library as a shared library.
                   SHARED
      
                   # Provides a relative path to your source file(s).
                   netconfig.cpp )
      
      
      find_library( # Sets the name of the path variable.
                    log-lib
      
                    # Specifies the name of the NDK library that
                    # you want CMake to locate.
                    log )
      
      target_link_libraries( # Specifies the target library.
                             netconfig
      
                             # Links the target library to the log library
                             # included in the NDK.
                             ${log-lib} )
      

        

      第四步:編寫build.gralde配置

       
      plugins {
          id 'com.android.library'
          id 'org.jetbrains.kotlin.android'
      }
      
      android {
          compileSdk 32
      
          defaultConfig {
              minSdk 29
              targetSdk 32
      
              testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
              consumerProguardFiles "consumer-rules.pro"
              externalNativeBuild {
                  cmake {
                      cppFlags ""
                  }
              }
          }
      
          buildTypes {
              release {
                  minifyEnabled false
                  proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
              }
          }
          externalNativeBuild {
              cmake {
                  path "src/main/cpp/CMakeLists.txt"
                  version "3.18.1"
              }
          }
          compileOptions {
              sourceCompatibility JavaVersion.VERSION_1_8
              targetCompatibility JavaVersion.VERSION_1_8
          }
          kotlinOptions {
              jvmTarget = '1.8'
          }
      }
      
      dependencies {
      
          implementation 'androidx.core:core-ktx:1.7.0'
          implementation 'androidx.appcompat:appcompat:1.3.0'
          implementation 'com.google.android.material:material:1.4.0'
          testImplementation 'junit:junit:4.13.2'
          androidTestImplementation 'androidx.test.ext:junit:1.1.3'
          androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
      }
      

        

      第五步:調(diào)用jni并運(yùn)行android程序

          value = NativeLib().stringFromJNI()
      Hello from C++"

      https://gitee.com/Larack/my-config

      posted @ 2022-07-21 13:25  狐貍已化妖  閱讀(118)  評(píng)論(0)    收藏  舉報(bào)
      主站蜘蛛池模板: 欧美大胆老熟妇乱子伦视频| 中文字幕国产精品日韩| 新竹县| 亚洲婷婷综合色香五月| 2021国产成人精品久久| 日本三级香港三级三级人!妇久| 精品国产精品中文字幕| 亚洲大尺度无码专区尤物| 国产成a人亚洲精v品无码性色| 亚洲十八禁一区二区三区| 国产精品一区二区国产主播| 国产精品免费看久久久| 天天躁日日躁狠狠躁中文字幕| 国产精品免费视频不卡| 天堂网av成人在线观看| 人妻无码vs中文字幕久久av爆| 亚洲免费观看一区二区三区| 高潮潮喷奶水飞溅视频无码| 中文字幕国产精品二区| 国产自拍在线一区二区三区| 久久婷婷综合色丁香五月| 亚洲韩国精品无码一区二区三区| 国产综合精品一区二区三区| 日日碰狠狠添天天爽五月婷| 五月天丁香婷婷亚洲欧洲国产| 色猫咪av在线观看| caoporn成人免费公开| 亚洲色大成网站www在线| 一个色的导航| 亚洲最大激情中文字幕| 国产精品欧美一区二区三区不卡| 久久精品国产99久久6| 国产成人av电影在线观看第一页| 精品久久久久久久久午夜福利| 欧美亚洲另类自拍偷在线拍| 亚洲成人av综合一区| 俄罗斯少妇性XXXX另类| 沾化县| 日本久久香蕉一本一道| 少妇激情av一区二区三区 | 亚洲偷自拍国综合|