Please modify the Res/xml/default_workspace.xml file to add the following code:
<favorite
Launcher:packagename= ""//Full package name
Launcher:classname= ""//Full package name. Class name (the class that handles main intent)
Launcher:screen= ""//the screen where the app icon is located (starting from 0)
launcher:x= ""//The column where the app icon resides
Launcher:y= ""/>//The line 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 squares in x direction on the screen
launcher:spany= "1"//number of squares in Y-direction on the screen/>
1, can not be preset with configuration of the appwidget.
2, Google from KK began to limit the system permissions, for the access to systems have strict specifications. Launcher3 the system Bind_appwidget permission is not available by default, so the appwidget cannot be provisioned.
If you want to provision appwidget, you need Launcher3 to get system permissions, so to modify Launcher3 android.mk, add local_privileged_module: = True, The resulting launcher3.apk will be generated into the/system/priv-app directory and can be preset appwidget.
The specific code is written as follows:
3, if it is a carrier project, there will be resource_overlay mechanism, taking OP01/SPEC0200/SEGC as an example, the desktop preset content is based on the following path Default_workspace.xml:
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 to this.
App icon, shortcut icon, or widget on Android preset desktop