droid4me.ws a is an extension of the Android droid4me framework which contains several web service caller implementation.
droid4me.ws consists of several parts :
- httpclient (deprecated) : an implementation based on the Apache HTTP client.
- okhttp : an implementation based on the Square HTTP client
Note : a default implementation based on the URLConnection
is available into the droid4me framework.
Android 6.0 release removes support for the Apache HTTP client (source)
2. okhttp (wiki)
This implementation is based based on the Square HTTP client and exposed two classes :
OkHttpClientWebServiceCaller
: this class extends the droid4me classWebServiceCaller
and is responsible to compute the http client, perform the http request, manage the cache and manage errors.JacksonOkHttpClientWebServiceCaller
: this class extendsOkHttpClientWebServiceCaller
and implements the droid4me.ext interfaceObjectMapperComputer
. This class provides anObjectMapper
attribute (from the Jackson library) in order to parse JSON.
To add these implementations to your project, include the following in your app module build.gradle
file:
dependencies
{
//okhttp
implementation ("com.smartnsoft:okhttpwebservicecaller:${latest.version}")
}
For the okhttp implementation, ${latest.version}
is
This library is available under the MIT license. See the LICENSE file for more info.
This library was proudly made by Smart&Soft, Paris FRANCE