I need to send a large file from Android Tablet to a server.
So now I'm using Android Annotation to do it, but now I get OutOfMemory Exception becuase my file is bigger than 35MB. I searched and I undesrstand that if I use FileOutputStream with connection I can avoid that Exception.
But how can I get output stream from my connection using @Rest AndroidAnnotation Class?
This is my code:
@Rest(converters = {FormHttpMessageConverter.class, MappingJackson2HttpMessageConverter.class}
/*, interceptors=MyClientHttpRequestInterceptor.class*/)
public interface DbRestClient extends RestClientErrorHandling{
void setRootUrl(String rootUrl);
String getRootUrl();
void setRestTemplate(RestTemplate restTemplate);
RestTemplate getRestTemplate();
@Post("dbSynk/postNew")
Integer postDb(MultiValueMap file);
}
And into my @EService:
@RestService DbRestClient dbRestClient;
...
dbRestClient.postDb(file)
Have you any ideas?