5 Ways to Increase/Boost Your Mobile Application Performance
Application performance is the measurement of the real-world performance & availability of applications. It is a good indicator of the level of service that a provider is offering and is one of the top monitored IT metrics.
In this Blog, you gonna learn how to optimize the App Speed, App Size, battery usage and so on.
- Use R8 before publishing the App
Find your Apps Bottlenecks
Cache Whenever Possible
Get rid of Memory Leaks
Optimize Networking
Use R8 before publishing the App:
R8 is the tool to optimize your code before a release build and its basically does three major things to make your Apk Smaller also it has a side effect that it makes it harder to reverse engineering but we are talking about making it smaller.
It renames all your classes, functions and all your fields to short unreadable names so which of course makes your file smaller because the names are shorter and in your release build you don't need to read your code so that's totally fine if someone comes over and reverse engineers your app they will get only unreadable names so that's one of the side effects. It also comes with the big benefit that it just removes unused classes and unused functions.
Now, why do we need to remove unused classes and unused functions?
If we use big libraries that add 10 Mb of Size to your APK but only use two functions of the library then what R8 will do before releasing so for your release build basically it will throw all the parts of that 10 MB library that your App doesn't need and will only keep these classes with the 2 functions that you actually using in your app which will drastically decrease your App Size. It actually just removes unused resources like unused Strings, Images and so on.
How to Enable R8 in your App?
buildTypes{
release{
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFiles(
'proguard-android-optimize.txt'
),'proguard-rules.pro'
}
}
Find your Apps Bottlenecks
For Example:
Cache Whenever Possible
Get rid of Memory Leaks
Optimize your App's memory consumption that is before you release your app always make sure that your app doesn't have any major memory leaks a memory leak happens when the garbage collector basically doesn't collect an object of your code that is not needed anymore so that's often cause in combination with android components such as activities or so that have a life cycle in combination.
When it comes to memory, it usually refers to physical memory. When the same application runs on different machines or operating systems, the size of the allocated physical memory varies depending on the operating system and hardware conditions.
Generally, the virtual memory used by an application is roughly the same. The memory discussed in this article is virtual memory. All objects operated in the code can be measured by virtual memory without focusing on if the object exists in physical memory or not. It is considered ideal when the objects consume less memory.
Comments
Post a Comment