Export Layer for Android
This script started as an 'Export for iOS' script (written by someone who prefers to remain anonymous).
I modified the iOS script to instead export the appropriate image sizes for Android.
This script is intended to be used on a photoshop document containing mdpi artwork for Android. It will resize, trim and save the selected layer or group, into a
directory you select using the layer name (normalised) for the file name. There are a
couple of resizing options you can select such as the resizing method and whether to scale styles or not. It does not alter your original document in any way.
Images are saved to drawable-mdpi, drawable-hdpi, drawable-xhdpi and drawable-xxhdpi directories under the selected output directory. If these directories do not exist, the script will create them.
Feel free to share/reuse/modify to your heart's content. Attribution would be nice but is not required.
To install this script, copy it to your Photoshop installation directory's Presets/Scripts directory, and then re-start Photoshop if it is running.
To run the script, select the layer that you want to export, and then choose the Export Layer for Android option from PhotoShop's File -> Scripts menu.