Widget

Is there a way to check if the app is running in background using the widget?

You can check out the Application API for this purpose.