This article is a ramble about how we can build a good architecture in the early stages of Android development when the project is initialized.About the Android architecture, because of the limitations of the mobile phone, I do not think there is really much to talk about, but from the perspective of development, see neat code, graceful layering is always a comfortable enjoyment.From the artistic point of v
status and network status of the battery before making the overall update, and wait for the best state for a large-scale reload operation;Let the user see electricity situation, such as update cycle, background operation;Implementing a low memory footprint UI9. Find the layout display problemWhen we create a UI for the layout alone, we create an app that abuses memory
package name you need to test, others can increase or decrease the monkey parameter.
②, example: adb shell monkey-p%packagename%-S%c_time%--throttle 10000--ignore-crashes-v-v-v
③, Monkey here do not do too much explanation, online has a lot of monkey test strategy Introduction. BAT in other related methods of operation of the script basically have annotations and explanations, I believe you can understand.
B, configuration files
About the Android app optimization, from the beginning of the first plan, to the end of the series of memory optimization, unknowingly nearly three months of time, wrote 66 related blog post, is a systematic knowledge of their own, but also hope to give you some help.Here is a summary of this.RouteAndroid App Optimizer
android.content.res.Resources.loadDrawableForCookie(Resources.java:2580)at android.content.res.Resources.loadDrawable(Resources.java:2487)at android.content.res.Resources.getDrawable(Resources.java:814)at android.content.res.Resources.getDrawable(Resources.java:767)at com.nostra13.universalimageloader.core.DisplayImageOptions.getImageOnLoading(DisplayImageOptions.java:134)What? What does that mean? Is my bitmap (bitmap) too big?Unfortunately, this kind of stack trace tends to be a bit confusing
Power Management Powermanagerpowermanager is a power management class for Android that manages power operations such as sleep, wake, restart, and adjust screen brightness.The PowerManager object is obtained from the system service Power_service, and its main methods are as follows:Gotosleep: Sleep, that is, lock screen.WakeUp: Wake up, that is, unlock.Reboot: Restart.There are several other hidden methods:Getminimumscreenbrightnesssetting: Gets the mi
a style;
-- Dimen label: represents a size;
3. Classified resource files:
If you put all the resources in an XML file, it will increase the maintenance difficulty. Here, you can put different types of resources under different XML files;
-- Arrays. xml: stores array resources;
-- Colors. xml: stores color resources;
-- Dimens. xml: stores size value resources;
-- Strings. xml: stores string resources;
-- Styles. xml: stores style resources;
Ii. U
Memory leaks are frequently encountered in Android development, and the Android system has a certain memory limit for individual apps, which can be obtained by:ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);int memoryClass = am.getMemoryClass();The Momeryclass value in the above code c
have been entangled in this issue for some time. I have searched a lot of information on the Internet and even checked Android issues. I have indeed seen problems such as issue 3405 and issue 8488, in particular, the reply from issue 8488 on the first floor made me feel so thunderous:
Comment 1 by Romain... @ Android.com, May 23,201 0
Your app needs to use less
Note: This blog post is reproduced in Http://my.oschina.net/mengshuai/blog/541314?fromerr=z8tDxWUHThis article describes the author of the article in the development of Android applications for several years, experienced 2 architectural changes, the first integration of the Rxjava second integration of the MVP, and the Rxjava with the MVP perfect combination, achieve a low-coupling, code simple, testing a convenient architecture.In fact, we also encou
About the Android architecture, because of the limitations of the mobile phone, I do not think there is really much to talk about, but from the perspective of development, see neat code, graceful layering is always a comfortable enjoyment.From the artistic point of view, we are actually pursuing a kind of beauty.This article analyzes several of today's more popular Android software packages , and finally we
the same time can improve performance is not constrained by memory, what Ida what Elf and other tools can not easily look at the code, so it became the best policy. But I think your jni once by others attack, then congratulate you so, I directly to use!!Before cracked a one of the top anti-virus software, its code confusion is high, the key code is used so, but this JNI interface information is I find out, with these interfaces, your so is my, I can
well-performing value) so that the Android system can read the file using the Mmap () function (see the purpose of the function itself) to get higher performance on read resources ,Ps:1. Alignment on a 4-byte boundary means that, in general, the compiler bar 4 bytes are read as a unit, so that the CPU can access the variable efficiently and quickly (not before).2. The root cause of alignment: The Davlik virtual machine in the
This article is based on a summary of the most recent internal sharing, no time for detailed collation, forgive me.
This share mainly on the memory leaks and thread safety of the two issues are described, internal code scan found the bug roughly divided into four categories: 1) null pointer; 2) memory, resource disclosure, 4) thread safety. The first to second problem is poorly coded, and the third to
the number of object creation is reduced, here isHashSetand LongArraySet Add 1000 item comparison results in 20 cycles.LongArraySetIt's good to avoid creating Long objects, which reduces memory allocations by 30% in this scenario.ConclusionBy digging deeper into other data structures, we are able to create a more appropriate structure for ourselves. The fewer times a garbage collection runs, the less it takes to drop frames. The use of new data struc
others Dex risk is too big, many people have turned to use native code to write the key code, feel so bad to crack at the same time can improve performance is not constrained by memory, what Ida what Elf and other tools can not easily look at the code, so it became the best policy. But I think your jni once by others attack, then congratulate you so, I directly to use!! Before cracked a one of the top anti-virus software, its code confusion is h
Memory reclaim policy in Android operating system, android reclaim
Memory collection in the Android operating system can be divided into two levels: 1. Default memory collection, that is, the default collection at the Application
Since Google released Android studio in 2013, Android studio has been replacing eclipse with its own good memory optimizations, cool UI themes, powerful auto-completion hints, and Gradle compiler support. Become the mainstream Android development IDE. Android Studio provides
One, Android application memory optimization
In the process of developing Android apps, there are often memory pressures, such as oom, or frequent GC. This article is not intended to cover all aspects of memory optimization, just to introduce myself to the problems and solu
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.