I am developing an app in which I have to make our app to fit for every device - for both tablet and android mobiles. Now I want to get the device height and width at runtim
You can get all the display related information using the class Display Metrics http://developer.android.com/reference/android/util/DisplayMetrics.html
you would require
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
After this all the required information will be present in your metrics object.
The other option is to call
getActivity().getWindowManager().getDefaultDisplay().getWidth()
getActivity().getWindowManager().getDefaultDisplay().getHeight()