ConnectionRequest pause() and resume()

Francesco Galgani

Are ConnectionRequest methods named pause() and resume() really implemented?

Looking at the sources, I imagined that they are "fake", in the sense they actually do nothing, except setting an internal flag: https://github.com/codenameone/CodenameOne/blob/master/CodenameOne/src/com/codename1/io/ConnectionRequest.java

So, my question is if Codename One offers any way to pause and then resume a large download (for example 10MB or 100MB, that could be the size of a video). My idea is to pause the download when the app goes to background and then resume it when the app returns to foreground, without re-downloading the already downloaded data: this could circumvent the issue described in my previous question: How to improve the behavior of ConnectionRequest?

Thank you

Shai Almog

It looks like they are implemented but notice you need to override isPausable() to return true which currently no ConnectionRequest does.

It might make sense to add a setDefaultPausable(boolean) method to ConnectionRequest to make this usage easier and more universal e.g. with the Rest API.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related