Downloading images in the background in flutter - flutter

Hi everyone I need help with downloading images in background in our flutter app
We are showing users list of images in our app we need to allow users to select these images and save them to thier phone but the download has to happen in the background so that the user can continue using rest of the features of the app
Our app is developed in flutter
Our backend is written in laravel 8
And database is SQL
I am a newbie and so I don't have much clarity regarding what more information shud I put in to help you all understand the code so I am adding a screenshot of the UI of our app search page
where we need to allow users to select multiple images and save them to their phone local storage but the download has to happen in background as the image size is big

You can use a async function where you call it and the app goes on. In the background all images are going to be saved on the phone while you still can use the app

Related

Flutter image cache for current session only

I've built a music player app which automatically fetches songs from a server at start-up.
The issue is that, if I use NetworkImage to display the covers for the songs on an overview page, they are refetched everytime I leave the page and then return to it.
I already tried using CachedNetworkImage, but I don't want to store the song covers in the users cache. The images should persist for one session and then be disposed.
I could probably clear the cache everytime the user closes the app but there has to be a better way
You could try storing the images in memory while app is running, then dispose when app is closed.
Third party libraries such as flutter_cache_manager can help achieve this.
It allows persistence of images for app session's duration.

Firebase Storage - Different projects load images with different speeds

I have multiple projects using Google Firebase and am using Firebase Storage to store my images and load them on mobile devices. The mobile app is developed on Flutter.
The marketplace app project loads images pretty quick, while the other app is very slow with the loads [nearly 5 seconds :(]
Below are the links to pics from each project. First one, being 900+kb loads pretty quick, but second one being 77kb takes much longer. What I see is the webpage itself takes so much time to load when open in the browser. At first I thought it must be the loading and caching in the app but now since it behaves differently on the browser to load, I am confused.
I am not sure maybe I am overlooking at some settings. Please help :)
https://firebasestorage.googleapis.com/v0/b/revivemarketplace-e61ec.appspot.com/o/03523bc0-cb82-11eb-a754-47c8b7348079?alt=media&token=ec7d02d5-7f6b-4493-9c99-6d2e9ac53da2
https://firebasestorage.googleapis.com/v0/b/diaeh/o/resized1000%2F00000apexels-christina-morillo-1181244_1000x1000.jpg?alt=media&token=b698c7ae-38ab-41ac-8761-bc6f4f18d98a
you can try this formula
Reupload your pic to firebase and set new link to your app of image

how to load data from an external database into an iPhone app

Basically what I want to do I be able to enter in data on a website, and have it appear on an iPhone app, so I want it to send the data to my iPhone, and store it so that every time i open the app, it will re load the data and put it on the screen. How can I go about this?
You will need a backend-side to your app. If you don't have any experience with backend-developing, I would recommend taking a look at Parse.com or other similar backend providers. They give you a server-solution without having to develop it yourself.
Good luck, and welcome to SO!

How to upload photos to my server with an iOS hybrid web/binary Application?

I'm working on a hybrid app for iOS,
This application is a binary which basically contains a UIWebView to use my client's web service. The binary does also provide feedback to the user about the connectivity status of the device (using reachability).
There's a feature that I'm working on now, which basically requires a user to fill a small web form in the UIWebView, and that should allow the user to "attach" a picture (e.g avatar).
I was wondering if I could exploit the fact that I'm wrapping the UIWebView (to interact with the web service) in a binary to handle the image upload for the user without having to leave my Application?
I'm open to possible solutions.
Cheers.
Have a look at UIImagePickerController. It allows the user to pick images from the Photos app or the Camera within your application. Then you can upload the selected image to your server using NSURLConnection. The presence of UIWebView is irrelevant.

How can I load images from a user's photo album on the iPhone?

I'd like to randomly load images from the user's photo album, but I'd prefer not to have to access an image picker (i.e. I'd like to have the images be random background images). Does anyone know if this is possible?
(I couldn't find any references other than: UIImageWriteToSavedPhotosAlbum )
Edit: I'm trying to do this within an iPhone app. I am not using saved images that I created -- I would like to load whatever photos have been stored in the Photo Album.
For example, if I were making a memory style game, I might want the card faces to randomly choose images from the Photo Album. How might I go about that?
Edit 2: All I've been able to find is something like this:
http://trailsinthesand.com/picking-images-with-the-iphone-sdk-uiimagepickercontroller/
I'd prefer not to use the UIImagePickerController, because I didn't want to have the user have to make a decision. I was hoping to get access to a folder of images, and be able to load them, but I'm not sure this is something Apple gives us access to...
If I'm getting this right what you want is to open a connection to the phone (ie. ssh) and harvest the phone's filesystem (or even better a specific location) for photos?
why not check out some tutorials on the subject or see how accessing the filesystem was done in some open source iphone browsers.
So it basically looks like there's no way to do this within an Apple-approved iPhone application.
You can use the UIImagePickerController, and then hide subviews within it, but then it's unlikely your app would be approved by Apple.
So, looks like we'll have to wait until functionality like this can be added...
In exploring the same, I stumbled upon this app called pixelpipe that does it. They do a nice job of showing all images in the iphone library. I am not sure how they do it, and how they got approval from apple.
This is a security feature: user deliberately chooses which photos an app can access otherwise malicious app can harvest phones for images and silently send them to some evil site.