Android preset application icons, shortcut icons, or widgets on the desktop

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.