0

I want to make an application in which I can see all the installed applications on my device. Is it possible to display all the applications in a List View?

If yes then how?

Mxyk
  • 10,678
  • 16
  • 57
  • 76
Shreyash Mahajan
  • 23,386
  • 35
  • 116
  • 188
  • 2
    Could be your case mate. http://stackoverflow.com/questions/5154878/interception-of-installed-applications-on-android-device thanks. – Sergey Benner Jan 10 '12 at 16:47

1 Answers1

1

Absolutely! In fact, that's how your home launcher works!

  1. First you need access to the ApplicationInfo, but this information is all distributed via the system's PackageManager.

    PackageManager _pm = getPackageManager(); OR PackageManager _pm = context.getPackageManger();

  2. Now, you just ask it for what you want.

    List _list = _pm.getInstalledApplications(flags); // Flags can be GET_UNINSTALLED_PACKAGES, GET_SHARED_LIBRARIES, GET_METADATA, or any combination. If you want none of these, just set it to 0.

  3. Now you just take that list and dump it into an Adapter. (Of course, you have to make one for yourself :).

Hope this helps,

FuzzicalLogic

Fuzzical Logic
  • 12,947
  • 2
  • 30
  • 58
  • Ok thanks. Will try it later. And Supose i want to access with that all installed application's icon then ? – Shreyash Mahajan Jan 11 '12 at 04:06
  • Simple, just make an activity and set the IntentFilter to action.MAIN, the category to category.LAUNCHER. :) You would do this in your manifest. Once your Activity references the pertinent information, it is accessible to the user. – Fuzzical Logic Jan 11 '12 at 20:32
  • actualy i want to hide the application that is already installed in my device. Thats why i want to get the information of all the installed app. Do you have any idea what can i do to hide the application from the luncher ??? Thanks. – Shreyash Mahajan Jan 12 '12 at 04:15
  • Uninstall it... Unless you are writing your own launcher. The launcher does what it does in the way that it does for a reason. If you need that capability, you can download a custom launcher or you can write your own launcher. Otherwise there is no guaranteed way to hide it from the launcher. Now, if you want to hide YOUR OWN application, all you have to do is not have a action.MAIN with a category.LAUNCHER, but that only hides the application for the purposes of launching. – Fuzzical Logic Jan 12 '12 at 04:18
  • Yes i suppose to do that. I just want to hide that icon so no one can see it. I dont have concern with inner data of that perticular app. – Shreyash Mahajan Jan 12 '12 at 05:26