Updated AndroidLocator for Drawable and Mipmap Resource Directories

Just an FYI, AndroidLocator has been updated to allow for image resource files to be stored in the Android Drawable and Mipmap directories. Previously, the only place to store the image resource files was in the “assets” directory. This should be available when 3.2 comes out.

The main advantage of allowing the image files to be stored in the “drawable” directories is to take advantage of the Android OS choosing different image resources based on the current device capabilities. If various image files are stored in the appropriate “drawable” directories, then the Android OS will return the best matching image resource during runtime when the image is loaded. This allows for lower resolution images to be automatically chosen for low end devices and high resolution images to be used for high end devices or tablets.

Here are a couple of links to the Android documentation that describes the naming convention for the drawable directories that allow the Android OS to choose the appropriate image resource.



As stated in the Android documentation, the drawable directories are flat, so you cannot separate images into separate folders. In order to request a resource located in the drawable directory, look at the “TestAndroidResources” example in the engine “jme3-android-examples” module.


When requesting an image file from the drawable directories, simply use the filename.ext (do not include any path info) and let the Android OS choose the correct drawable directory to use based on the actual device capabilities.

Overall, the search order for image resources is: assets → drawable → mipmap. The first file that matches is returned and loaded by AssetManager.