Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

i include following jars see below image. enter image description here

I want to integrate json web service so i 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 i set above structure my jar file is not getting in my class file any idea how can i solve this problem?your all suggestions are 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'
  }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
168 views
Welcome To Ask or Share your Answers For Others

1 Answer

Apache HTTP Client was removed since API level 23:

This preview removes support for the Apache HTTP client. If your app is using this client and targets Android 2.3 (API level 9) or higher, use the HttpURLConnection class instead. This API is more efficient because it reduces network use through transparent compression and response caching, and minimizes power consumption. To continue using the Apache HTTP APIs, you must first declare the following compile-time dependency in your build.gradle file:

android {
    useLibrary 'org.apache.http.legacy'
}

Android is moving away from OpenSSL to the BoringSSL library. If you’re using the Android NDK in your app, don't link against cryptographic libraries that are not a part of the NDK API, such as libcrypto.so and libssl.so. These libraries are not public APIs, and may change or break without notice across releases and devices. In addition, you may expose yourself to security vulnerabilities. Instead, modify your native code to call the Java cryptography APIs via JNI or to statically link against a cryptography library of your choice.

Reference:
https://developer.android.com/preview/behavior-changes.html#behavior-apache-http-client


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...