I collect apk using the gradle app weighs 500k, I need to weigh 2 MB how to do this?

    2 answers 2

    This is not exactly the answer to the question, but comments on the comments of the answer above. Since everything is not included in the comment, but to leave it as it is, my conscience prevents me.

    @Yuriy SPb - the folder /assets/ is in the project root, and not in the folder /res/ / Moreover, placing this folder in /res/ you will get an error, because assets do not belong to application resources and cannot be placed in class R .

    This directory is used to store data not related to the resources of the application itself (such as markup, icons, and so on. The contents of the /res/ directory /res/ example, to store fonts, starting database configuration, html pages, and other arbitrary files needed by the application, but not suitable for placement in /res/

    Assets are distinguished by the ability to create an arbitrary directory structure within a folder and the absence of identifiers (not included in class R) to access a specific file. To access data, use the getAssets() method getAssets()

    In more detail about assignment to work and yuzkese assets.

    @Andrew The folder /assets/ and the IDE Image Asset tool are completely different things that are not connected by anything other than the coincidence of a word. The first is used to store arbitrary data, the second is to prepare images in the /res/ directory.

    You could use the /assets/ folder for your task, only you had to place it in the root of the project, at ONE level with the /res/ folder, and not into it. Inside the asset, you could mix an arbitrary file of the desired size, even without an extension.

    • @ YurySPb some comments on the comments. - pavlofff
    • Hmm, I somehow missed this answer. Thanks for the clarification) - YuriySPb

    Just add a picture to the res/drawable

    • What are assets? Why do we need? - researcher
    • one
      assets - a folder in the res folder where you can store files of any kind for later use by the application. - Yuriy SPb
    • It does not work out so, I tried to add, no effect - user193361
    • one
      How and why assets - I xs. I have never needed over the years of development for android. - Yuriy SPb
    • one
      worked with a picture in png format, thanks - user193361