Skip to content

Multiple file downloading app get slows. #703

@sankar9659

Description

@sankar9659

Hi, I'm creating a gallery app. Its fully offline app. It has more number of images. (1000 and more images and files).
I'have downloaded these images initially and store into locally and then show these images from local. when i downloaded the more number of images, the app hangs (slow in performance), can anyone reply to fix this issue?
my code is,

const downloadImage = (url, id) => {
if (url && id) {
let date = new Date();
let image_URL = url;
let ext = getExtention(image_URL);
ext = '.' + ext[0];
const { config, fs } = RNFetchBlob;
let PictureDir = fs.dirs.PictureDir;
let options = {
fileCache: true,
addAndroidDownloads: {
useDownloadManager: true,
notification: true,
path: PictureDir + '/' + id + '/image_' + Math.floor(date.getTime() + date.getSeconds() / 2) + ext,
description: 'Image'
},
}
config(options)
.fetch('GET', image_URL)
.then(res => {
storeData(res.path(), id)
});
};
};

And i dont want to show these images in phone's gallery. how to fix these issues, and how to download images one by one.
Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions