Context Class objectResourceID the specific picture resource ID.Common Properties:PackageName the package name of the application, the type is Packagename:type/entitynameResourceName ResourceID The resource name of the corresponding
For example: a picture resource R.id.icon = 0x7f020000, then resourcename is Packagename:drawable/icon
Specifically how to get the picture resources through the Intent.shortcuticonresource object, please refer to the sample demo.
Sample DemoNote: Click to create
Sometimes, for launcher development, you need to remove the search box and protipwidget on the launcher. In addition, protipwidget is added after Android 2.2. After searching for N for a long time, the original definition file is in launcher2/RES/XML/default_workspace.xml, and the file is pasted below:
Then,
These two are the search box we are looking for and protipwidget (I don't know how to translate t
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 music playing applet. This is a typical widget + app application. A program can be started either through a
In launcher, long press the screen and the figure goes down. Let's find it in the Code:
First, find the onlongclick (view v) method, and then in this method, there is the following code:
if (mWorkspace.allowLongPress()) { if (cellInfo.cell == null) { if (cellInfo.valid) { // User long pressed on empty space mWorkspace.setAllowLongPress(false); showAddDialog(cellInfo);
execution process to the application A,android program to start running.The newly generated application A will use the connection information for the library and resources that already have the zygote parent process, so it runs fast.In addition, for zygote startup, the DVM is initialized and run, and then the required classes and resources are loaded into memory.The fork () is then called to create the zygote ' child process, and then the child process dynamically loads and runs application A.r
APP widget app Widgets
Application widgets are tiny application views that can be embedded into other applications (such as desktops) and receive periodic updates. You can use an app widget provider to publish a widget. The applic
This example describes the Android Desktop plugin app widget usage. Share to everyone for your reference, specific as follows:
application window Widget App Widgets
The application window widget (widget) is a tiny application vi
Android API Guides --- App Widget HostApplication Widget hostAndroid available on most Android devices ?? The oid home screen allows users to embed application gadgets for quick access to content. If you are building a home replacement or similar application, you can also allow users to embed application components by implementing AppWidgetHost. This is not somet
Supports thawing and freezing apps
Support to hide specified app in the app list
Support detection system core app to prevent delayed freezing causing cell phone to become brick
Support Cleanup App Cache
Support Force Stop App
APK file is only 47KB
Personal
Objective
This is the main implementation of an Android application, static broadcast, dynamic broadcast two ways to change the content of the widget, that is, in the blog on the basis of the experiment to modify, so the focus of this experiment is the realization of appwidget small parts ~
First, let's simply say what the widget is.
The application window widget
A fancy desktop-like APP, but better than Launcher and applauncher
Do developers who develop Android apps become obsessed with the brilliant effects of Launcher? Even Android Launcher does not know anything. Okay, pick up Nong's mobile phone and slide right and right on the unlocked homepage to experience the
Today the main analysis of the Android Launcher source code in the relationship between some important classes, the basic loading process. Take a look at a class diagram firstLauncher.java is the primary activity that initializes the Launchermode instance within the OnCreate method.Launcherapplication app = ((launcherapplication) getapplication ());Mmodel = App.setlauncher (this);The method of directly ente
Use the appwidgetprovider class
The appwidgetprovider class inherits the broadcastreceiver class, which can conveniently process appwidget broadcasts. Appwidgetprovider only receivesEvent broadcasts related to widgets, such as APP widgets updated, deleted, enabled, and disabled. When these broadcast events occur, appwidgetprovider receives the following method calls:
Onupdate ()
Call this method within the specified interval to update the
Do the students who develop Android apps are obsessed with the brilliant effects of launcher? What, even Android launcher is not known. Okay, pick up Lennon's cell phone, swipe and swipe left and right on the unlocked home page to experience the experience, this is launcher.Launcher is actually an app, but it's a system level. Although the various Android phone m
App widgets are also a UI component that can embed a small program (program piece) into the desktop. Compared with common widgets (such as TextView and WebView), the following differences exist:
An App Widget is a live UI component that automatically updates its content;Widgets cannot automatically update their own content and can only passively wait for user cal
The main thing in launcher is to get the portals and icons for all the app lists, and there are two ways to get them:PackageInfoResolveInfoRun get launcher of all apps and allow click events to go to the appThe following two methods are used to obtain a list of all apps:Establish basic data:Pakagemod.javapublic class Pakagemod {public String pakagename;public str
Intent object for receiving app widget Broadcast
Appwidgetprovider is just a convenient class. If you want to directly receive app widget broadcasts, You can implement your own broadcastreceiver class or override the onreceive (context, intent) callback method. You need to care about the following types of intent objec
has to prevent the restart ....Luck is really good, just have this attribute:android:configchanges=["MCC", "MNC", "locale", "touchscreen", "keyboard", "Keyboardhidden", "Navigation", " Screenlayout "," Fontscale "," Uimode "," orientation "," screensize "," Smallestscreensize "]The official explanation is this:Lists configuration changes that the activity would handle itself. When a-configuration change occurs at runtime, the activity was shut down and restarted by default, but declaring a Conf
Android operating system for In addition, if the user wants to add an app shortcut to the device's home screen, you can press and hold the app's icon in launcher, and the Android system will automatically add a shortcut to the app on the home screen. The name and icon are the same as in launcher.In addition to supporting shortcuts to apps (main activity), Android
When we click on an application icon in the Launcher interface, we start a program, so what happens to this process? Let us follow launcher source code to analyze it.First on the flowchart:650) this.width=650; "Src=" http://img.blog.csdn.net/20140509134103500?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqva2luym9z/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" Southeast "/
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.