Storing R.drawable IDs in XML array

You use a typed array in arrays.xml file within your /res/values folder that looks like this: <?xml version=”1.0″ encoding=”utf-8″?> <resources> <integer-array name=”random_imgs”> <item>@drawable/car_01</item> <item>@drawable/balloon_random_02</item> <item>@drawable/dog_03</item> </integer-array> </resources> Then in your activity, access them like so: TypedArray imgs = getResources().obtainTypedArray(R.array.random_imgs); // get resource ID by index, use 0 as default to set null resource imgs.getResourceId(i, 0) … Read more

Different resolution support android

App launcher icon size in pixels for different resolution Mobile Resolution mipmap-mdpi (48X48) mipmap-hdpi (72X72) mipmap-xhdpi (96X96) mipmap-xxhdpi (144X144) mipmap-xxxhdpi (192X192) Tablet Layouts: Use following folders if you wish to have tablet-specific layouts: layout-large-mdpi (1024×600) layout-large-tvdpi (800×1280) layout-large-xhdpi (1200×1920) layout-xlarge-mdpi (1280×800) layout-xlarge-xhdpi (2560×1600) Drawables folders: Mobile res/drawable (default) res/drawable-ldpi/ (240×320 and nearer resolution) res/drawable-mdpi/ (320×480 … Read more