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