Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

android resources folder naming

Directory Naming:

You do not need to provide a different suffix to your image file name for different screen sizes in Android like you do in iOS. The file name should be exactly the same for all the images of different sizes.

However, you need to follow Google's guidelines/conventions for directory naming. Images are called 'drawables' in Android.

Under the 'res' directory, place each image under a directory called drawable-<suffix>. Replace the <suffix> with the screen density qualifier (i.e., mdpi, hdpi, xhdpi, xxhdpi etc.)

Google recommends that you also create a directory called drawable (with no suffix) for default images. These default images will be used as fallback when Android does not find a specific image size for the user's device.

Example directory structure:


Image Size Ratios:

The correct way to create images for different screen densities is by starting at a base image size for mdpi.

Say for example your base icon size is 48px x 48px. Then:

mdpi:     48px x 48px   (1x)

hdpi:     72px x 72px   (1.5x)

xhdpi:    96px x 96px   (2x) 

xxhdpi:   144px x 144px (3x)

xxxhdpi:  192px x 192px (4x) 


Directory structure:

For size ratio comparison (mdpi vs hdpi vs xhdpi vs xxhdpi) go to:

Categories : Android

Related to : android resources folder naming
Where's my sdkextrasandroidm2repository folder in Eclipse's Android SDK folder structure?
I don't have this m2repository folder that everyone keeps referring to That would be installed via the "Android Repository" in the SDK Manager. All the latest according to Eclipse and no folder is present Unless you're using Maven with Eclipse, m2repository is not something you will use with Eclipse. How do I use a RecyclerView without having this specific v7 library available? By

Categories : Android
Android BufferedReader try-with-resources
Check your minimum API level. The java.lang.AutoCloseable interface wasn't added to Android until API 19. So the Java 7 'try-with-resources' feature isn't available unless you are building with Java 7 and your minSdkVersion is set to 19.

Categories : Java
Android: difficulties referencing resources
What is R pointing at in your code? It should point at something like If it is pointing to Android.R, it won't work. Remove import Android.R and import Android.R.*, then it should be OK.

Categories : Android
android-switch-backport -- how do you set resources?
OK, I figured it out. Posting here for others who have the same question: The resource is asb_textOff, not asb_switchTextOff. The latter is for switchpreferences. < android:layout_width="wrap_content" android:layout_height="wrap_content" android:textOff="test" switch:asb_textOff="@string/foo" />

Categories : Android
Android app - how to write to Android device's Documents folder?
Before creating file you have to create directory in which you are saving the file. Try like this one:- String fileName = "example.xml"; String myDirectory = "myDirectory"; String externalStorage = Environment.getExternalStorageDirectory().getAbsolutePath(); File outputDirectory = new File(externalStorage + File.separator + myDirectory ); if(!outputDirectory.exist()){ outputDirector

Categories : Android
Recently Add
I'm trying to create an onListItemClick even for a customized adapter. The array of items is found in res/values folder
No navigation/status bar touch listener exists, why?
z-index in Relative layout
java.lang.SecurityException: Permission Denial: getIntentSender() when using UiAutomation in a test
mvvmcross videoview URL binding
Android Emulator Unfortunately dev tools has stopped
Square Dagger error: class is exclusively members injected / cannot be scoped required
Installing a widget from an APP
How to stop onDraw() methods causing jerky scrolling of a ListView
How to find my Google Play Services Android BASE64_PUBLIC_KEY
Set style programatically does not work
How to get contacts from phonebook and sim but skype, facebook etc. in android
Where to put JUnit test in Android project
My Android Studio project keeps running my old project/application
how to avoid OUtOfMemory problems with create Bitmap
What tools use and how do continuous integration and test in Android with eclipse?
Converting drawable resource to Bitmap Android
Fragment Transaction show() does not show fragment on second time
Espresso - How to match ActionBar visibility?
Viewport setting ignored in Phonegap Android app, but only on certain phones?
how to open an activity with url scheme android
Android AsyncTask and Thread different behavior
How can one ellicit a Toast from a Service to a Fragment
GCMIntentService onRegistered not called
LinearLayout cropping but not expanding in Scrollview
Get a file from the application directory
How to set layout params using view's on touch listener?
How to disable Google Fit and revoke permissions from the app itself
Android Wear - receiving message from Wear without WearableListenerService?
How can I start new activity from another package?
© Copyright 2017 Publishing Limited. All rights reserved.