You must first load the video or image in the asynctask inner class, so the application freezes at boot time. You are loading into the user interface thread and it freezes your application, AsyncTask is the way to go. Secondly, when the download is completed, you can save the video, image to the SD card, so the next time you do not have to download them again. If you want to watch the video a second time, you only need to find out the name of the file so that you can capture it from the SD card. You can create a method that determines whether the video on the SD card is considered obsolete and delete this file, if true.
Like other comments, AQuery (Android Query) is a library (facilitates conversations like jQuery for javascript) that offers many convenient methods for downloading files and other interesting things. A short Google query for the term AQuery should include tutorials and download sources.
source share