What files are included in the APK file

I have a lot of unused images in my Android app. These images are placed in a separate folder in the root directory of the project. They are not used anywhere in the project, but I need to store them.

I'm worried that these unused images will be included in the apk file? Since there are many, and the apk file size is increasing.

+6
source share
3 answers

Files stored in the root directory (including custom subdirectories) are not included in the APK. A very common practice is to have your own files necessary for the project at the root of the project. For example, a source license file, a to-do list, a directory with high-resolution images from which you create distributed images, etc.

Android uses these subdirectories with a special meaning:

  • CSI /
  • Res /
  • assets /
  • LIES /
  • GEN /
  • bin /

Using a different subdirectory name than those Android will ignore your files.

+10
source

Confirm yourself: create apk and change the extension to zip and extract it. You can use apk optimizer like progaurd and more.

+1
source

addon to Darshan-JosiaBarber's wonderful answer

With Android-Studio-0.5.8, gradle -1.11 and android-tools.0.9. + you may also have a folder

  • resources

for files to be copied relative to android apk root.

Example:

  • The project file res / some / dir / file.txt will be copied to apk / res / some / dir / file.txt
  • the assets of the project file /some/dir/file.txt will be copied to apk / assets / some / dir / file.txt
  • project file resources /some/dir/file.txt will be copied to apk / some / dir / file.txt

This resources folder is needed if you want to include *.properties files used by cross-platform libs such as ical4j.

0
source

Source: https://habr.com/ru/post/917502/


All Articles