Вопрос

I'm writing an FTP (client) service for Android, that is intended to upload video contents in background.

I was thinking that users may get bothered if my service fills the whole connection band.

What is the simplest way to dinamically set an (upload) speed limit for my service? Is there any Android workaround, shall I use some commons-net feature, or shall I calculate tranfers rate by hand?

Это было полезно?

Решение

I'd calculate the transfer rates by hand. The devices which can limit transfer bandwidth consumption in this scenario are going to be located between the client and the server (layer 3 devices like routers), or the server, or the client themselves.

Since all you are guaranteed have control over is the client, you'll need to do it yourself. I don't know of any libraries which will handle this for you. The calculation should be pretty simple. Just bytes transferred over time right?

Also I suggest having a selection in your FTP app for users which can throttle the bandwidth your FTP app is using.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top