Configure Android image injection Enable image injection for Android apps using automated instrumentation or the Kobiton image injection SDK. Choose an image injection method Kobiton supports two methods for Android image injection: automated instrumentation SDK integration Use automated instrumentation when you want to enable image injection without modifying your app code. Use the Kobiton SDK when your app requires compatibility with Google Play Services, push notifications, tamper detection, or other signing-sensitive functionality. API or library Automated instrumentation Kobiton SDK Camera2 Yes Yes Camera1 Yes No ACTION_IMAGE_CAPTURE intent Yes No CameraX Not officially supported Not officially supported Use automated instrumentation When installing an Android app on a Kobiton device, enable Instrument application for camera injection to use automated image injection instrumentation for supported libraries and methods. Automated instrumentation is the simpler setup option because it does not require app code changes. However, instrumentation modifies the application binary, which may affect apps that rely on signing validation or tamper detection. Automated instrumentation may not be compatible with apps that use Google Play Services, push notifications, tamper detection, or signing-sensitive functionality. Use the Kobiton SDK Use the Kobiton SDK to integrate image injection directly into your Android app without automated instrumentation. The Kobiton SDK requires additional integration work, but provides greater compatibility for apps that rely on signing-sensitive functionality. Prerequisites Android 9 or newer. An Android project with Gradle build tool. The application uses camera2 library. See the full list of supported methods in camera2. Download the Image Injection SDK file (camera2.aar) here. Camera1, Camera2, and CameraX refer to Android camera APIs and libraries, not physical device cameras. Integrate the Kobiton SDK Create a new folder named libs under <project_folder>/app, where <project_folder> is the root folder of the Android project to be altered. Copy the downloaded camera2.aar file into the newly created folder. Under <project_folder>/app, edit the build.gradle file and add the following line under dependencies to allow your application to use the .aar file: implementation fileTree(dir: 'libs', include: ['*.aar']) Under <project_folder>/app/src/main, edit the AndroidManifest.xml file and add the following lines within the application tag. This service is used to connect the SDK to Kobiton Server. <service android:name="kobiton.hardware.camera2.ImageInjectionClient" /> Within the same AndroidManifest.xml file as above, add the following lines within the manifest tag to grant the 2 permissions INTERNET and ACCESS_NETWORK_STATE for the SDK to connect to Kobiton’s Server. <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> Replace all texts in the project according to the below table to replace the stock Android library with the custom Kobiton library: Replace With android.hardware.camera2.CameraCaptureSession kobiton.hardware.camera2.CameraCaptureSession android.hardware.camera2.CameraDevice kobiton.hardware.camera2.CameraDevice android.hardware.camera2.CameraManager kobiton.hardware.camera2.CameraManager android.hardware.camera2.CaptureRequest kobiton.hardware.camera2.CaptureRequest android.hardware.camera2.params.SessionConfiguration kobiton.hardware.camera2.params.SessionConfiguration android.media.ImageReader kobiton.media.ImageReader Update the CameraManager’s initial method by replacing Context.getSystemService(Context.CAMERA_SERVICE) with CameraManager.getInstance(context). For example, replace: private val cameraManager: CameraManager by lazy { val context = requireContext().applicationContext context.getSystemService(Context.CAMERA_SERVICE) as CameraManager } with private val cameraManager: CameraManager by lazy { CameraManager.getInstance(requireContext().applicationContext) } After all the above changes are made, package your app into an .apk, .aab or .zip file. Upload the app package to the app repository or to the cloud and install the app on a Kobiton device, then follow the guides to use image injection in a manual session or an automation session.