Which approach is the best for the video downloader app? Download manager or url.openConnection. I want the user to be able to download as many files as he wants simultaneously and also enable him to abort the download of any individual file wenever he wants.
Yes ,it's possible if you have url of photo, video, song or whatever... Take a look this theme on stack overflow :
How to download and save an image in Android
Related
Currently I want to make a list like pictures and images on the server when I click on it, it will download the images to the memory device. If the image is downloaded, it will not download again and the image that is not there will be downloaded. Then I want to ask for a solution from everyone, how should I handle the download to be clean and good for performance. Or do you have an example for me to refer to? Thank you!
There are some ways to find out if your image already exists in your phone storage but the best way to find it out is by image name, compare image names before downloading.
I am developing chat application. Currently i have implemented all functionality in chat screen. For sending image , video and text. I can able to download image.
Now i want to download videos like whatsapp does. For eg, when click on download video and navigate to other screen and back to chat screen that video downloading.
My question is that what functionality whatsApp uses for downloading videos?
I can able to download video simply using BroadcastReceiver. But i need same functionality same as whatsApp.
Advanced help would be appreciated !
You can write separate DownloadManager class. It should be singleton.
All the work related to downloading any file will be done by this Manager. It will also hold state of the downloading file.
So next time user come into that chat screen, You will need to ask DownloadManager about state of that and it will return that.
The requirement is to list a Videos thumbnails and on clicking it should play related video into Application. i am able to play url where video is located using Video View. But now i want to implement this thing in a better ways like Watsapp and instagram. If anybody have a good experience in this reference please share with me. I want to play around caching video and playing videos from cache without buffering (Video view is showing buffering bar and very slow in performance user have to wait a lot for starting a Video). Any kind of help will be appreciated. thanks.
I did it own my own. It's very simple to implement What i do is to download the video with async task along with a progressing seek bar. Once it's downloaded i'll save it in a Folder in my sdcard. We should create a Folder named as Application name so easy to identify and also always available videos with out opening application as well and next time however when i want to watch video again in my application it just check weather it is available in sdcard if yes then play immediately if not then download it. I am happy.
I have problem with my app, it's very slow because of using Video and images. When I play video or show images it takes time to download, the app would close during this time or it will take for ever. How can I avoid this problem? Once we have seen the image or video it should not download from server again, please give me the solution for this(Like Facebook).
First you should download the video or image in an asynctask inner class, this is why the app freezes while downloading.
You are downloading on the UI thread and this freezes your app, AsyncTask is the way to go.
Second when download is complete you could save the video, image to sdcard so you won't have to download them again next time. When you want to view the video the second time you will only have to know the file name so you could grab it from sd card. You could make a method that determines if a video on sd card is considered outdated and delete that file if true.
Also as other comments say, AQuery ( Android Query) is a library (facilitates chaining like jQuery does for javascript) that offers a lot of convenience methods for file downloading and other cool stuff. A short Google query for AQuery term should reveal tutorials and download sources.
You can use AndroidVideoCache for caching video while streaming. It allow to use cached video after single viewing.
My app has a string containing the URL to a file, typically something like a Word document or a PDF file. I want to give the user a way to download the file the same way they would if they had clicked on a link in the browser (letting the browser store it in the default location, etc).
At the moment I am doing this by launching an ACTION_VIEW intent. It works in most cases, but there are several problems with it. Often the browser window tries to display a message which for some reason immediately disappears and can't be read. Sometimes the download fails and I can't detect that. If it does succeed, all the user really sees is a small icon in the top status bar that they have to know to look for.
Is there a better way to do this? Some way to start a dedicated DOWNLOAD action instead of invoking the whole browser?
Could I download the file myself in my own code and then somehow cause it to end up in the same place as if the browser had downloaded it?
Thanks.
You can download it with your own code, and place it in the \Download folder on the SD card. Alternatively, you could use the DownloadManager available on API 9 and above.