Skip to content

Extension of the droid4me framework which contains web service caller implementation

License

Notifications You must be signed in to change notification settings

smartnsoft/droid4me.ws

Repository files navigation

License: MIT TeamCity status

droid4me.ws

image

droid4me.ws a is an extension of the Android droid4me framework which contains several web service caller implementation.

droid4me.ws consists of several parts :

Note : a default implementation based on the URLConnection is available into the droid4me framework.

Usage

1. [DEPRECATED] httpclient

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 exposes two classes :

  • OkHttpClientWebServiceCaller : this class extends the droid4me class WebServiceCaller and is responsible for computing the http client, performing the http request, managing the cache and managing errors.
  • JacksonOkHttpClientWebServiceCaller : this class extends OkHttpClientWebServiceCaller and implements the droid4me.ext interface ObjectMapperComputer. It also provides an ObjectMapper attribute (from the Jackson library) in order to parse JSON.

3. Retrofit

This implementation is based based on Retrofit library and exposes two classes :

  • RetrofitWebServiceCaller : this class is responsible for computing the http client, performing http requests via retrofitAPI, managing cache and errors.
  • JacksonRetrofitWebServiceCaller : this class extends RetrofitWebServiceCaller and provides an ObjectMapper attribute (from the Jackson library) in order to parse JSON.

Download

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}")
  
  //retrofit
  implementation ("com.smartnsoft:retrofitwebservicecaller:${latest.version}")
}

For the okhttp implementation, ${latest.version} is Download

For the retrofit implementation, ${latest.version} is Download

License

This library is available under the MIT license. See the LICENSE file for more info.

Author

This library was proudly made by Smart&Soft, Paris FRANCE