How to get unused applications list in android?

Get list of installed applications within library Android

  • I've found this answer http://stackoverflow.com/questions/2695746/how-to-get-a-list-of-installed-android-applications-and-pick-one-to-run But it doesn't answer my problem completely, although I only have to find if a specific application is installed, I have no context in the library, so i can call getPackageManager() and get the list of applications. Are there any other way to do it? Maybe a Java only solution by searching in the Android file system? Please help!

  • Answer:

    You will generally have to add Context parameter to your library API, to init function for example, and pass a Context from the application that uses it. However, there is a hackish workaround (single-line, to highlight that it's an ugly hack): if (Runtime.getRuntime().exec(new String[]{"/system/bin/sh","-c","cd /data/data/jackpal.androidterm"}).waitFor() == 0) { Log.d("!!!", "Android Terminal Emulator app is installed"); } This code will check if the private app directory exists in Andorid filesystem. You cannot list private directory of another app, or open any files from it, however you can check if the directory itself exists just by trying to chdir there.

Peter at Stack Overflow Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.