title: How to get App's Permission for each app? how to do it programmatically on Android?
body: <p>How to get App's Permission Detail for each app? how to do it programmatically?</p>
  
  <p>I want to display <strong>"App's Permission Detail for each app"</strong> on TextView.
  But I try it but Not Ok??</p>
  
  <p>Hello.java</p>
  
  <pre><code>import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.ListView;
  import android.content.Intent;
  import android.content.Context;
  import android.content.pm.*;
  import android.widget.TextView;
  import java.util.*;
  
  public class HelloSakez extends Activity {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  
  final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
  mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
  final ListView lw = (ListView) findViewById(R.id.listView1);
  final List&lt;ResolveInfo&gt; pkglist = lw.getContext().getPackageManager().queryIntentActivities(mainIntent, 0);
  final TextView tw = (TextView) findViewById(R.id.textView1);
  Iterator it = pkglist.iterator();
  while(it.hasNext()){
  ResolveInfo rf = (ResolveInfo)it.next();
  tw.append(rf.toString());
  }
  }
  }
  </code></pre>
  
  <p>main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  &gt;
  &lt;Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/Button&gt;
  &lt;ListView android:id="@+id/listView1" android:layout_height="wrap_content" android:layout_width="fill_parent"&gt;&lt;/ListView&gt;
  &lt;TextView android:text="TextView" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/TextView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>