Back to project page android-ipcam.
The source code is released under:
GNU General Public License
If you think the Android project android-ipcam listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package cz.janchvala.android.ipcamera.rest; /*from www . j a va 2 s . c o m*/ import org.androidannotations.annotations.EBean; import org.androidannotations.annotations.rest.RestService; import org.springframework.http.client.SimpleClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; /** * Created by jan on 19.11.2014. */ @EBean(scope = EBean.Scope.Singleton) public class AndroidIPCamRestClientFactory { @RestService AndroidIPCamRestClient mClient; boolean clientInitialized = false; public synchronized AndroidIPCamRestClient getClient() { if (!clientInitialized) { SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); requestFactory.setReadTimeout(5000); requestFactory.setConnectTimeout(3000); RestTemplate restTemplate = new RestTemplate(requestFactory); restTemplate.getMessageConverters().add(new JacksonJsonConverter()); mClient.setRestTemplate(restTemplate); } return mClient; } }