Android preset application icons, shortcut icons, or widgets on the desktop
Modify the res/xml/default_workspace.xml file and add the following code:
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
Launcher: uri = "http://www.baidu.com"
Launcher: icon = "@ drawable/ic_launcher_baidu"
Launcher: title = "@ string/baidu_title"
Launcher: screen = ""
Launcher: x = ""
Launcher: y = ""/>
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 = ""/>
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/>
1. configuration AppWidget cannot be preset.
2. Google has added restrictions on system permissions since KK, and has strict rules on obtaining system permissions. By default, Launcher3 does not have the BIND_APPWIDGET permission of the system, so it is impossible to preset the AppWidget.
If you want to preset the AppWidget, you need Launcher3 to obtain the system permission, so you need to modify the Android of Launcher3. mk: Add LOCAL_PRIVILEGED_MODULE: = true. the launcher3.apk generated by buildis under the/system/priv-app directory, and appwidgets can be preset.
The code is written as follows:
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.