org.apache.http jar class not found in android studio projects -
i include following jars see below image.
i want integrate json web service import below jars
apache-mim44j-0.-6.jar gson-2.1.jar httpmime-4.0.1.jar json_simple-1.1.jar
build.gradle file
apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion '22.0.1' defaultconfig { applicationid "pkg.android.myapp" minsdkversion 15 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.0.1' }
when set above structure jar file not getting in class file idea how can solve problem?your suggestions appreciable.
edit
apply plugin: 'com.android.application'
android { compilesdkversion 23 buildtoolsversion '22.0.1' defaultconfig { applicationid "pkg.android.myapp" minsdkversion 15 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } android { uselibrary 'org.apache.http.legacy' } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.0.1' }
apache http client removed since api level 23:
this preview removes support apache http client. if app using client , targets android 2.3 (api level 9) or higher, use httpurlconnection class instead. api more efficient because reduces network use through transparent compression , response caching, , minimizes power consumption. continue using apache http apis, must first declare following compile-time dependency in build.gradle file:
android { uselibrary 'org.apache.http.legacy' }
android moving away openssl boringssl library. if you’re using android ndk in app, don't link against cryptographic libraries not part of ndk api, such libcrypto.so , libssl.so. these libraries not public apis, , may change or break without notice across releases , devices. in addition, may expose security vulnerabilities. instead, modify native code call java cryptography apis via jni or statically link against cryptography library of choice.
reference:
https://developer.android.com/preview/behavior-changes.html#behavior-apache-http-client
Comments
Post a Comment