Category: Android Code

December 26, 2016

How to Get Width and Height of Android Screen in Pixels

Sometimes you want to know the screen width and height in pixels. An example can be that you are developing a system information app and you have to display screen width and height in your activity. This is going to be so simple with very few lines of code. The following code snippet give you the screen width and height in pixels. Display display = […]

December 25, 2016

Android How to Check Service is Running or Not

In some cases you might want to check that a service is running or not. An example user case would be, in your app there is a service that sync data to server and you have given user the possibility to toggle the related service on and off. So how do you know that the service is currently running or not? To Know service running […]