Android Studio如何快速導(dǎo)入jar和.so文件
導(dǎo)入jar
將jar文件放在libs文件夾中,右鍵該jar,點(diǎn)擊選項(xiàng) add as library,點(diǎn)擊確認(rèn),搞定。
添加so文件
1.在src/main中添加 jniLibs文件夾 ,把.so復(fù)制進(jìn)去
2.將so文件放入libs文件夾中,在gradle中添加
sourceSets{ main { jniLibs.srcDirs = ['libs'] } }
具體位置:
apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 26 defaultConfig { applicationId "com.example.administrator.xxx" minSdkVersion 21 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } sourceSets{ main { jniLibs.srcDirs = ['libs'] } } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" implementation 'com.android.support:appcompat-v7:26.0.0-beta1' implementation 'com.android.support.constraint:constraint-layout:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' }
總結(jié)
以上所述是小編給大家介紹的Android Studio如何快速導(dǎo)入jar和.so文件的相關(guān)知識(shí),希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
相關(guān)文章
Android自定義wheelview隨機(jī)選號(hào)效果
這篇文章主要介紹了Android自定義wheelview隨機(jī)選號(hào)效果,利用wheelview實(shí)現(xiàn)滾動(dòng)隨機(jī)選擇號(hào)碼,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-12-12Android中ListView的item點(diǎn)擊沒有反應(yīng)的解決方法
這篇文章主要介紹了Android中ListView的item點(diǎn)擊沒有反應(yīng)的相關(guān)資料,需要的朋友可以參考下2017-10-10Android實(shí)現(xiàn)自定義華麗的水波紋效果
關(guān)于Android的水波紋效果小編之前給大家也分享幾篇類似的,有興趣可通過下面的相關(guān)文章進(jìn)行查看,今天給大家再分享一個(gè)華麗的水波紋效果,這個(gè)效果很不錯(cuò),感興趣的可以參考借鑒。2016-08-08Kotlin之自定義 Live Templates詳解(模板代碼)
這篇文章主要介紹了Kotlin之自定義 Live Templates詳解(模板代碼),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-03-03Flutter 實(shí)現(xiàn)酷炫的3D效果示例代碼
這篇文章主要介紹了Flutter 實(shí)現(xiàn)酷炫的3D效果,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-07-07教你快速實(shí)現(xiàn)Android動(dòng)態(tài)模糊效果
相信大家都發(fā)現(xiàn)了越來越多的App里面使用了模糊效果,比如雅虎天氣的界面,雖然我并不知道雅虎天氣是怎么做出這種效果的,但是簡(jiǎn)單的模仿一下的話,還是能做到的。下面一起來學(xué)習(xí)學(xué)習(xí)。2016-08-08