Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
At what point, in terms of the quantity and size of images that you want to display in an app, is it better to serve images from a Web site than to store them locally in the app?

I am cartoonist who is learning java and android development so I can create an app that displays my cartoons, which are animated GIF files. The first version of the app will display about 100 GIFs, each about 50K in size. I expect the GIF collection to grow to 1000. I see other apps on Google play display image files and they are only 5MB, which makes me think that I should not try to store images locally in my app. But I am concerned about having them load as fast as possible.

I have found many useful code examples for displaying animated gifs in an android app using android.graphics.movie and WebView that show how to implement local storage or load from the Web. But I have not been able to find any recommendations about when, depending on the number and size of images involved, it is better to choose local over external or the other way around.

Thank you for any help you can offer!
Posted
Comments
Member 12201256 11-Dec-15 14:20pm    
Thank you Sergey and Yuriy for your thoughtful answers! Sergey - That is a good point about giving the option for the user to save locally. I was thinking more of where I should store my images (that is, in the app's resource folder locally or on a Web site) so that they user could display them on the screen as the app is running. I think Yuriy is probably right that the app would get to big if I stored them all locally.

I will look into the approach of batch downloading most of the images from a Web site in a separate thread.

Thanks again for your help!
Yuriy Loginov 11-Dec-15 14:45pm    
You are welcome and good luck with the app

If you go with local storage, i.e. images saved on the device itself then every time you release more cartoons you will have to roll out a new version of the app. Also the app may become too big and not even fit on some older devices.

My advice is go with web/cloud storage and pre-fetch images in batches. For example get 10 images at a time, then when a user views image #6 get another batch, that way by the time user gets to image #10 another batch will be ready to display and it will seems to the user like the images were always there. In order to do this you will nee to download the images in a background process. In other words let your image downloader run on a separate thread so that it does not impact the UI. Additionally maybe store your best cartoons locally and then while users are viewing those download additional images from the web/cloud
 
Share this answer
 
Probably you are talking about the piece of flash memory of an android device; usually, one is soldered inside the machine, and another one can be inserted in the slot. If you mean something else, please correct me.

Imagine the user is you. If you force the user to use the internal, this person may face the need to save your images elsewhere soon enough. And unfortunately, the typical style of work in Android is oriented to the users who hardly understand where in the file system the files are, many don't even understand the concept of files, they just click on images, and so on. Locating the file and transmitting them over network of from card to card would be awkward for many, but some just have a bigger external storage.

So, does it mean that the answer is: external storage? No. How about the user not having any? The Android device is typically sold without external card.

So, the conclusion is: don't make this choice at all, leave it to the user. Give the user a clear choice.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900