简体   繁体   中英

Using large amount of gifs, images, texts in android app

I am building an android app that will ask user what they want to see. Based on that I will provide gifs, images and texts(one lines) based on time duration they choose. This would be an offline app. I am confused about how I should proceed with storing large amount of gifs(1000), images(1000), and texts( sentences or words). After storing I would want to run them in some kind of time duration loop so that those they have seen won't be repeated.

In my opinion images, gifs or otherwise are just resources and should be stored as such. Text can be stored in another appropriate resource file.

What I'd recommend is then ensuring you have a database that provides names and links to the resources.

When the user provides you with a keyword, query your database to get a list of items that need to be provided. Your query can be used to change the order etc...

Your code should then cycle through the query response, retrieving and displaying the items as appropriate.

Remember, if you are displaying images to a user you may also need to consider screen resolution and thus may require the same image at different resolution. Equally you may wish to consider localising the text to support different languages.

Hope this helps.

(By the way, I'd recommend putting a rough plan together based on the above approach, breaking it down to ensure you know 'HOW' to do it. After you know how/what, then search to see if a library exists that allows you to do what you want to do in a simpler method. Search to see if there's a better method for handling the resources etc... the first step is always getting AN approach and then evaluating to see if it's the best approach for your needs/requirements.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM