Modify the Res/XML/default_workspace.xml file and add the following code:
<Favorite
Launcher: packagename = "" // complete package name
Launcher: classname = "" // complete package name. Class Name (class for processing main intent)
Launcher: screen = "" // screen where the app icon is located (starting from 0)
Launcher: x = "" // column where the app icon is located
Launcher: Y = ""/> // row where the app icon is located
<Shortcut
Launcher: uri = "http://www.baidu.com"
Launcher: icon = "@ drawable/ic_launcher_baidu"
Launcher: Title = "@ string/baidu_title"
Launcher: screen = ""
Launcher: x = ""
Launcher: Y = ""/>
<Shortcut
Launcher: uri = "# intent; Action = android. intent. action. main; launchflags = 0x10200000; Component = com. cleanmaster. mguard/COM. cleanmaster. processcleaner. processcleaneractivity; end"
Launcher: icon = "@ drawable/ic_launcher_application"
Launcher: Title = "@ string/jinshan_title"
Launcher: screen = ""
Launcher: x = ""
Launcher: Y = ""/>
<Appwidget
Launcher: packagename = "com. Android. Settings"
Launcher: classname = "com. Android. settings. widget. settingsappwidgetprovider"
Launcher: screen = "3"
Launcher: x = "0"
Launcher: Y = "0"
Launcher: Spanx = "4" // Number of grids in the X direction on the screen
Launcher: spany = "1" // Number of grids in the Y direction on the screen/>
Note:
1. Configuration appwidget cannot be preset.
2. The app widget cannot be preset in The KK version launcher3 (default Google design)
3. If it is a carrier project, there will be a resource_overlay mechanism. Taking op01/spec0200/segc as an example, the preset desktop content is subject to the default_workspace.xml in the following path:
ICS/ics2: Alps/mediatek/source/operator/op01/spec0200/segc/overlayresource/packages/apps/launcher2/RES/XML/default_workspace.xml
JB/jb2: Alps/mediatek/operator/op01/spec0200/segc/overlayresource/packages/apps/launcher2/RES/XML/default_workspace.xml
Other carrier projects are similar.
How do I preset application icons, shortcut icons, or widgets on the desktop?