- davidnunez / gist:1404789
- This comment has been minimized.
- full-of-foo commented Nov 15, 2013
- This comment has been minimized.
- full-of-foo commented Nov 15, 2013
- This comment has been minimized.
- banshee commented May 1, 2014
- This comment has been minimized.
- sunnychan2012 commented Jul 31, 2014
- This comment has been minimized.
- amr commented Sep 13, 2014
- How to get a list of installed android applications and pick one to run
- 20 Answers 20
- Clean solution that filter successfuly out system apps
- [GUIDE]List all installed apps that don’t allow adb backup
- Breadcrumb
- scandiun
- How to Get List of Installed Apps in Android
- 1. Creating application layout in xml
- 2. Writing Java class
- Download Complete Example
- Android Get List of Installed Apps Package Name With Icons Programmatically
- Note: Read below steps very carefully to add CardView and RecyclerView library inside your current project.
- How to Android Get List of Installed Apps Package Name With Icons Programmatically.
- Click here to download Android Get List of Installed Apps Package Name With Icons Programmatically project with source code.
davidnunez / gist:1404789
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
pm list packages -f |
This comment has been minimized.
Copy link Quote reply
full-of-foo commented Nov 15, 2013
This comment has been minimized.
Copy link Quote reply
full-of-foo commented Nov 15, 2013
Nice one liner: » adb shell ‘pm list packages -f’ »
This comment has been minimized.
Copy link Quote reply
banshee commented May 1, 2014
And for just the packages:
adb shell ‘pm list packages -f’ | sed -e ‘s/.*=//’ | sort
Need to delete a bunch of things? This gives you an uninstall for everything that’s installed; cut and paste to adjust:
adb shell ‘pm list packages -f’ | sed -e ‘s/.*=//’ | sed -e ‘s/^/adb uninstall /’ | sort | less
This comment has been minimized.
Copy link Quote reply
sunnychan2012 commented Jul 31, 2014
how to save it as a notepad text file?
I found the answer:
adb shell pm list packages -f > b:\1.txt
This comment has been minimized.
Copy link Quote reply
amr commented Sep 13, 2014
Building up on banshee’s one liner, for me there was a trailing \r, removing it was needed, as such:
adb shell ‘pm list packages -f’ | sed -e ‘s/.*=//’ | sed ‘s/\r//g’ | sort
Only then I was able to do get the following to work:
Источник
How to get a list of installed android applications and pick one to run
I asked a similar question to this earlier this week but I’m still not understanding how to get a list of all installed applications and then pick one to run.
and this only shows application that are preinstalled or can run the ACTION_MAIN Intent type.
I also know I can use PackageManager to get all the installed applications, but how do I use this to run a specific application?
20 Answers 20
Here’s a cleaner way using the PackageManager
Following is the code to get the list of activities/applications installed on Android :
You will get all the necessary data in the ResolveInfo to start a application. You can check ResolveInfo javadoc here.
Another way to filter on system apps (works with the example of king9981):
Here a good example:
Getting list of installed non-system apps
To filter on sytem based apps :
To get al installed apps you can use Package Manager..
To run you can use package name
You can Find the List of installed apps in Android Device by using below code, «packageInfo» Contains Installed Application Information in Device. we can retrive Intent for the application installed from the packageinfo object and by using startactivity(intent), can start application. it is up to you how you organize the UI either Listview or Gridview. so on click event based on position, you can retrive intent object and start activity intent.
I had a requirement to filter out the system apps which user do not really use(eg. «com.qualcomm.service», «update services», etc). Ultimately I added another condition to filter down the app list. I just checked whether the app has ‘launcher intent’.
So, the resultant code looks like.
If there are multiple launchers in a one package above code has a problem. Eg: on LG Optimus Facebook for LG, MySpace for LG, Twitter for LG contains in a one package name SNS and if you use above SNS will repeat. After hours of research I came with below code. Seems to work well.
@Jas: I don’t have that code anymore, but I’ve found something close. I’ve made this to search for «components» of my application, they are just activities with a given category.
I’ve commented the part where it gets the activity name, but it’s pretty straightforward.
Clean solution that filter successfuly out system apps
The idea behind this solution is that the main activity of every system app does not have a custom activity icon. This method gives me an excellent result:
context.getPackageManager().getInstalledApplications(PackageManager.GET_META_DATA); Should return the list of all the installed apps but in android 11 it’ll only return the list of system apps. To get the list of all the applications(system+user) we need to provide an additional permission to the application i.e
Since Android 11 (API level 30), most user-installed apps are not visible by default. You must either statically declare which apps and/or intent filters you are going to get info about in your manifest like this:
Or require the QUERY_ALL_PACKAGES permission.
After doing the above, the other answers here still apply.
Источник
[GUIDE]List all installed apps that don’t allow adb backup
Breadcrumb
scandiun
Senior Member
Some apps can’t be backed up using adb backup. It is mainly because on its AndroidManifest.xml the flag android:allowBackup is either not set or set to «false». This tutorial will get you a list of apps that are currently installed on your device but will not be backed up, either using the official adb backup, LG Backup, Sony Backup and Restore, etc. (because they all use adb backup internally). So you can be cautious on advance and you are aware that the backup methods used officially have its flaws.
1) REQUIREMENTS
I will make the list of apps using a computer, so you need several things set up on the computer and the android phone.
1.2) COMPUTER REQUIREMENTS
->aapt.exe and adb.exe installed. I recommend to install the Android Studio Bundle. The binaries will be installed in a path similar to this:
-> Add the paths of aapt.exe and adb.exe to your current PATH in Windows: How to Edit Your System PATH for Easy Command Line Access in Windows
-> Cygwin is mandatory to run bash commands on Windows. The x86 version is recommended because it has more commands than the 64bit version. This is where you will actually type the commands.
-> adb drivers for your smartphone. Windows 10 usually will install them flawlessly.
2) GETTING THE LIST OF APPS THAT DON’T ALLOW ADB BACKUP
2.2) CHECKING FOR SOFTWARE AND SMARTPHONE
Go into cygwin to a working directory to store there your temporary files:
Источник
How to Get List of Installed Apps in Android
Android PackageManager class is used to retrieve information on the application packages that are currently installed on the device. You can get an instance of PackageManager class by calling getPackageManager() . PackageManager provides methods for querying and manipulating installed packages and related permissions, etc. In this Android example, we we get list of installed apps in Android.
packageManager.getInstalledApplications() return a List of all application packages that are installed on the device. If we set the flag GET_UNINSTALLED_PACKAGES has been set, a list of all applications including those deleted with DONT_DELETE_DATA (partially installed apps with data directory) will be returned.
1. Creating application layout in xml
activity_main.xml
As you can see in the attached screenshot, we will be creating a ListView to show all of the installed applications in android.
snippet_list_row.xml
This layout is being used by the ListView Adapter for representing application details. It shows application icon, application name and application package.
2. Writing Java class
AllAppsActivity.java
This is the main application class that is used to initialize and list the installed applications. As getting the list of application details from PackageManage is a long running task, we will do that in AsyncTask. Also, this class is using custom Adapter “ApplicationAdapter” for custom ListView.
ApplicationAdapter.java
Download Complete Example
Download complete Eclipse project source code from GitHub.
Источник
Android Get List of Installed Apps Package Name With Icons Programmatically
In this tutorial we would going to create an android application which would display us all the only externally installed applications on our android mobile phone device. The application display into custom ListView (RecyclerView) and show us App icon, app name and app package name on screen. This application is designed into RecyclerView along with CardView. So here is the complete step by step tutorial for Android Get List of Installed Apps Package Name With Icons Programmatically.
Note: Read below steps very carefully to add CardView and RecyclerView library inside your current project.
1. Open your project’s build.gradle ( Module : app ) file.
2. Please add below code inside your build.gradle ( Module : app ) file.
3. Screenshot of build.gradle ( Module : app ) file after adding above code.
Here your go now both libraries is successfully imported into our project now next step is to start coding.
How to Android Get List of Installed Apps Package Name With Icons Programmatically.
Code for MainActivity.java file.
Code for ApkInfoExtractor.java file.
Code for AppsAdapter.java file.
Code for activity_main.xml layout file.
Code for cardview_layout.xml layout file.
Screenshot:-
Click here to download Android Get List of Installed Apps Package Name With Icons Programmatically project with source code.
Источник