类似的Android应用程序可以以截然不同的方式设计. Depending on the approach taken, 看起来相同的应用会消耗不同数量的智能手机资源. 在Android操作系统下工作的应用程序可以消耗不同数量的内存或CPU时间. 它们会以不同的方式影响电池寿命,或者通过网络下载或多或少的数据. 总的来说,所有这些参数都会影响你的android应用程序的外观和性能. 这就是高质量应用与普通应用的区别所在.

There are about 3.5 mln apps in Google Play Store. 用户有选择,你需要他们选择你的应用. To avoid the nightmare of every product owner, namely, 用户在Android操作系统上卸载应用程序的情况, performance testing is crucial. It should be started when designing the application, continued when writing the code, and ran before every new release. Android应用程序的一些性能推荐几个网赌网站方法是在操作系统中构建的, while others are available on the web. In this article, 推荐几个网赌网址列出了这两种类型,以便开发者能够不时地推荐几个网赌网站应用程序.

Table of Contents

Want to test your app?

Drop us a line to find out what our team can do for you.

1. Application Profiler in Android Studio

The profiler built into Android Studio 允许您跟踪应用程序的所有主要性能指标, such as memory, CPU, network usage, and energy consumption.


2. Monitoring CPU usage

Does the app freeze when switching between screens? 还是当你按下按钮时,它需要很长时间来回应? 如果是这样,您的处理器目前可能超载.


    • Go to CPU profiler in Android Studio
    • Press the Record button
    • Execute actions that cause the program to freeze
    • Stop recording

Android Studio将显示哪些方法被执行了多长时间. 这样,您就能够找到应用程序的瓶颈.

Don’t want to run tests by yourself?

Leave it to us. We are ready to do our best to increase your app growth?

3. Looking for memory leaks in the application

In Android Studio Profiler, 在主动使用应用程序时,您可以注意到这一点, the Memory graph can sometimes be constantly growing.

This may mean a memory leak in your app. Android Studio允许你查看应用程序运行时创建了哪些对象. Thus, 通过重复导致内存泄漏的操作, 您可以找出影响性能的对象类型.

Memory leaks in Android < 8.0

In devices running Android OS versions lower than 8.0, you need to launch the Allocation Tracker. 它还提供数据可视化工具,帮助您识别分配最多内存的最坏的罪魁祸首. First, you need to collect a data set to view.

1. 打开Android Studio底部的Android Monitor

2. Open the Memory tab

3. Click Start Memory Tracking

4. 在要记录的应用程序上执行导致泄漏的操作

5. Stop Memory Tracking


Memory leaks in Android >= 8.0

If you are using a device with Android 8+ on board, the process is almost the same as described above, but the allocation tracker is always enabled by default. 只要在图上选择你想要探索的区域,你就会看到在这个间隔内创建的对象.

Leak Canary

泄漏金丝雀是嵌入在应用程序中的内存泄漏检测库. At the debugging stage, 它会自动启动监控,以确保活动和片段不会泄漏内存. 在Android操作系统中,上下文泄漏是最令人不快的问题之一.



Best practices for website performance case study

4. Monitoring data usage over the network

你的Android应用程序是否积极地与后台通信? You can use the built-in Android studio profiler. 应用程序是否在某些时候使用网络太频繁了? 记录对网络的访问并查看应用程序的去向.

此外,不要忘记不仅是性能,还有用户和用户体验. 例如,当连接消失时,最好告诉您的用户它.

5. Android testing tools

Even if the application works perfectly on your device, 不能保证同样的事情会发生在用户身上. 有许多解决方案可以让你为最终用户监控Android应用程序的性能:

    • Firebase Performance Monitoring tool
    • Dynatrace Mobile App Monitoring tool
    • New Relic Mobile tool

For basic purposes, a solution from Firebase is suitable: it is free, 而且Firebase很可能已经连接到你的项目.

Looking for performance and load testing provider?

Drop us a line. 在之前的300个项目中,推荐几个网赌网址很可能已经处理过类似您的问题.

6. Testing UI performance

Profiling GPU rendering

屏幕内容的呈现有一个基线:每帧16毫秒. 为了使总帧率达到60帧/秒的舒适速度,大概需要这么多.

In order to check the rendering speed of your interface, it is not necessary to place logs everywhere. Android has standard methods for measuring UI performance. 你可以在你手机的开发者设置中启用它:你需要的选项是 “Profile GPU rendering” or “Profile HWUI rendering”. For a visual representation, select On screen as bars. 绿线以下的所有内容都符合16毫秒的限制.

How to Improve Android app Performance measure

Optimizing layout

推荐几个网赌网址重新绘制相同像素的次数越多,性能就越差? 当布局中嵌入的组和元素太多时,就会出现这种情况. For example, first, the background is drawn, then the background of the card on top of it, then the element itself. 透支有时是不可避免的,但必须保持在最低限度. The more elements — the worse.

You can view the overlays by enabling Debug GPU Overdraw in the developer options on the device.

Go to Settings -> Developer Options -> Debug GPU overdraw -> Show overdraw areas. 一旦启用它,屏幕就会开始显示颜色,不要担心这是预期的行为.

How to Improve Android app Performance measure

上面列出的这些简单步骤将帮助您了解Android应用程序中的性能问题. To deal with them, read our article on the types of testing services for mobile app owners<, or request a free demo.

推荐几个网赌网址400多名工程师中的一些人将乐于分享他们在移动应用的性能和负载推荐几个网赌网站方面的经验,帮助你让你的终端用户满意. 自2008年以来,他们至少帮助了推荐几个网赌网址300多个企业客户.


Share this post!

Latest posts from us

How to Improve Android app Performance measure
Application Performance Monitoring vs Crash Reporting
Application Performance Monitoring vs Crash Reporting
10 Steps to SAP Performance Testing
10 Steps to SAP Performance Testing
How to speed up a WordPress Website
How to Speed Up a WordPress Website – Part 2
SAP Load and Performance Testing using Loadrunner
SAP Load and Performance Testing Using Loadrunner