Location Assets Folder Android Studio (LAFAS)

Hi dev, I happen to be new to android studio, I started from web developer and decided to switch completely to android developer. I think the world of web and mobile programming has similarities, one of which is about the design pattern paradigm.

Talking about design patterns, of course there is something called an assets folder, a place where we can put multimedia sources such as images or audio. Well, in this case, namely Android Studio, I am still confused about how to create an assets folder that is in accordance with the rules that have been in effect so far. Please help, thank you!

Hi all, whoever you are, I will try to provide a little enlightenment, hopefully the information I provide can be a solution for you.

Okay, since Android Studio updated its gradle build system, then you have to put the assets folder inside the mian folder (for example, src/main/assets/). If you notice the typical new project generated by android studio is app/src/main, well there you can create an assets folder as usual.

Notes

  • If you want to create an assets folder for specific purposes, such as for debug or release, then you can put it in  app/src/release/assets/ or app/src/debug/asstes/
  • If you want the assets folder just for testing purposes, then you can put it in  app/src/androidTest/assets, but make sure you tell the system by declaring it in the InstrumentationRegistry.

Another way is to use the Android Studio feature by  right-clicking the target parent folder , then selecting  Assets Folder , then you will create an assets folder in the parent folder, without having to type the folder name manually, besides that you will also avoid typos, because naming this folder incorrectly can have a systemic impact on your project later.


Post a Comment

Previous Next

نموذج الاتصال