1. Are you ready for the Galaxy S20? Here is everything we know so far!

get app's permissions

Discussion in 'Android Development' started by Osama Ahmad, Sep 4, 2011.

  1. Osama Ahmad

    Osama Ahmad Lurker
    Thread Starter

    hi

    i want to make an application that contains a list of installed application and onClick in any application return application permission.

    Code (Text):
    1.  
    2. String appName;
    3. List<PackageInfo> packs = getPackageManager().getInstalledPackages(0);
    4. for(int i=0;i<packs.size();i++) {
    5.      PackageInfo p = packs.get(i);
    6.      if ((p.versionName == null))
    7.            {
    8.                 continue ;
    9.             }
    10. appName  = p.applicationInfo.loadLabel(getPackageManager()).toString();
    11. Drawable icon = p.applicationInfo.loadIcon(getPackageManager());
    12.            
    13. Log.d("aaaaaa", "Installed package :" + appName +  "" );
    14. Log.d("dddddd", "Launch Program Icon :"+ icon + "");
    15.  
    16.  
    this code to get the application name and it's icon and i want return the permissions


    help me pls :)
    This is home work
     



    1. Download the Forums for Android™ app!


      Download

       
  2. ninjalizard

    ninjalizard Lurker

    Your homework was to ask how to do this in a forum? ;)

    Here's a hint, you are pretty close to the solution already, just check out the members of the class PackageInfo which you are iterating though.
     
    scary alien likes this.
  3. Osama Ahmad

    Osama Ahmad Lurker
    Thread Starter

    I try many time but I don't know how to do it. :mad: :)

    ok I will check class PackageInfo but if I can't do it, you will help me :D


    Thank You :)
     
  4. ninjalizard

    ninjalizard Lurker

    I'm sure you'll be fine, when I have the time I'm glad to help, the more people developing for Android the better :D
     
    Osama Ahmad likes this.
Loading...
Similar Threads - app's permissions
  1. svim
    Replies:
    0
    Views:
    63
  2. louiekw
    Replies:
    2
    Views:
    194
  3. Scadica
    Replies:
    0
    Views:
    260
  4. charlington
    Replies:
    5
    Views:
    327
  5. Jerome Jordan
    Replies:
    2
    Views:
    318
  6. DrewInc
    Replies:
    3
    Views:
    1,559
  7. RachNova
    Replies:
    3
    Views:
    3,387
  8. sancho_s
    Replies:
    1
    Views:
    2,515
  9. Roy Weil
    Replies:
    0
    Views:
    1,615
  10. RazaCodeRepo
    Replies:
    4
    Views:
    1,024

Share This Page

Loading...