Continue Download in android even after the device is locked
<p>How to continue download task even when after the device is locked (pressing the power button). 
I tried installing an app from the play store, and during its download i locked the device, but it still continues to download without any interruption and is visible on the lockscreen as shown in the screen shot below. 
How do we achieve this programmatically?</p>

<p><a href="https://i.stack.imgur.com/EMJ7P.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EMJ7P.png" alt="enter image description here"></a></p>