Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# JankTest\n\nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nJankTest\n========\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\n\n\nabstract\n@interface\nJankTest\n`\n\n\n`\n\n\nimplements\n\n`[Annotation](https://developer.android.com/reference/java/lang/annotation/Annotation.html)`\n\n\n`\n\n|------------------------------------|\n| android.support.test.jank.JankTest |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nAnnotation used to configure a jank test method.\n\nSummary\n-------\n\n| ### Public methods ||\n|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` `[String](https://developer.android.com/reference/java/lang/String.html) | ` `[afterLoop](/reference/android/support/test/jank/JankTest#afterLoop())`() ` Alternate method to execute after each iteration Note: the annotated method must have same signature as [afterLoop()](/reference/android/support/test/jank/JankTestBase#afterLoop()) |\n| ` `[String](https://developer.android.com/reference/java/lang/String.html) | ` `[afterTest](/reference/android/support/test/jank/JankTest#afterTest())`() ` Alternate method to execute after all iterations have completed. |\n| ` `[String](https://developer.android.com/reference/java/lang/String.html) | ` `[beforeLoop](/reference/android/support/test/jank/JankTest#beforeLoop())`() ` Alternate method to execute before each iteration Note: the annotated method must have same signature as [beforeLoop()](/reference/android/support/test/jank/JankTestBase#beforeLoop()) |\n| ` `[String](https://developer.android.com/reference/java/lang/String.html) | ` `[beforeTest](/reference/android/support/test/jank/JankTest#beforeTest())`() ` Alternate method to execute before the test method Note: the annotated method must have same signature as [beforeTest()](/reference/android/support/test/jank/JankTestBase#beforeTest()) |\n| ` int` | ` `[defaultIterationCount](/reference/android/support/test/jank/JankTest#defaultIterationCount())`() ` Default iteration count to run if not specified by command line |\n| ` int` | ` `[expectedFrames](/reference/android/support/test/jank/JankTest#expectedFrames())`() ` The minimum number of frames expected |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[java.lang.annotation.Annotation](https://developer.android.com/reference/java/lang/annotation/Annotation.html)` ` |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` abstract `[Class](https://developer.android.com/reference/java/lang/Class.html)`\u003c? extends `[Annotation](https://developer.android.com/reference/java/lang/annotation/Annotation.html)`\u003e` | ` annotationType() ` | | ` abstract boolean` | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` abstract int` | ` hashCode() ` | | ` abstract `[String](https://developer.android.com/reference/java/lang/String.html) | ` toString() ` | ||\n\nPublic methods\n--------------\n\n### afterLoop\n\n```\nString afterLoop ()\n```\n\nAlternate method to execute after each iteration\n\n\nNote: the annotated method must have same signature as [afterLoop()](/reference/android/support/test/jank/JankTestBase#afterLoop())\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------------------------------|--------|\n| [String](https://developer.android.com/reference/java/lang/String.html) | \u003cbr /\u003e |\n\n### afterTest\n\n```\nString afterTest ()\n```\n\nAlternate method to execute after all iterations have completed.\n\n\n**Important:** the annotated method must take a parameter of type\n[Bundle](https://developer.android.com/reference/android/os/Bundle.html).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------------------------------|--------|\n| [String](https://developer.android.com/reference/java/lang/String.html) | \u003cbr /\u003e |\n\n**See also:**\n\n- [afterTest(android.os.Bundle)](/reference/android/support/test/jank/JankTestBase#afterTest(android.os.Bundle)) \n\n### beforeLoop\n\n```\nString beforeLoop ()\n```\n\nAlternate method to execute before each iteration\n\n\nNote: the annotated method must have same signature as [beforeLoop()](/reference/android/support/test/jank/JankTestBase#beforeLoop())\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------------------------------|--------|\n| [String](https://developer.android.com/reference/java/lang/String.html) | \u003cbr /\u003e |\n\n### beforeTest\n\n```\nString beforeTest ()\n```\n\nAlternate method to execute before the test method\n\n\nNote: the annotated method must have same signature as [beforeTest()](/reference/android/support/test/jank/JankTestBase#beforeTest())\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------------------------------|--------|\n| [String](https://developer.android.com/reference/java/lang/String.html) | \u003cbr /\u003e |\n\n### defaultIterationCount\n\n```\nint defaultIterationCount ()\n```\n\nDefault iteration count to run if not specified by command line\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### expectedFrames\n\n```\nint expectedFrames ()\n```\n\nThe minimum number of frames expected\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n-\n\n Annotations\n -----------\n\n - [GfxMonitor](/reference/android/support/test/jank/GfxMonitor)\n - [JankTest](/reference/android/support/test/jank/JankTest)\n-\n\n Classes\n -------\n\n - [JankTestBase](/reference/android/support/test/jank/JankTestBase)"]]