Edited Question:
Mobile Resolution:
I would like to design different screen dpi like following resolutions.
320x480,
48
First your application design for one resolution .
example : suppose your mobile resolution 380*480
mobile screen width:380
textView size is 80dp
Assume : if width is 380dp then 100 % then
textview width 80dp then how many %(per).
ower answer is: 25 %
find screen size programmatically using belove formula
DisplayMetric displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
ScreenHeight = displaymetrics.heightPixels;
ScreenWidth = displaymetrics.widthPixels;
txt_height = (int)((ScreenHeight*14.58)/100);
txt_width = (int)((ScreenWidth*37.5)/100);
LinearLayout.LayoutParams normal_param = new LinearLayout.LayoutParams(txt_height ,txt_width );
txt_Name.setLayoutParams(normal_param);