From the course: Android Development Essential Training: The User Interface with Kotlin

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Display images from the assets directory

Display images from the assets directory - Android Tutorial

From the course: Android Development Essential Training: The User Interface with Kotlin

Start my 1-month free trial

Display images from the assets directory

- [Narrator] The Android Application Framework lets you package any sort of file in the application as something called an Asset. You do this by creating a special directory named Assets and place it in a specific location. You can package image files, video files, audio files, text files or anything else you like. To create the folder, in the Android scope, right click on the app module, and choose New, Folder, Assets Folder. Accept the default settings and click Finish. And after a moment, your new Assets folder will be created. If you click on that Assets folder and then look up here, you'll see the actual location. It's placed under the source, main directory within the app module. Now, I'm going to move some of my image files to this new folder. I'll go to my resources directory, to the drawable directory and I'm going to select and copy all three files. I'll go to the Assets directory and I'll paste them into place. And now I have two copies of each of these images. I'm going to…

Contents