There is a process name for example com.android.vending , can I somehow get the name of the application that owns this process?

    1 answer 1

    In theory, the process name is the application package. Based on this, you can drive this into Google

    android get app name by package

    go to the first link

    and get the name of the application via PackageManager, getting ApplicationInfo from it by package as follows:

     final PackageManager pm = getApplicationContext().getPackageManager(); ApplicationInfo ai; try { ai = pm.getApplicationInfo( this.getPackageName(), 0); } catch (final NameNotFoundException e) { ai = null; } final String applicationName = (String) (ai != null ? pm.getApplicationLabel(ai) : "(unknown)"); 

    for any non-current application, replace this.getPackageName() with "com.android.vending"