Search code examples
androidandroid-networking

Download an HTTP file using LTE (cellular) even when Wi-Fi is available


Can I download using LTE (cellular data) even when Wi-Fi network is connected? That is, not using Wi-Fi but using LTE to download a file from a website in my app, which is for my own personal use.

In case if you wonder why I want to do this, this is a strange requirement, but my carrier has a weird rule that I must use a certain amount of mobile data monthly. If I use less than that value, the service may get cancelled, but if I use more than the free quota, I will be charged dearly. So, I want to automate this.

I have already succeeded in getting current monthly LTE data usage in bytes. Now I want to download some dummy file if that is smaller than the minimum value.


Solution

  • I recommend doing this:

    Check how much Mb you used Calculate how much mb you want to waste

    Turn wifi off

    Download files till you wasted the Mb yoh wanted

    Turn wifi on

    Repeat this every 30 days Tadaa

    Apps can turn wifi on and off, so all of this can be automated