Android snippet: converting DIP / DP to pixels

Sometimes in android you have to deal with pixels, such as view.setPadding(int, int, int, int).  Obviously this is not ideal but no fear, there is a way to work around this. Simply come up with the value you want in dip, say 10, and then convert into pixels like so: float sizeInDip = 10f; int […]