DEV Community


Posted on


Get Android's screen width and height

Inside your Activity:

override fun onStart() {
    val size = Point()
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) {
    } else {
        val windowManager = requireContext().getSystemService(Context.WINDOW_SERVICE) as WindowManager
    size.x // Width
    size.y // Height
Enter fullscreen mode Exit fullscreen mode

Latest comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git