문제

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