The most important root cause of performance problems that most users perceive as lag is because of rendering performance. From the designer's point of view, they want the app to have more animation, pictures and other fashion elements to achieve a smooth user experience. But the Android system is likely to be unable to complete those complex interface rendering operations in time. The
current task.
So, if we want to not let the system kill our app, we can optimize it from the process level, memory consumption and so on.
ConclusionThis article plus gc those things, we talked about two of theoretical knowledge, I believe you have a general understanding of the memory management of Android, the following will introduce some memory analysis tools and use, the actual to explain
Introduction
Background: Android app Optimizer, what to do?
Performance analysis tools for Android app optimization
Android App Optimizer's rationale for boosting your
which objects occupy a lot of memory can not be optimized, of course, can not analyze memory leaks ah, that depends on the heap and mat analysis.In fact, there is also a NB tool OpenGL Trace, this thing is commonly used to analyze OpenGL drawing I have not yet said.PS: Write about the time, inadvertently read a document on the great God: http://blog.csdn.net/innost/article/details/9008691, this shame Ah, said the same thing, that writing and thinking of the giant clear, It really helps the peop
pixels, the following is the design:Start menu with Start button and Exit buttonGame interface, change the background image and voice control button, Weibo share button, etc.Five, the team member contribution points:Although our team of six people, looks like a bit more. But compared to the amount of work we do, in fact, people are not much, here the contribution of the work according to everyone's workload, although everyone's ability is impeccable.
Sun Hailin: 23
the message, and update the information in the activityWhat kinds of Android life cycle do you have?1. foreground process. Such a process has an activity that is displayed on the screen and interacts with the user or one of its intentreciver is running. Such programs are of the highest importance, and only when the system is very low in memory will it end up as a last resort. 2. visible process. Programs that are displayed on the screen but are not
its own process when exiting the app. For the process management of the application itself, give it to the Android system to handle it. What the application needs to do is to try to do the memory management work of the program itself.
In general, if you can get a reference to a bitmap object, you need to call Bitmap's recycle () method in a timely manner to free up the memory space bitmap occupi
after the system boots and loads the code and resources of the generic framework. In order to start a new program process, the system will fork the zygote process to generate a new process and then load and run the application's code in the new process. This allows most of the RAM pages to be allocated to the framework's code, while allowing RAM resources to be shared across all processes in the app.
Most of the static data is mmapped into a proc
interface, but more than 1.41M!!! This is key.Next, let's find out where the leak happened. Click Dump Java Heap to generate the snapshot file Tool.test.memory.memoryleak_2016.11.13_21.38.hprof,android Studio automatically pops up hprof viewer to analyze it.Snapshot file analysis. pngNow introduce the usage of the Hprof Viewer
HPROF Viewer View modeThe upper-left corner of the two red boxes, is an optional list, is used to select the heap ar
Android Cold boot optimization 1. What is cold startCold start is the case when the application is first started or the application is killed (not in memory) and then started again.You may have noticed that the startup time will be slightly longer in this case. Because it will initialize the resource again (application, etc.).When the app starts, it usually initializes in application or so-called splashacti
Android Cold boot optimization 1. What is cold startCold start refers to the case where the application was first started or the application was killed (not in memory) after restarting.You may have found that the startup time will be slightly longer in this case. Because it will reinitialize resources (application, etc.).When the app starts, it usually initializes in application or so-called splashactivity.
IntroductionApp optimized memory optimization (order) as a small part of memory optimization in the app optimization series.Due to the relatively jerky memory-related knowledge, memory optimization used in the relevant tools, there are many proper nouns. There is a theoretical understanding of Java memory Management, GC, Android memory management, Dalvik/art and other knowledge that allows us to better use
resources in the application can be directly used, specific, you can go to the corresponding folder in ANDROID-SDK to see. For example: can enter the $android-sdk$\platforms\android-8\data\res, inside of system resources is sweeping.Developers need to spend some time familiarizing themselves with these resources, especially the picture resources and various styl
Usually when we use Key-value to store data, we can easily hit the HashMap code, when the amount of data is small, but also, when the number of times, if it is a PC, but also plausible, but if the use of mobile devices such as mobile device, this is to be cautious. Because the memory of the phone is very valuable, unlike the PC as reckless use, improper memory use can easily cause oom problems. The Android development team also found a substitute for
In the teacher's call, we do the painful code extraction, encapsulation, as long as the same, all to extract, encapsulation.Ninja World, has a legendary forbearance, even if it is not aware of the patient, he stood in front of you, but you can not see him, when you take lightly, he in your back to give you a fatal blow. He is invisibility. idea: for a title bar, an app to be used multiple times, we have to extract it separately, as an XML if an inter
be extracted.3) Bottom of the navigation bar. If the navigation bar is applied and most of the activity's bottom navigation bar is the same, the navigation bar can be written as a generic module.4) ListView. Most applications use the ListView to show multiple data. The ListView style may often be adjusted later in the project, so it is better to use the ListView as a common module.
Optimization Series related blog posts:Android Development Optimization--memory optimization for bitmap
to add, find, delete and so on, so, Scenario and Sparsearray, if the data volume is relatively large, then its performance will degrade at least 50%.Add datapublicputvalue)Get Datapublicget(Objectkey)Delete datapublic V remove(Objectkey)Unique methodsLike Sparsearray, it has two more convenient ways to get data:publickeyAt(int index)publicvalueAt(int index)Arraymap Application Scenarios
Small amount of data, preferably within thousand
Data structure type is map type
ArrayMapKe
Recently released on GOOGL play apk to optimizeThe Android SDK includes a "zipalign" tool that optimizes packaged applications. Run Zipalign on your application to make the interaction between Android and the application more efficient at run time. As a result, this approach allows applications and the entire system to run faster. We strongly recommend using the Zipalign tool on new and published programs t
replaced by the loaded view, and the View object is returned. This allows the application to get a reference to the load view without additional execution of Findviewbyid ().
Experience Sharing:The viewstub can be associated with the layout resource file specified in the XML file, allowing the layout resource file to be loaded again when it is needed. When and when to load, without having to load at the start of the boot. Doing so can speed up application startup and save memory
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.