How to check the performance of an Android application?

How to check the application for performance in Android? What is Android support and how to use it?

+70
performance android testing
Dec 24 '09 at 6:59
source share
5 answers

If you want to profile an application to find performance bottlenecks, you can use the traceview tool . This gives you a graphical representation of the performance traces of your application.

12.24.2009-08.57.51.png

To create a trace, add the following to the code where you want to start the trace:

 Debug.startMethodTracing("myapp"); 

and then put the following when you want to stop tracing:

 Debug.stopMethodTracing(); 

This will create a trace to the myapp.trace trace myapp.trace in the root directory of the SD card. As it is written to the SD card:

  • If you are using an emulator, you need to add an SD card to your AVD .
  • You need to grant permission to use the SD card by adding the following to your manifest:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

After creating the file, you will need to copy it to your computer. You can do this using adb command:

 adb pull /sdcard/myapp.trace c:/my/dir/myapp.trace 

Finally, run traceview , specifying the full path in the trace file:

 traceview c:/my/dir/myapp.trace 

I had some problems with traceview with OutOfMemory errors. I fixed this on Windows by changing the last line of traceview.bat to:

 call java -Djava.ext.dirs=%javaextdirs% -Dcom.android.traceview.toolsdir= -jar %jarpath% %* 

at

 call java -Xmx1g -Djava.ext.dirs=%javaextdirs% -Dcom.android.traceview.toolsdir= -jar %jarpath% %* 

Adding the -Xmx1g option allows traceview use more memory.

+94
Dec 24 '09 at 8:49
source share

In addition, in theory, DDMS can receive memory allocation for your program, and then you can analyze the dump using profilers. DDMS reference.
The reason I'm theoretically in italics is because I myself haven’t tried to do anything like that yet.

+4
Dec 24 '09 at 10:13
source share

I think traceView contains too much information, you can easily get lost.

My solution is to simply register the system time in three places in the code.

Before and after and in the center on a potency slow code.

like a binary search, next time, narrow it down step by step, then finally find the culprit code.

+2
Jul 25 2018-12-12T00:
source share

you can use load runner.,

use this link to find a more suitable one.,

http://www.perftesting.co.uk/recording-and-performance-testing-android-applications-with-hp-loadrunner-vugen/2011/11/14/

The steps to be followed are as follows:

  • Create New VuGen Script
  • Select Mobile Application-HTTP / HTML
  • Recording Options β†’ Selecting a recording emulator
  • Give the path to write the emulator as D: \ android \ AVD Manager.exe
  • At the command line -avd AVD_NAME -netspeed full -netdelay none where AVD_Name is the name of your device
  • select working directory
  • click finish button

Now you can run your test.,

0
Mar 23 '16 at 10:49
source share

Another test method is using TruClient on Load Runner.

Steps for Mobile Web:

  • New VuGen Script
  • Mobile protocol
  • Choose TruClient Mobile Web
  • Click Create
  • Now you can create scripts
  • Click Create Script
  • The PoP up window will appear to select the device.
  • Select "Actions" and you can record scripts

Steps for Native Mobile:

  • New VuGen Script
  • Mobile protocol
  • Choose TruClient Native Mobile
  • Click Create
  • Now you can create scripts
  • click <expand script
  • A TruClient window connected to Firefox appears.
  • Click General Settings
  • Configure Server URL
  • If you do not know that the server url port means installing the OS MONITOR application on your device. here you can find the IP address
  • Enter username and password
  • Clicked

you can write scripts and do testing ....

0
Mar 23 '16 at 11:01
source share



All Articles