In Android SDK there isn't an overload of a constructor of ViewGroup (and subclasses) with possibilities to specify the width and height in DP (or DIP) instead of in pixel. Why? Actually we have:
ViewGroup.LayoutParams(int width, int height)
Could be a good idea to have:
ViewGroup.LayoutParams(int dpWidth, int dpHeight, int ComplexUnitType.Dip)
where ComplexUnitType could be an enum with units of measurement (for e.g)