When it comes to developing an Android system, there are times when you encounter a need to:Because it is an independent brand, also involves a service in the push, so hope launcher can be fixed, third party can install, but press the home key, must return the system default launcherThrough the analysis of the home key process, found that can be very simple to do, and now share with you:Path: Frameworks\bas
1, please modify the Hotseat_cell_height value in Alps/packages/apps/launcher2/res/values/dimens.xml, for example, change to 100;2, please modify the Alps/packages/apps/launcher2/src/com/android/launcher2/hotseat.java in the Resetlayout () method, the main menu icon to add title, For example: Add Allappsbutton.settext ("Allappsbutton_title");3, please modify the Alps/packages/apps/launcher2/src/com/android/
To run a command to create a desktop file:sudo gedit/usr/share/applications/android_studio.desktopOpen the window and enter the following, noting that exec and icon are modified to the path of Android studio under their own system.[Desktop Entry]Type=applicationName=android StudioExec= "/opt/android-studio/bin/studio.sh"%fIcon=/opt/
(Intent.extra_shortcut_intent,new Intent ( This,mainactivity.class)); Setresult (result_ok,returnintent); Finish ();}}}3. The above shortcut can only be added manually, if you want to add shortcut dynamically, you must send the broadcast. Android Launcher2 Source provides the followingThis also means that we send the broadcast must declare the permissions, as well as the designation Also in code calls (also, dynamic addition of shortcut must specify
Android Launcher icon box-added to optimize display effect, androidlauncher
Read the code and explain it. Mainly used for image processing
PorterDuff. Mode. SRC_ATOPSRC_ATOP
The source pixel and target pixel are mixed to make the upper-layer graph display in the center to achieve the framed effect.
Package com. ferris. launchericonutils; import android. app. act
A shortcut icon consists of two parts: the application icon and the Application name. In fact, the shortcut icon in launcher only inherits the textview control and re-draws it to make the background light gray (I don't know what the color is) the elliptical background, the displayed text color is white. Textview has the Android: drawabletop; drawablebottom (not all of them are written here) attribute to dis
Android Metro-style Launcher development series 2, androidmetro
Preface:Dear friends, please forgive me for writing this series of second blogs after so long, so I cannot publish new products. If you don't talk nonsense, let's review them first: posted on my previous blog!
Launcher main framework implementation:The Launcher
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
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
(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
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.