What is the difference between the /res directory and the /assets directory on Android?

Asked 2 years ago, Updated 2 years ago, 113 views

I understand that the files in the resource folder can be read in R.class, and in the Asset folder, they're written in a file system-like form. What is the exact use of the two?

android assets res

2022-09-22 22:21

1 Answers

Resources are a very important part, typically consisting of external elements such as images, audio, video, strings, themes, layouts, etc. for reference.

All Android applications have a resource directory (res/) and an asset directory (assets/).

Here, the asset stores raw bytes as an asset when reading them, and the usage is actually very small. In fact, there's not much difference between resources and assets. Typically, resources are used more often than set. The reason is that it's easy to refer to through the R class on Android.

Because Asset manages all the data in the directory as a raw file, it's a little uncomfortable because it has to use Asset Manager to read the file as a byte stream to read it.


2022-09-22 22:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.