In my application I want to send my recordings to the web site on backgroud. I've researched and I reached the conclusion that I should use and IntentService.
But this leads me to a problem, i cannot reach the callback of Ion inside the IntentService.
The callback is important because I want to delete the file after finishing the upload.
How can I make this?
This is my code:
Ion.with(this)
.load(ip_address)
.setMultipartParameter("key", key)
.setMultipartFile("audio_file", array_mp3[idx])
.asJsonObject()
.setCallback(new FutureCallback<JsonObject>() {
@Override
public void onCompleted(Exception e, JsonObject result) {
Log.d("BackS", "wifiteste - chega aqui ");
array_mp3[idx].delete();
}
});
I never reach that Log which means that i never delete the file.
Thanks in advance.