title: Getting time spend on each application Android?
body: <ol>
  <li><p>Can we get how much time a user has spend on each application installed on his andorid?</p></li>
  <li><p>Or which are the most frequently used applications ?</p></li>
  <li><p>Also if we want to get the names ( not package names ) of all the applications what to do ?</p>
  
  <pre><code>List&lt;ApplicationInfo&gt; 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)); 
  }
  </code></pre></li>
  </ol>
  
  <p>I have the above code, but it gives me only package names, can I somehow get the name ? ( name by which application is installed ) </p>