View view = findViewById(R.id.some_view); view.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); int width = view.getMeasuredWidth(); int height = view.getMeasuredHeight(); Log.d("MyApp", "View width: " + width + " View height: " + height);This code measures the view with unspecified constraints, meaning the view can be any size it wants. The width and height of the view are then obtained using the getMeasuredWidth() and getMeasuredHeight() methods respectively, and logged to the console using the Log.d() method. The android.view.View class is part of the Android Framework, specifically the android.view package.