Android performance testing using "android.test.PerformanceTestCase" interface
I am trying to test performance of an android application using "android.test.PerformanceTestCase" interface , can anyone tell me how to make use of it...
I know i can use Traceview tool to test performance but i want learn to use "android.test.PerformanceTestCase" interface provided by android.
If i get any example code it will be very much helpful
Asked by: Tess973 | Posted: 24-01-2022
Answer 1
Download the Android source code and look in frameworks/base/tests/AndroidTests/src/com/android/unit_tests
. You'll find a lot of PerformanceTestCase
examples.
Answer 2
I cloned the android source looking for the files suggested by Mirko's answer. The repository is very large and took me a while to clone. I searched it for all instances of PerformanceTestCase and found the following files which implement it:
/base/graphics/tests/graphicstests/src/android/graphics
/base/test-runner/src/android/test
/base/core/tests/coretests/src/android/app/activity
/base/core/tests/coretests/src/android/util
- /LogTest.java: public static class PerformanceTest extends TestCase implements PerformanceTestCase {
/base/core/tests/coretests/src/android/database
- /CursorWindowTest.java:public class CursorWindowTest extends TestCase implements PerformanceTestCase {
- /DatabasePerformanceTests.java: public static class ContactReadingTest1 implements TestCase, PerformanceTestCase {
- /DatabaseStatementTest.java:public class DatabaseStatementTest extends AndroidTestCase implements PerformanceTestCase {
- /DatabaseGeneralTest.java:public class DatabaseGeneralTest extends AndroidTestCase implements PerformanceTestCase {
- /NewDatabasePerformanceTests.java: implements PerformanceTestCase {
- /DatabaseCursorTest.java:public class DatabaseCursorTest extends AndroidTestCase implements PerformanceTestCase {
/base/core/tests/coretests/src/android/view
- /CreateViewTest.java:public class CreateViewTest extends AndroidTestCase implements PerformanceTestCase {
- /InflateTest.java:public class InflateTest extends AndroidTestCase implements PerformanceTestCase {
Note that incase some of these change or are moved in the future, the commit hash I searched today was ce7dba6bdf2345f39ad8f39b8a4c1bac9bcd35ea
Answered by: Oliver799 | Posted: 25-02-2022Similar questions
Still can't find your answer? Check out these communities...
Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android