Get all the apps in your system

Source: Internet
Author: User

1 /**2 * Get basic information on all installed apps3 * @return Basic information about all apps in the current phone4      */5      PublicList<appinfo>Getappinfos () {6         7List<appinfo> list=NewArraylist<appinfo>();8         //Get the Package Manager Object9Packagemanager packagemanager=Context.getpackagemanager ();Ten         //get information on all apps that have been installed successfully OneList<packageinfo> packageinfos=packagemanager.getinstalledpackages (packagemanager.get_uninstalled_packages); A          for(PackageInfo info:packageinfos) { -appinf=NewAppInfo (); -             //get the name of the app the             //String Name=appinfo.name; -ApplicationInfo appinfo=Info.applicationinfo; -             //String Name=appinfo.packagename; -String name=Appinfo.loadlabel (Packagemanager). toString (); + appinf.setappname (name); -             //get the icon to the app +Drawable icon=Appinfo.loadicon (Packagemanager); A Appinf.seticon (icon); at              //Add this information to the list collection - List.add (Appinf);  -              -         } -          -         returnlist; in}

Get all the apps in your system

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.