Hi,
@tonyofrancis
Setting setGlobalNetworkType doesn't work properly in new release, i have toggled off onlyWifi switch and my downloading got stuck with status downloading.
Please have a look :)
@zubairehman this is a bug. Working on a fix
right. @tonyofrancis could you please expose a method (like setGlobalNetworkType) through which we can control queue size? coz till now i am stuck with queue size and not able to change the size at runtime.
@zubairehman Just implemented setDownloadConcurrentLimit(limit) on Fetch. So you will be able to change it during run time. Testing now.
@zubairehman Just released fetch 2.2.0-RC2 with a few fixes for the globalNetworkType and you can now set concurrent download limit on Fetch during runtime. See change log.
@tonyofrancis, thanks for the update. Unfortunately setGlobalNetworkType still has bugs, i was connected with my 4g and onlyWifi toggle was on but still my download didn't stop (it should stop). its was working fine in 2.1.0-RC15 release. Moreover setting setDownloadConcurrentLimit doesn't work either, i tried setting it at runtime but no affect
@zubairehman can you share your code via email? My email is on my profile. Think I can better assist that way.
@zubairehman Had a change to look at your code and also published a new version of Fetch 2.2.0-RC3.
In your code I noticed you are calling FetchHelper.getFetchInstance() inline in many places thought your app. Eg:FetchHelper.getFetchInstance().downloadConcurrentLimit(limit);
The issue is every time you call FetchHelper.getFetchInstance() inline you, are actually creating a new instance/object of Fetch and applying the settings to that instance and then that instance is garbage collected because there is no other reference to it. Your FetchHelper.getFetchInstance() method should instead do one of the following:
Fetch.Impl.getDefaultFetchInstance()Also there is no need to keep calling the close method. You should only call close when you no longer need the Fetch instance.
Hope its okay to post the answer here. This will help others. Please let me know if this answer helps.
thanks @tonyofrancis, its working now and thank you soo much for your time you spent debugging my code :)
No worries. Got a change to see the many ways others use the library so I can make it better.