External Storage - deployment

I am developing an app where i have thousands of images i am reading from the sdcard. I would like to say when i deploy the app, the images are downloaded together with the app. I have been trying to find a solution to this but no help. Please help!!!
The images are used as bitmap resources for imageViews. the are too many that I can't put them in drawable because they will make the app size too big.
Right now i have manually copied them over to the storage of the device i am accessing them from there. If I want to test thye app on another device then i have to copy the images folder again to the external drive of that device. Is there a way i can include them in the solution without putting them in drwable

I would suggest to keep your images on some web server and try to download the images from here.This will avaoid coping images all the time to devices .
So here is what you can do :
1 ) Upload the images on some server .
2) Also you can have a xml which will have urls of all the image.
3) When you start your application you first fetch the XML and get the urls.
4) then using these urls you can lazy load the images in your app.
try to read and understand this concept here :
Thanks

Related

Flutter Menu App that gets pictures from firebase

I have a flutter app that is a menu for a restaurant. Now the problem is that I want to get the pictures from firebase. Currently, if you open the app, the pictures take time to load and you can see that with your eyes, it is a bit annoying and not practical regarding bandwidth data usage.
Is there any chance I can cache the images when I get them from firebase and than appear instantly? I request the links of the images once the page is open using a future and display them with a CachedNetworkImageProvider() with the image URL but that still takes time to load the images. Is there a way to download all the data in the firebase at once when you open the app and not check every time you open the app?
for all apps that require fetching images from a remote location, what i have been doing so far is download the image locally and use the local image instead of the remote one if it exists locally, from my knowledge cachedNetworkImage only caches the image after fetching when the app is currently running and refetches the image when the user restarts the app.
Please if you do find another way to cache images that would be cool and remove a lot of boiler plate code, please do post it, thanks.

How get images from Firebase Storage?

I have an application that uses a lot of images. I would like to store these images outside the ios/android device. I decided to store some of the images in firebase storage. How can I get images using storage? Like this
Image.asset(brand.model[0].model_image[index].image,
fit: BoxFit.fill),
Its better to store all these images in your app directory it will increase your app size but the images will load faster as they will be in the app itself plus help in reducing the data usage for the user as the app will not download the images on app launch but still if you want to keep the images in a outside server Firebase Storage will be the best use.
You can keep the assets separately in a folder called assets and you can use that from there. The only thing you need to do is specify the path in pubsec.yaml file to access the images.
I would always do it like.
assets
|_____images
|_____svgs
|_____audios
Hope this will help you to keep it organized.
I'm also into Flutter and Firebase, trying to keep the actual application as small as possible. I could write everything out right here, but the creators of FlutterFire have a website that explains every step in detail. This link below will direct you to the first step of using cloud storage.
Link: FlutterFire Cloud Storage

where to store 100s of images in iPad photo app

i am working on a iPad photo app, where i have to download 100s of images from web and have to store in app locally so that i can access it even if there are no internet connection. So for now i have store it to App's document directory . Is it be ok to store 100s of images in App's Document directory or is there any other way to store it. Please have a reply on it.
Yes you can store it in Document directory.
And also consider its size, if these are big files you can go for zip and save.

Storing .png images in an ios app?

Im creating an iphone game that will use more than 1200 .png image files, and all the images combined together come up to the size 11mb, i was wondering whats the best way to store them, i was going to use the s3 storage by amazon, but I would love them to be apart of the app in the resources folder, so users can play offline aswell. So i wanted get any opinions in what is the best way to store images in terms of caching and optimizating .png files in use with IOS Apps. thanks
Just drag them into xcode. 11 MB is not much, apple has raised their download limit over 3G/Edge.
Once you have them inside your project, you just call them like
UIImage *myImage1 = [UIImage imageNamed:#"1.png"];
It doesn't get simpler.
If you don't put the files inside your project and have to download them, you download these into your Documents folder. You can put what ever you want in that directory, as it is only for your project and no other project has access to it
11MB isn't much these days, your app can be upto 50MB and still be available to download over cellular networks so the best solution is;
a) Don't worry about it. Put them in your resources folder.
If you are going to have lots more images, then the easiest solution is to simply download them when the app has a network connection. You can store them in the Documents folder and mark them as do not backup so that they aren't synchronised with iCloud. You could also store them in the Caches folder, but that makes them much more liable to vanish at any moment so you would need to have a slightly more complex mechanism to recognise they are no longer on disk and to pull them in afresh.

creating iphone app for existing site. need advice about the data I'm downloading

I'm building an iPhone app for existing site (a local news site)
Main page with articles headers, when click on them you move to the article page. Simple.
This is the first time I'm building such type of app.
I have 3 general questions, just to make sure :
For the iphone, Do we need to
re-create the website article's
pictures for the iphone ? or there
is some programming tool that on the
fly make the files looks better on
the iphone ? or maybe, there is some
technique that creates one artice
picture that looks right both for
the server and the iphone ?
Usually, Do you need to create
special data channels from the
iPhone webservice ? or programmers
just use the existing rss channels
of the webserver ?
If someone know nice artice about
this stuff, It will help a lot. just
see what other are doing.
thanks.
You can see the intent Media apps, these apps are working like what you want your app to.
1) You're better off creating mobile versions of the images. You can do image processing on the iPhone, but you'll have to have the original and that makes the whole thing pointless (ie. you have to download the whole thing.) Generate a mobile thumbnail when those are uploaded on the server.
2) RSS will do. There's a very good tutorial at cocoadevblog.com about approaching such a task (I guess this covers 75% of the work you have to do)
3) Check 2) ;-)
if your download image is bigger the the thumbnail you are trying to display,
then the problem is in your code that change the image size. check carefully what are you doing to the image after downloading it.
I would recommend to create square thumbnails of your pictures at the server level. This will allow you to easily position in the iPhone screen, plus you will not need to download the whole image from the server.
nnahum