Importing Assets

Now to add the sound files to your project and read them in at runtime. Rather than use the resources system for this job, you will use raw assets. You can think of assets as stripped down resources: They are packaged into your APK like resources, but without any of the configuration system tooling that goes on top of resources.

In some ways, that is good. Because there is no configuration system, you can name assets whatever you want and organize them with your own folder structure. In other ways, though, it is bad. Without a configuration system, you cannot automatically respond to changes in pixel density, language, or orientation, nor can you automatically use the assets in layout files or other resources.

Get Android Programming: The Big Nerd Ranch Guide, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.