How to add shortcut to All Apps screen - android

is there a way to programmatically create (after installation) a new shortcut in the All apps screen (menu, list of all installed applications).
I know that I can define shortcuts in AndroidManifest.xml, but that is not what I want. I want that users of my app were able to create them in my app settings.
I've found out that this is possible for Home screen (launcher shortcut), how to do it for All apps screen? Is it even possible?

The code you just defined includes both of these.
Programatically
If you had read the Intent documentation you'd find this:
Intent.ACTION_CREATE_SHORTCUT
Just send an intent with this information and you're good to go.
Manifest
Also ifyou want your application to show up in the ALl Apps screen, then in your manifest you'd define one of your activities to be set into the launcher category.
However; after installation it is NOT possible to add a shortcut to the All Apps Screen. As there is no API to allow this at all. You CAN create a shortcut on the Launcher desktop, but that is as far as the SDK can take you.

Related

Android - Adding shortcut to homescreen and specifying which screen and position

Im attempting to develop an AllApps drawer like Aviate, but as a separate Activity (that way I can launch it from Nova Launcher through a gesture).
I've seen answers on how to add a shortcut to the homescreen. i.e.:
Android create shortcuts on the home screen
How to add shortcut to Home screen in android programatically
Is it possible to specify the which homescreen page and location? I'm guessing not since google playstore does not seem to put it in the best place on a new app install, but wanted to confirm.
On the default launchers, there is no documented way to do this.

Remove all home screen shortcuts programatically in Android

I want to delete all home screen shortcuts in Android programmatically. I have already written an app to create my own shortcuts for opening up a browser instance & directing to specific URI & delete only those programmatically. When deleting shortcuts this way, I have to provide the exact name & URI for each shortcut.
How can I achieve the same thing for existing shortcuts which were not created by me (like browser, calendar or any other app default created a shortcut on home screen)?
This seems like something that shouldn't be and probably isn't possible for security reasons.

How to create shortcut within app in Android?

I've added shortcuts options for my Android app, but I found out other apps can create shortcut within their apps (in their apps, press menu button, choose create shortcuts, then their shortcuts appear in the launcher), when my only tutorial from Android developer is only for creating shortcuts from launcher (long press in launcher home screen, choose Shortcuts, then choose your app).
Can anyone show me the way to create a shortcuts within app?
Inside question is working solution, take a look. If you have any question add it in a comment.
How to add app's shortcut to the home screen

group multiple apps under the same icon in Application launcher

I want to group multiple apps under the same icon in the application launcher.
For example, 5 apps each displaying 1 different image. But those 5 apps should appear as separate apps on the Android market, therefore they need to have different package name.
But different package name, means that on the Android device they will appear as 5 separate apps in the application launcher, which I am trying to avoid.
The closest solution that I found is to listen for PACKAGE_ADDED broadcast event, and every time another app from those 5 are installed on the device, all the already installed apps would call setApplicationEnabledSetting from PackageManager to hide their icons and let the app that was just installed to handle things.
But the icons are hidden only after rebooting the device.
Is there a way to force the application launcher to refresh at runtime?
Or is there any other way to solve my goal?
I am running out of options. Thanks!
Miha,
What about having one main application, with the other 4 being add-ons (i.e., not shown in the launcher)? You would then have only one launcher icon, and the other applications would be started from the main app. By checking whether the other apps were installed, you could adjust your buttons/views accordingly.
As far as I know, there is no way to force the launcher to refresh. However, you could implement your applications as you described -- having each app hide it's icon when I new one is installed. The user would get an application not installed error though, which is probably not something you want.
Personally, I used the first method: have a main keyboard and then install add-ons which can then be loaded from the main app.
Hope this helps.

Getting App/Widget on Homescreen?

I was wondering if it's possible to get the icon (shortcut) of your app on the home screen during installation instead of inside the standard apps folder ?
And I did find out that Android has AppWidgets but I was wondering if it supports "standard" widgets as well (javascript/html/css) ?
At the moment it doesn't support "standard" widgets (javascript/html/css), but you should take a look at the Titanium Project
And there is no way to automatically put a shortcut on the homescreen when the application is installed. Not sure if most users would like that either.

Categories

Resources