public class EspCameraStub
extends java.lang.Object
Stubbing camera picture request with MediaStore.ACTION_IMAGE_CAPTURE.
Typical application starts the camera app and use the reported Uri to access new picture by ContentResolver. With this stubs you can avoid the start of the camera app and let them report your preferred picture Uri. But you must provide the picture on your phone by self.
Example usage:
// provide a test picture
Uri pictureUri = EspFilesTool.copyFileFromAssetsToExternalCacheDir("picture_from_assets.jpg", "camera_picture.jpg"
// register stub with your test picture uri
EspCameraStub.register(pictureUri);
// now perform action to start camera picture request
Base description for intent mocking.| Constructor and Description |
|---|
EspCameraStub() |
| Modifier and Type | Method and Description |
|---|---|
static void |
register(android.net.Uri pictureLocation)
Register new stub for camera picture requests with
Activity.RESULT_OK. |