Difference between using download manager and normal http download - android-download-manager

What are the advantages of using the Android DownloadManager class to handle downloads in a service over using normal http downloads?
Do they function the same way for downloads of about a few megabytes?

Quoting from the doc of DownloadManager (emphasis is mine):
The download manager is a system service that handles long-running HTTP downloads. Clients may request that a URI be downloaded to a particular destination file. The download manager will conduct the download in the background, taking care of HTTP interactions and retrying downloads after failures or across connectivity changes and system reboots. Instances of this class should be obtained through getSystemService(String) by passing DOWNLOAD_SERVICE. Apps that request downloads through this API should register a broadcast receiver for ACTION_NOTIFICATION_CLICKED to appropriately handle when the user clicks on a running download in a notification or from the downloads UI. Note that the application must have the INTERNET permission to use this class.
If you think that your network is good enough to handle this few megabytes download, and you're ready to handle all situations where the normal download fails, go ahead. If not, use the download manager.

Related

Node js- Access and query windows printer queue

I am developing a printer management software in nodejs. For this I need access to the printer queue, so as to log the details of the ongoing printing task. I need access to the number of copies, page size etc. Is there an equivalent of .nets System.Printing PrintQueue class in nodejs?
Tried various printer packages available but none seem to serve my purpose.

Is downloading file from url in nodejs use user internet or works background?

I'm currently building a nodejs streaming app which has to get the file from a third party after that cache it to my virtual machine running node.js (Heroku) local storage.
I want to ask if I'm requesting for download of file in nodejs app, do user internet speed matter even though file is not being downloaded in browser
Can I download file in background when I deploy to heroku without user interaction?
Thanks, if you can explain how internet bandwidth is being consumed by internet providers. I'm concerned about this because the country I'm in internet cost is expensive so I want to reduce internet usage of my users.
In short - the machine/computer running the download code is the one consuming the internet bandwidth.
So, if your node.js app is running on Heroku, the download is between the Heroku machine and the 3rd party server(s), thus not consuming the user's bandwidth (that data doesn't flow through the user's device).
However, when the user will stream that file from your node.js app to their device - that'll definitely consume their bandwidth.

How ConfigCat webhooks would work in application running behind load balancer?

There are 4 instances of an application running behind a load balancer. How the ConfigCat webhook would work in this case? Do we need to configure 4 public URL's for all 4 servers in webhook settings?
Could you share some details about your use case? What would you like to achieve with webhooks? What kind of SDK are you using? What is the polling mode?
If you want to refresh the SDK's cache on Feature Flag value changes, you should consider using a distributed cache implementation (e.g. redis). Example custom cache in Java: https://configcat.com/docs/sdk-reference/java#custom-cache
If you implement a custom distributed cache, you'll only need to add your load balancer's url to the webhook because refreshing the cache in one instance will refresh the cache in the distributed cache so all of your instances could work with the latest configurations.
If you want to get notified about changes in each applications, there are different possibilities:
You can configure 4 public urls and use the webhooks just like you mentioned it.
If you are using auto polling mode, you can skip the webhooks part and start using the SDK's built-in configuration changed callbacks. e.g. in java: configurationChangeListener part at https://configcat.com/docs/sdk-reference/java#auto-polling-default. When the auto poll mode's polling happens the SDK detects if the configuration changed and it fires this event.
If you could share more details I could help you more.
Disclaimer: I am one of the founders of ConfigCat.

Is it possible to create a mobile agent that uses Node.js?

My aim is to create a mobile agent written in Node.js that will perform data collection on each node that is part of the mobile agent platform. If any anomalous events are detected then this is reported back to the control server. The mobile agent will follow a predefined path, saving its state and transferring to another nodes once its task is complete. Are there any frameworks or existing projects that would be suitable for this?
The Java Aglet project is similar to my needs however is obviously only available for Java.
As there was no current solution/package, I have created and now maintain the mobile-agent-platform NPM package.
"A JavaScript Mobile Agent Platform that allows an agent to migrate across a network. A Supervisor node dispatches the Agent which can then autonomously move between Worker nodes, carrying/transferring its state and methods to the new node."
Note: the stack and program counter cannot be transferred due to limitations within Node.js.

Notify service that synchronizing complete

There is a web service that saves, among other things, files to file storage on linux os.
To access these files, it is periodically copied to another server using lsync.
Access is provided through nginx. Synchronization occurs every 10 seconds.
The problem is that client service could request files that just been saved and get 404.
Is it possible to notify the web service that synchronization has occurred and files are available for clients using the lsync functionality?
if not, then how to solve this problem?
Thank you.

Resources