Let's briefly talk about the principle of widgets. Widgets are a piece of information displayed on the desktop. You can also click widgets to jump to a program. The system comes with a program. The typical widget is music. This android built-in
This example involves the following knowledge points:1) Use of the attrs. xml file2) gesturedetector. ongesturelistener listens for gestures3) Use of onlayout (), onmeasure (), and ontouchevent ()Next, let's talk about my Implementation ideas:1)
If you have read some of the following articles and are familiar with them, you don't have to think about them. I have intercepted ^ 0 ^, And then I have made up some details to facilitate understanding. (Note: The following is a combination of two
1: Replace the image resource ic_goolge_logo_normal.png in the packages/apps/quiksearchbox/RES/drawable-hdpi path to remove the Google image. 2: replace the image resource ic_goolge_logo_normal.png in the
Modify the packages \ apps \ launcher2 \ res \ XML \ default_workspace.xml File
Reference: http://blog.csdn.net/xubin341719/article/details/7059285Add shortcuts
// icon y positions. The first in the upper left corner is 0, increasing downward, 0-2,
Effect
When you click the Home key, it will pop up to select one of the two luncher items ~ LuncherTest is our custom
It is okay to add three lines of code in the center of the started activity. You can set the specific content of LuncherTest
the MoD installation tutorial
Step one: Click on the game settings to find MoD admin and click
Step Two: Find the Add Word and click, Pop Select MoD window
Step three: Find where your mod is and click on MoD to add it at the end of
This source code is based on launcher2 of 2.1. Although there are changes in later versions, the general principle remains unchanged.
1. Main files and Classes
1. launcher. Java:Main activity in launcher.
2. draglayer. Java:The rootview of launcher layout. Draglayer is actually an abstract interface used to process dragging, preliminary processing of events
you carefully study the next each configuration qualifier, you will realize: want to perfect fit all kinds of situations can be said to be impossible, in fact, we usually most commonly used is the basic must be used is the screen pixel density, here is necessary to say this parameter in detail:
LDPI: low density screen; about 120dpi.
MDPI: Medium density (traditional HVGA) screen, about 160dpi.
HDPI: High-density screen, about 240dpi.
XHDPI: Ultra high-density screen; about 320dpi. New conf
Launcher3 custom wallpaper cannot be restored after being stretched after rotation, launcher3 stretch
Copyright. For more information, see the source:
Http://www.cnblogs.com/sickworm/p/3966857.html
MTK8382/8121 platform.
Description: After setting a custom image as a wallpaper, the portrait screen is rotated when the screen is displayed. The image is stretched because the resolution is too small. The image is then rotated to the landscape screen without restoration.
This problem has been solve
How do I 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 lo
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 = ""
Android preset application icons, shortcut icons, or widgets on the desktopModify 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 loca
Android Launcher2 source code analysisThe Android Launcher2 source code analysis Android source code program has an application portal. The official Chinese translation is "starter ". Let's take a look at the source code analysis of Launcher. Launcher, starting with AndroidManifest. xml:
...
Others, let's
(1) preset widgets in Launcher (that is, add widgets to Launcher by modifying the configuration file). In the default_workspace.xml file in the Launcher directory, write the following configurations for the widgets to be added:
[Html]Launcher: packageName = "com. android. music"Lau
.
Bootstrap Classloder
Extention ClassLoader
Appclassloader
For a better understanding, we can view the source code.Look at Sun.misc.Launcher, which is a Java Virtual Machine portal application. Public class Launcher { private static Launcher Launcher = new Launcher (); private static String Boot
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.