You can check the current Application(any application) package name running at the top
String packageName= getSystemService(Context.ACTIVITY_SERVICE).getRunningTasks(1).get(0)).topActivity.getPackageName();
Run this code in your background service in a loop and checks for your application.