{"id":20444852,"url":"https://github.com/snapchat/camera-kit-android-sdk","last_synced_at":"2026-03-13T00:02:27.017Z","repository":{"id":262690555,"uuid":"879865495","full_name":"Snapchat/camera-kit-android-sdk","owner":"Snapchat","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-06T23:04:59.000Z","size":43017,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-07T00:18:31.946Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Snapchat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-28T17:22:30.000Z","updated_at":"2025-02-06T23:01:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"a94587a4-6a4f-423f-9500-a346dfc34afd","html_url":"https://github.com/Snapchat/camera-kit-android-sdk","commit_stats":null,"previous_names":["snapchat/camera-kit-android-sdk"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snapchat%2Fcamera-kit-android-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snapchat%2Fcamera-kit-android-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snapchat%2Fcamera-kit-android-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snapchat%2Fcamera-kit-android-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Snapchat","download_url":"https://codeload.github.com/Snapchat/camera-kit-android-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241992846,"owners_count":20054410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T10:09:24.410Z","updated_at":"2026-03-13T00:02:27.005Z","avatar_url":"https://github.com/Snapchat.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![camerakit_icon](https://github.com/user-attachments/assets/d16b846d-0b4f-48da-bc18-6a40ddc3cb26)\n\n# Camera Kit for Android\n\n[Home Page](https://developers.snap.com/camera-kit/home) | [Documentation \u0026 Guides](https://developers.snap.com/camera-kit/getting-started/what-is-camera-kit) | [Showcase](https://ar.snap.com/camera-kit) | [API Reference](https://kit.snapchat.com/reference/CameraKit/android/1.47.0/index.html) | [Developer Portal](https://kit.snapchat.com/manage/) | [My Lenses](https://my-lenses.snapchat.com/) | [Discord](https://discord.gg/snapar)\n\u003c/div\u003e\n\nCamera Kit brings the power of Snap's AR platform to your websites and mobile apps on iOS and Android. It has never been easier to create and deliver scalable, multi-platform AR experiences to meet your customers, wherever they are.\n\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"https://github.com/user-attachments/assets/c7a6e407-ee76-4dd6-b174-4ac03f641131\" width=\"9%\" alt=\"distort\" /\u003e\n \u003cimg src=\"https://github.com/user-attachments/assets/8285ec1d-8b3a-4d1d-a7d2-db62b16d7ee3\" width=\"9%\" alt=\"hair_simulation\" /\u003e \n \u003cimg src=\"https://github.com/user-attachments/assets/8530eb66-567c-4432-958d-15285d50d6cb\" width=\"9%\" alt=\"chane_physics\" /\u003e\n \u003cimg src=\"https://github.com/user-attachments/assets/4af949f9-9426-413d-8011-0292278106ea\" width=\"9%\" alt=\"try_on\" /\u003e\n \u003cimg src=\"https://github.com/user-attachments/assets/b79dff9b-34cd-4949-8c8f-fa46399d5351\" width=\"9%\" alt=\"3d_hand_tracking\" /\u003e \n \u003cimg src=\"https://github.com/user-attachments/assets/ff32ab27-e48d-4aed-aa1a-8f46726e5b0b\" width=\"9%\" alt=\"wrist_wear_try_on\" /\u003e\n \u003cimg src=\"https://github.com/user-attachments/assets/dff811af-b7b4-4e86-be28-d149b4860e5b\" width=\"9%\" alt=\"eye_wear_try_on\" /\u003e\n \u003cimg src=\"https://github.com/user-attachments/assets/6005c5ed-ad31-45c6-8fad-90a388724ec0\" width=\"9%\" alt=\"true_size_object\" /\u003e   \n \u003cimg src=\"https://github.com/user-attachments/assets/2ed8522c-280a-4694-bc3e-79ce450fb0a0\" width=\"9%\" aly=\"vfx\"\u003e\n \u003cimg src=\"https://github.com/user-attachments/assets/c4097e49-855f-4c94-8a35-2753f7bcbd83\" width=\"9%\" alt=\"landmarkers\" /\u003e\n\u003c/p\u003e\n\n## Features\n\n### AR Capabilities\n- Face Effects\n- Body / Face / Hand Tracking\n- World Tracking\n- Background Segmentation\n- Location AR\n- and [many more](https://developers.snap.com/camera-kit/ar-content/ar-overview) \n\n### Android SDK\n- Integrate with Camera Kit com.snap.camerakit.Session, which allows to maintain full control over session configuration, management, and lifecycle\n- Fetch and display your lenses\n- Capture media\n- Leverage Reference UI modules to quickly build Camera Kit based experiences\n- Supports Android 5.0+ and SDK 21+\n\n## Integration Steps\n1. [Setup](https://developers.snap.com/camera-kit/getting-started/setting-up-accounts) your Camera Kit application using [Developer Portal](https://kit.snapchat.com/manage)\n2. [Integrate](https://developers.snap.com/camera-kit/integrate-sdk/mobile/android) Camera Kit SDK into your Android application\n3. [Create](https://developers.snap.com/camera-kit/ar-content/build-lenses) AR experiences using [Lens Studio](https://ar.snap.com/lens-studio) and manage them using [My Lenses](https://my-lenses.snapchat.com/) site\n\n### Configuration\n\nAll of the Camera Kit artifacts are published under a single version and it is possible to pick and choose the dependencies necessary for your specific project:\n\n```groovy\n    implementation \"com.snap.camerakit:camerakit:$cameraKitVersion\"\n    implementation \"com.snap.camerakit:lenses-bundle:$cameraKitVersion\"\n    implementation \"com.snap.camerakit:support-camerax:$cameraKitVersion\"\n```\n\nIn order for Camera Kit to be able to communicate with remote services to get content such as lenses, app needs to provide Camera Kit its unique \"API token\", this can be found at [Snap Developer Portal](https://devportal.snap.com/manage/). The easiest way to do this is to define the token within the app's [AndroidManifest.xml](./Samples/camerakit-sample-basic/src/main/AndroidManifest.xml):\n\n```xml\n\u003capplication\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\"\u003e\n     \n        \u003cmeta-data android:name=\"com.snap.camerakit.api.token\" android:value=\"REPLACE-THIS-WITH-YOUR-OWN-APP-SPECIFIC-VALUE\" /\u003e\n\n\u003c/application\u003e\n```\n\nCamera Kit is built targeting Java8 bytecode which requires enabling Java8 compatibility (desugar) support via Android Gradle Plugin (AGP) `compileOptions` for your app:\n\n```groovy\nandroid {\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n}\n```\n\n*For more information, see build configuration in `camerakit-sample-full` [build.gradle](./Samples/camerakit-sample-full/build.gradle).*\n\n## Usage\n\n### Initializing Image Processor and Preview\n\n```kotlin\n    import com.snap.camerakit.support.camerax.CameraXImageProcessorSource\n\n    var imageProcessorSource = CameraXImageProcessorSource(\n            context = this, lifecycleOwner = this\n    )\n\n    imageProcessorSource.startPreview(true) // true = front camera , false = back\n```\n\n### Initializing Camera Kit Session\n\n```kotlin\n    var cameraKitSession = Session(context = this) {\n        imageProcessorSource(imageProcessorSource)\n        attachTo(findViewById(R.id.camera_kit_stub))\n    }\n```\n\n### Applying AR Lens\nYou can find lens group IDs and specific lens IDs on [My Lenses](https://my-lenses.snapchat.com/) site\n```kotlin\n    cameraKitSession.apply {\n        lenses.repository.observe(\n            LensesComponent.Repository.QueryCriteria.ById(LENS_ID, LENS_GROUP_ID)\n        ) { result -\u003e\n            result.whenHasFirst { requestedLens -\u003e\n                lenses.processor.apply(requestedLens)\n            }\n        }\n    }\n```\n\n### Lifecycle\n\n`Session` instance is typically shared within a single Android application, service or activity lifecycle scope as `Session` is costly in terms of memory and cpu resources it requires to operate. Once done with a `Session`, It is **essential** to dispose it using `Session#close` method which releases all the acquired resources in Camera Kit safe manner. \n\n```kotlin\n    override fun onDestroy() {\n        cameraKitSession.close()\n        super.onDestroy()\n    }\n```\n\n### Samples\n\nThis project includes several sample apps that demonstrate different approaches to integrating the Camera Kit SDK:\n\n- [`camerakit-sample-basic`](./Samples/camerakit-sample-basic) demonstrates simplest and bare minimum \n    way to integrate Camera Kit.\n- [`camerakit-sample-compose-basic`](./Samples/camerakit-sample-compose-basic) demonstrates simplest and bare minimum \n    way to integrate Camera Kit via Jetpack Compose.\n- [`camerakit-sample-full`](./Samples/camerakit-sample-full) contains a fully functioning camera capture with lenses and preview flow.\n- [`camerakit-sample-custom-video`](./Samples/camerakit-sample-custom-video) demonstrates how to set up a custom video/audio encoding and audio source implementation.\n- [`camerakit-sample-custom-input`](./Samples/camerakit-sample-custom-input) demonstrates how to setup a custom input to the Camera Kit's processing pipeline.\n- [`camerakit-sample-simple`](./Samples/camerakit-sample-simple) demonstrates how to setup a simple, Camera Kit powered, camera capture flow via the standalone, batteries-included `CameraActivity`.\n- [`camerakit-sample-dynamic`](./Samples/camerakit-sample-dynamic) demonstrates how to dynamically load Camera Kit SDK as a dynamic feature module (DFM) as well as a standalone apk.\n- [`camerakit-sample-custom-carousel`](./Samples/camerakit-sample-custom-carousel) demonstrates how to provide your own carousel and preview screen to Camera Kit.\n\n## Development\n\n### Push To Device (P2D)\n\nApplications can receive lenses from Lens Studio using the P2D feature. See [P2D Integration](https://developers.snap.com/camera-kit/guides/mobile-customization/in-app-lens-testing).\n\n\n## Troubleshooting\n\nThe following is a list of common issues and suggestions on how to troubleshoot them when integrating Camera Kit into your own app.\n\n### Camera preview is black\n\n- Check that your device is supported by Camera Kit using `Sessions#supported` method. The minimum OpenGLES version that Camera Kit supports is 3.0.\n- Check that a camera based `Source\u003cImageProcessor\u003e` such as `CameraXImageProcessorSource` is provided to the `Session.Builder`. If you cannot provide an implementation of `Source\u003cImageProcessor\u003e` then make sure to connect a `SurfaceTexture` based input to the current `Session.processor`.\n- If no `ViewStub` is provided to the `Session.Builder` then Camera Kit does not attempt to render any views such as lenses carousel as well as camera preview. To see camera preview without any other Camera Kit views, a `TextureView`, `SurfaceTexture` or `Surface` based output must be connected to the current `Session.processor`.\n- If a non-null `ViewStub` is provided to the `Session.Builder` check (using [Layout Inspector](https://developer.android.com/studio/debug/layout-inspector)) that the layout dimensions are more than 0 when the `ViewStub` gets inflated. The Camera Kit's root view that gets inflated from the provided `ViewStub` inherits layout parameters set on the `ViewStub`, check that `match_parent` or other parameters are applicable to your layout.\n- Compare versions of dependencies of your app to the Camera Kit sample apps. If dependency versions differ, for example the `camerakit-sample-full` uses `androidx.constraintlayout:constraintlayout:1.1.3` while your app uses `androidx.constraintlayout:constraintlayout:2.0.0`, it is possible that code ported from Camera Kit sample to your app may not work as expected.\n\n### Nothing works as expected\n\n- Attach debugger to your app, enable Java exception breakpoints and build a `Session` while checking that there are no unexpected exceptions with stacktraces related to Camera Kit.\n- Attach debugger to your app, pause all threads and export their state into a text file - check that there are no deadlocked threads related to Camera Kit.\n- Check out the Camera Kit [FAQ page](https://docs.snap.com/camera-kit/faq).\n- Need extra support? [Check our support page](https://docs.snap.com/camera-kit/support)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnapchat%2Fcamera-kit-android-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnapchat%2Fcamera-kit-android-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnapchat%2Fcamera-kit-android-sdk/lists"}