I believe that the Android system has seen the classic launcher. As shown in, it is the original launcher Main Menu function of 4.0. What we want to learn today is this. Through this small code, we can review the knowledge points:
①. Application acquisition and processing, including applications in SD.
②. Dynamically monitors the installation, uninstallation, and
First part--------------------------------------------------------------------------------ProblemAs the activity can only be displayed to the foreground when the onresume, so, if the background set for mainactivity, no matter how fast oncreate-onresume speed, will appear a short empty page with the title , That's what we don't want.Methodjust at Androidmanifest.xml for your Application > plus the Theme property. Part II-----------------------------------------------------------------------
.getwidth (); Bitmap resultbmp = Bitmap.createbitmap (width, width,bitmap.config.argb_8888); Paint paint = new paint (); Canvas canvas = new canvas (resultbmp); canvas.drAwbitmap (lay1, 0, 0, paint);//Draw the lower layer//Let the upper icon center Display int top = 0;if (Lay1.getheight () > Lay2.getheight ()) {top = (Lay1.gethei Ght ()-lay2.getheight ())/2;} else{//here can determine whether the picture is larger than the box, and then continue to get more than how much, the upper picture of th
See the number on the iphone calendar icon will change with the date changes, recently on the Android platform also studied, the implementation method is as follows:directly on the sourceChanged it in the launcher.First, in the Iconcache.java file, find the method private CacheEntry cachelocked (componentname componentname, ResolveInfo info,HashmapIn Entry.icon = Utilities.createiconbitmap (icon, mcontext); This position is modified:The following sour
To hide the boot icon from the APK in launcher:APK's Androidmanifest.xml file is removed from the main activity in Intent-filter.To see if the APK is installed successfully:See the application list for apps, settingsStart the APK method:Intent Intent = new Intent (intent.action_main);Intent.setcomponent (New ComponentName ("Com.my.demo", "com.my.demo.MainActivity"));Intent.addflags (Intent.flag_activity_new_task);StartActivity (Intent);Hide apk in Launcher
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 string appname;public drawable icon;public pakag
1: And I looked at it myself. The loading process of the desktop icon:When the desktop first loads, it reads an XML configuration file by default and completes the configuration work. This configuration file is in the Launcher directory,The path is: \launcher\res\xml\default_workspace.xml. This XML file is just upgraded, launcherThe configuration file that will be read when it is displayed at once. Default_
Blog migration-I have migrated my blog to www.ijavaboy.com to better manage it. We are sorry for the inconvenience caused by no updates! New address of this article: Click me
With the previous work, the desktop is basically ready to use, but it is far from the launcher that comes with the system. Among them, the items on the system launcher's desktop can be freely crossed (moved. At the same time, you can kill the traversal. In this article, let's ta
From: http://blog.csdn.net/android_tutor/article/details/5486804
Recent studiesLanucher, Read the source code, and foundSlidingdrawerThis class is also called the "drawer" class. It is easy to use, includingHandle, AndContent.
HandleWhen you click it,ContentEither drawer or close drawer. The specific steps are as follows.
1. CreateAndroidProject, namedSlidingdrawer.
2. Prepare materials. Here my icons are usedLauncher2Put the icon inDrawable-hdpiThe folder directory structure is as follows:
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 "/
(Intent.flag_activity_new_task); This mark must be added context.startactivity (newintent);If you are starting a service, if you want to start Mainservice, the IF statement block reads: Context.startservice (new Intent (context, mainservice.class)); This sentence can also be split into two sentences note: Activity and service are to be registered in Manifest.xmlThe second step is to register the above broadcast receiver in manifest Bootbroadcastrecieverreceiver android:name=". Bootbroadcastreci
= context;This.resinfo = Resinfo;}@Overridepublic int GetCount () {TODO auto-generated Method Stubreturn Resinfo.size ();}@OverridePublic Object getItem (int position) {TODO auto-generated Method Stubreturn Resinfo.get (position);}@Overridepublic long getitemid (int position) {TODO auto-generated Method Stubreturn position;}The purpose of this place with Viewholder is to improve the app's speed by not having to reconstruct our convertview and find ImageView and textview every time.@OverridePubl
Systrace tool to observe the results of the optimization, found that the yellow dots and red disappeared half.5. Try to move the Google folder to the fixed bar, do not redraw the test with the animation, red warning all disappears6. Further refine the yellow warning7. Open TraceView, found that onmeasure become a time-consuming, and further use of the development model of the GPU over-rendering analysis, found that there are less serious over-drawing problems, icon under the Software name font
On the android unlock page, plug in USB to open the USB storage settings page. Press the HOME Key/Return key to directly return to launcher, instead of sliding the screen lock page.1) If you disable setting -- developer options -- USB debugging disable, it indicates that the current user mode is used, and USB is inserted under the screen lock interface, AMS calls the USB storageactivity "Open USB storage de
() {@Override Public voidrun () {//time consuming tasks, such as loading network dataRunonuithread (NewRunnable () {@Override Public voidrun () {//Jump to MainactivityIntent Intent =NewIntent (launchactivity. This, Mainactivity.class); StartActivity (Intent); //End the current ActivityLaunchactivity. This. Finish (); } }); }}). Start (); }}This way, once the background task has finished processing, it will automatically go to the main interfac
This article describes the development process for Android boot auto-start application.1: Add self-launch permissionsAdd Permissions in Androidmanifest.xmlandroid:name= "Android.permission.RECEIVE_BOOT_COMPLETED"/>2: Add self-initiated receive, decide which broadcastreceiver to use as the application entranceAdd a portal to Androidmanifest.xmlreceiverAndroid:name= "Com.zpd.scanadapter.BootUp" >Intent-filter> ActionAndroid:name= "Android.intent.acti
After reading the code above, we can see that when we start to click the desktop, celllayout will check whether there is a child in the selected area based on the clicked area. If so, we can set it as a tag. cell, no, Tag. cell is set to null, and launcher is later started when drag and drop. onlongclick processes tags,
This straighten out, and then go deep into the workspace. startdrag function. workspace. startdrag calls dragcontroller. startdrag to
Recently introduced the latest 4.4 desktop to eclipse spent a few nights, fix some error. Finally can run.The code for single found on 4.4luancher has changed.Find the next, more convenient in the launcherappstate inside, configuration can be.Can be single or double-layer switching.public static Boolean Isdisableallapps () {Returns false on Non-dogfood builds.Return getinstance (). Mbuildinfo.isdogfoodbuild () Launcher.ispropertyenabled (Launcher.disable_all_apps_property);}(one)
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.