Leaving target on API22 and running the app on Android 6 platform device, I see that DefaultHttpClient is still working, even though it isnt supported by the new platform.
How is it possible, does it work in a compatibility mode?
Leaving target on API22 and running the app on Android 6 platform device, I see that DefaultHttpClient is still working, even though it isnt supported by the new platform.
How is it possible, does it work in a compatibility mode?
That it isn't supported does not mean it's been removed. In code you'll often see "deprecated" functions. These are functions that are not supported, but have purposefully not been removed.
In this case, you use the functionality from the Android API22 library. To preserve backwards compatibilty functionality of previous API's is almost never fully removed from the actual Android environment.
When compiling something with API level 22, the APK will actually contain parts of that library. In this case, that means that the DefaultHttpClient from API22 is actually included in your app. It doesn't use the version that is (not) on the phone. What parts are to be included in your app is decided in:
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
minSdkVersion 17
targetSdkVersion 23
}
}
Everything that is missing from API level 23 but is available in level 17 will get included in your app.