I have to get the package name of all the applications installed on the phone which has a launcher i.e. which appears in the app list of the phone.
I know pm list packages lists down all the package but it also includes the services and system applications. I want only the apps which show up on the app menu of the phone.
Also I don't want to use monkey runner, any other alternative would be great.
Any help?
Try calling getLaunchIntentForPackage() in PackageManager on each package installed. If it returns null, then it has no launcher. Although you may get a few false positives from apps with a MAIN activity but without a launcher.
Related
I have here a conference system that is based on Android. Since its functionality is very limited I want to try to modify the system. AFAIK there is no way to access the system configuration nor the file system through the UI of the conference system itself. And I haven't found a way to access the system using ADB yet, neither through USB nor Ethernet.
But: The whole file system is on an accessible SD-Card, so at the moment this is the only way to modify the system.
First thing I would like to do is to change the current launcher (which is mostly an interface for doing conference calls). I located the launcher in the app folder and found the entries in the packages list/xml-file in the systems folder.
My first question is: Where is the setting stored which apk is started as the launcher at the end of the boot process?
Second thing would be of course: Installing other apk. Is that possible, only through access of the file system?
Where is the setting stored which apk is started as the launcher at the end of the boot process?
Upon bootup, the system-server process launches the ApplicationManagerService, which sends an intent similar to any intent sent by any other application for launching another application in general. Applications on the device which have the following snippet in their manifest are shown among other options which can handle the intent (including the default launcher) :
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
There can be a case where the os has set an application as a default launcher. There can be a couple of possible solutions for the case :
- Remove the application defaults by going to settings > launcher application
- Remove the default launchers programatically using adb (which isn't setup in this case physically , but can be done wirelessly)
- Override all default launchers in your application's .mk file using LOCAL_OVERRIDES_PACKAGES
Second thing would be of course: Installing other apk
You can try these methods for installing an application, if there's no direct way of installing one
- Use wireless adb using wifi/ bluetooth and install apk using adb shell pm install
- Pushing package to the filesystem and installing it by allowing external packages in settings
- Downloading the package from a webserver and allow the ApplicationManager to invoke the default PackageManager for the installation prompt
I'm a noob btw so I try doing thing the way I think it will work which didn't so I need your help. There this website from cerberus app. I tried to start app by typing the path to the app. Send the command throught the site built-in sms toward my phone number but still will not start. There also a shell that launches from the site that show something like the linux cmd. These are the path I tried execute. system/data/app/com.android.chrome_6.apk chrome.apk
data/app/com.android.chrome_6.apk.
My phone is an Samsung Galaxy Avant.
You wilk need to know the actual package name. For example you can open the system settings app with com.android.settings.
You can find the package name by using an app called Uninstaller Pro app from play store. It will show you the package name as ID.
I am trying to make a small application that can launch an application, not usually shown in the app drawer. This application is generated by the system and is carrier specific. It belongs to the package com.android.stk - for those of you who don`t know it is the SIM Toolkit application. The SIM Toolkit application itself can not be launched, but when I insert my sim card, it creates a carrier specific application - In my case: Dialog Services, which can be run to make changes to sim settings.
The problem is that the package name for the Dialog Services app is still com.andorid.stk . All I want to do is open up that app. Is there any way to do this... Possibly search for all apps within com.android.stk and selecting or launching that one...
I am relatively new to Android dev, so All help is appreciated.
You can launch any installed application whose package name is known:
Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.andorid.stk");
startActivity( LaunchIntent );
I will prevent some application to be deleted from the phone.
Now, I can get current top activity name using ActityManager and check if it is com.android.packageinstaller.UninstallerActivity, than do additional logic for checking which package will be deleted. but I can't get UninstallerActivity object, and more - I can't get Intent passed to com.android.packageinstaller.UninstallerActivity (which will provide package name for me).
Seems like this isn't possible with standart Android API way. maybe it's possible using hidden API and reflection.
Any ideas?
Edit: I'm writing Launcher application, which will be distributed manually in hotels. I will have functionality which prevents from deleting my Launcher application from the phone, because mobile phones will be given in rent, and Launcher replacement isn't possible.
Note: The phone will be rooted!
I am writing an application to add all our apps to the homescreen of our devices. I need it to skip the apps that are services or contentproviders that just run in the background and are never "launched" by the user.
Any ideas? Right now i am specifying the apps, but would like to have it more automated.
Thanks!
See this thread for information on finding launchable Intent instances from the package manager.