You could use dimensions see here: http://developer.android.com/guide/topics/resources/more-resources.html#Dimension are useful if you have the custom views implemented in xml.. you could also load the dimension in code like this:
Resources res = context.getResources(); // you can use application or activity context for this
float customWidth = res.getDimension(R.dimen.custom_width);
I hope it helps!
EDIT
So it seems that this helped:
yourlayout.getViewTreeObserver().addOnGlobalLayoutListener(ViewTreeObserver.OnGlobalLayoutListener yourCustomListener);
The callback will get called after the view will get measured and draw. Also I would suggest to remove the listener from the view once the callback is called to avoid useless calls.