Skip to content

Most visited

Recently visited

navigation
Added in API level 1

android.test.mock

Utility classes providing stubs or mocks of various Android framework building blocks.

For more information, see the Testing guide.

Classes

MockApplication This class was deprecated in API level 24. Use a mocking framework like Mockito. New tests should be written using the Android Testing Support Library.  
MockContentProvider Mock implementation of ContentProvider. 
MockContentResolver

An extension of ContentResolver that is designed for testing. 

MockContext A mock Context class. 
MockCursor This class was deprecated in API level 24. Use a mocking framework like Mockito. New tests should be written using the Android Testing Support Library.  
MockDialogInterface This class was deprecated in API level 24. Use a mocking framework like Mockito. New tests should be written using the Android Testing Support Library.  
MockPackageManager This class was deprecated in API level 24. Use a mocking framework like Mockito. New tests should be written using the Android Testing Support Library.  
MockResources This class was deprecated in API level 24. Use a mocking framework like Mockito. New tests should be written using the Android Testing Support Library.  
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.