I am creating a login window with username and password fields and in each I would like to put icons. When I add icon to EditText field I cannot change the size of icon.
You can change the icon and use a smaller one on focus. This is the method you should use.
public void setCompoundDrawablesWithIntrinsicBounds (
int left, int top, int right, int bottom)
Sets the Drawables (if any) to appear to the left of, above, to the right of, and below the text. Use 0 if you do not want a Drawable there. The Drawables' bounds will be set to their intrinsic bounds.
Now to add padding you can use this
public void setCompoundDrawablePadding (int pad)
Sets the size of the padding between the compound drawables and the text.
Related XML Attributes:
android:drawablePadding
More information here and here. There are many other methods you might find interesting.