Work with catalog images?

There is a large catalog of images (about 5 thousand units).

First question:

How to work with them in Android app? Throw them all in the res folder and access it from there? Or put in some directory on disk? Or in the database?

Second question:

If they lie in the res folder under the names:

pic00001

pic00002

...

pic05000

how to programmatically refer to them?

I can write for example:

ivCatalog.setImageResource(R. drawable.pic02700);

but how can I change the picture on the right?


PS I'm not a real programmer, trying to develop to the brain do not sustaibale.
October 3rd 19 at 02:40
2 answers
October 3rd 19 at 02:42
5000 images in agriculture is cruel. If they need all at once — compress them in an archive and when you first start APK offer download. Then unpack and use it. In General, highly depends on content. It is probably better to do the uploading online.
That is, store them on disk subsystem and from application to contact by file name? (online most likely option is not very good, as the volume of traffic will be great). - morgan commented on October 3rd 19 at 02:45
Yes, Yes, keep the drive and accessed using Drawable.createFromPath for example.

Network better, because then the image will be downloaded on demand, and not to lie dead weight in the memory of the phone user. To reduce traffic — make preview. - brock_Labadie commented on October 3rd 19 at 02:48
And if the goods as I saw above, then you'll need to update the data. So you need to make an online return photos (if you want, with caching) - brock_Labadie commented on October 3rd 19 at 02:51
sorry, the images, not photos (the brain busy :) - brock_Labadie commented on October 3rd 19 at 02:54
Photos, all right. But in this case the application will require the network, i.e. for example in the subway it will not be available, and this is the main user-case, to give the user povybivat goods on the road. - morgan commented on October 3rd 19 at 02:57
And how much do you weigh 5000 photos? If more than 50 megabytes, then the option /res immediately disappears. As this is the maximum size of the apk file. - Jany_Veum commented on October 3rd 19 at 03:00
Yes res and so disappears. There most likely will require updates, but for even 100 products upload 50 meters — very bold. If so, and need to sync offline, it should be done correctly to traffic as much as possible.

In General the data needs to be stored outside of agriculture, to tighten them better with the servers and come up with a normal upgrade scheme. - brock_Labadie commented on October 3rd 19 at 03:03
October 3rd 19 at 02:44
Got it, thanks.

Find more questions by tags AndroidImages