Remove all home screen shortcuts programatically in Android - 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.

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.

Creating an app/widget in Android to clear the default values of a certain app

I need to write a code to create an app/widget that will "Clear Defaults" for an app. Instead of going to "Settings->Applications->[The App]->Clear Defaults", the user will click on the app icon (or widget) to clear these default values.
I am new to Android. I just want some help to create and build my first Android app/widget.
Many thanks...
You cannot affect other apps in this fashion. Only the Settings app, or possibly apps written as part of the device firmware, can change the default apps for particular Intent constructs.

How to add shortcut to All Apps screen

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.

Create URL shortcut in Android home screen programmatically

Does anyone have example code for creating URL shortcut on the android device home screen ?
I want my app to create some shortcuts to URL.
What do you want to do if the home screen is already full?
I think there are several good reasons why the user should be involved.
This link shows how a user can do it manually:
http://androidforums.com/htc-desire/197568-internet-shortcuts.html
And it contains another link to an app that lets you make custom icons etc.
http://www.folderorganizer.net/how-to/change-label-icon/
If you make a widget for your app, you can programmatically change URL shortcuts that appear in your widget ;-)

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

Categories

Resources