Purpose: at the top of the screen in the form of a rectangle to insert images, given that the images change dynamically. For questions in the program, a fragment has been created in which, depending on the question, images are substituted. I cannot put in drawable , since There are many questions and a lot of conditions to write so that for each question the necessary resource is selected from the drawable not an option. It's easier to put everything in assets and name the images in such a way that it is easy to make up the correct path to the image. I decided to use the nine-patch , but the images in jpg , which occupied 25 kb, began to weigh 180 kb. You can, of course, compress to png-8 , but here, too, there are some kind of pitfalls, because I found information that android studio independently converts from png-8 to png-24 when packaged in apk. that's about it . What do you advise? Images do not have such requirements as in the "Find 10 Differences" applications. Not enlarged image to the question.

  • the essence of the question is not quite clear - Jarvis_J

1 answer 1

You write: "It's easier to put everything in assets and name the images so that you can easily make up the right path to the image."

This can be done with Drawble :

 String name = \\ваша реализация составления имени файла int img = getResources.getIdentifier(name, "drawable", MyActivity.this.getPackageName());