0
  1. Can we get how much time a user has spend on each application installed on his andorid?

  2. Or which are the most frequently used applications ?

  3. Also if we want to get the names ( not package names ) of all the applications what to do ?

    List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
    String TAG = "yolo";
    String out = "";
    for (ApplicationInfo packageInfo : packages) {
        Log.d(TAG, "Installed package :" + packageInfo.toString());
        pm.getLaunchIntentForPackage(packageInfo.packageName)); 
    }
    

I have the above code, but it gives me only package names, can I somehow get the name ? ( name by which application is installed )

himanshu kela
  • 83
  • 1
  • 9

1 Answers1

0

To answer your 3rd question, you want the application "label" -

packageInfo.loadLabel(pm)

See this post:

PackageManager's applicationInfo.name is always null

Your other questions should be asked separately. They require very different answers, depending on how you want to implement them.

Community
  • 1
  • 1
Jim
  • 10,172
  • 1
  • 27
  • 36