Skip to content Skip to sidebar Skip to footer

Save Images In External Storage From Parse.com

I want to download images from parse database table and store all the images in a external memory folder. Is it possible ? If yes , how ??

Solution 1:

Yes of course it is possible. But you need to follow some steps:

-Start downloading the image Url from your Parse object:

String url=yourParseObject.getParseFile("Image").getUrl();

-Now pass that url to this function:

publicstaticDrawableloadImageFromUrl(String url) {
        InputStream inputStream;
        final ImageView imageView = (ImageView) rowView.findViewById(R.id.image);//Your imageView in the layout AsyncImageLoaderasync=newAsyncImageLoader();

        Drawable cachedImage = async.loadDrawable(
                url, newImageCallback() {
                    publicvoidimageLoaded(Drawable imageDrawable,
                            String imageUrl) {
                        imageView.setImageDrawable(imageDrawable);
                    }
                });
        imageView.setImageDrawable(cachedImage);
        return cachedImage;
    }

-If you want to save that in SD Card instead of ImageView, export that inside of the method (Drawable imageDrawable,String imageUrl) in drawable or bitmap form.

Hope it helps!

Solution 2:

you can do that just you need to write code for download image from url and for url you can get using ParseFile.getUrl() and for downloading file you can check this tutorial http://javatechig.com/android/download-image-using-asynctask-in-android

Solution 3:

You can get download image from parse.com in bitmap then store this bitmap as image in your file directory as you want.

Refer this android-parse-com-image-download-tutorial

Post a Comment for "Save Images In External Storage From Parse.com"