How to detect current active app in Android

How we get the detected app in our code?

See the current_activity method.

getCurrentActivity Doesn’t seem to be available any more in Java Client

its there as part of AndroidDriver

In Java, it’s driver.currentActivity();