camerax
यह क्या करती है
यह स्किल CameraX लाइब्रेरी से Android ऐप में कैमरा फ़ीचर बनाने के लिए मार्गदर्शन और पैटर्न देती है। यह उन Android डेवलपरों के लिए है जो ऐप में फ़ोटो, वीडियो या इफ़ेक्ट जोड़ रहे हैं।
कब इस्तेमाल करें
- ✓जब आप Android ऐप में कैमरा या वीडियो रिकॉर्डिंग स्क्रीन जोड़ना चाहते हैं।
- ✓जब आपको पुराने Android कैमरा कोड को CameraX पर ले जाना हो।
- ✓जब आप कैमरा फ़ीड पर ML Kit या Media3 इफ़ेक्ट जोड़ना चाहते हैं।
Skill का लिंक
https://github.com/android/skills/blob/main/camera/camerax/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे Android ऐप में CameraX का इस्तेमाल करके ऑडियो के साथ वीडियो रिकॉर्डिंग जोड़िए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
स्किल CameraX लाइब्रेरी के लिए चरण-दर-चरण पैटर्न देती है। वह उन builder कॉल की ओर इशारा करती है जिनका नतीजा वापस सेव करना ज़रूरी है, ताकि वे असर करें, और हार्डवेयर इंटरऑप व इफ़ेक्ट इंटीग्रेशन भी कवर करती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
This skill provides procedural guidance and standard patterns for building
camera applications on Android, with a focus on CameraX, including its
Camera2Interop utilities, and Media3 integrations.
Core workflows
Handling immutable API patterns
Various Android camera and media APIs, especially CameraX VideoCapture, use a
fluent, immutable builder-like pattern where methods return a new instance.
Failing to reassign these results in settings, such as audio, being ignored.
Pattern: Reassignment is required
// WRONG
run {
val pending = recorder.prepareRecording(context, opts)
pending.withAudioEnabled() // This returns a new instance which is ignored
val active = pending.start(exec, listener)
}
// CORRECT
run {
val pending = recorder.prepareRecording(context, opts)
.withAudioEnabled() // Chaining works
val active = pending.start(exec, listener)
}
// ALSO CORRECT
run {
var pending = recorder.prepareRecording(context, opts)
pending = pending.withAudioEnabled() // Reassignment
val active = pending.start(exec, listener)
}
<br />
See immutability for a list of affected classes.
Migrating to CameraX
When migrating legacy camera codebases to the CameraX Jetpack library:
- Camera1 to CameraX : For migrating legacy
android.hardware.Cameraimplementations, surface handling, and manual lifecycles, see the Camera1 migration guide. - Camera2 to CameraX : For migrating more recent but verbose
android.hardware.camera2implementations, session state callbacks, and interop patterns, see the Camera2 migration guide.
Comprehensive feature blueprinting
For multi-step features that involve multiple files and hardware-level wiring, follow the Structural Blueprinting approach to avoid system timeouts. Such complex features include:
- Manual controls : Break down into the
ViewModelstate, the controller layer, and theCamera2Interopwiring in the session. - RAW capture: Separate JPEG and RAW output configurations into discrete build steps.
- Custom effects : Prefer
Media3EffectorSurfaceProcessorover manual OpenGL pipelines unless absolute performance is required. - Low-light : See low-light for Night Mode and LLB guidance.
- Foldables : See foldables for handling dynamic postures and hinge states.
- XR, AR, and VR : See xr for spatial tracking, passthrough synchronization, and latency guardrails.
- Thermals and power : See thermals for managing
StreamUseCaseoptimizations andPowerManagerthermal states. - Testing and mocking : See testing for using
FakeCameraConfig, handling asynchronous lifecycles, and validating analysis pipelines. - ML Kit spatial analysis : See mlkit-spatial for coordinate mapping, rotation logic, and mirrored lens handling.
- Wear OS camera remote : See wear-os for circular UI constraints, Data Layer API syncing, and remote trigger logic.
See expert-blueprints for step-by-step guides.
API discovery
Always use higher-level abstractions instead of low-level manual wiring:
- Analysis : Use
MlKitAnalyzerinstead of manualImageAnalysis.Analyzer. - Filters and effects : Use
Media3Effectfor standard post-processing. - Multi-camera : Use
ConcurrentCameraAPIs for dual-stream setups.
See modern-apis for current recommendations.
Code quality and architectural rules
Adhere to the following Android ecosystem standard patterns when building your camera implementations:
- Testing, fakes over mocks : Avoid mocking libraries like
Mockito, especially for multi-step CameraX interfaces likeImageProxy. Build "Fakes" to verify state rather than unreliable implementation details. - Google Truth assertions : Use
assertThatover standardJUnitassertions likeassertEqualsfor improved readability. - Explicit test runners : Always define an explicit
@RunWithfor test classes to ensure the CI environment executes them correctly. - Semantic UI merging : When building custom camera controls in Compose, such as a button with an
IconandText, use `semantics {
अक्सर पूछे जाने वाले सवाल
मेरी ऑडियो सेटिंग क्यों नज़रअंदाज़ हो रही है?
CameraX के कुछ builder तरीके नई ऑब्जेक्ट लौटाते हैं, इसलिए नतीजा वापस सेव करना होता है। स्किल इस बात की ओर ध्यान दिलाती है।
क्या यह पुराने Camera API से माइग्रेट करने में मदद करती है?
हाँ। इसमें पुराने Camera कोड को CameraX पर ले जाने का मार्गदर्शन है।
क्या यह ML Kit को कवर करती है?
हाँ। यह CameraX सेटअप में ML Kit या Media3 इफ़ेक्ट जोड़ने को कवर करती है।
जानकारी
लेखक का मूल विवरण
Provide technical guidance for Android camera development with CameraX. Use when implementing camera features, handling asynchronous recording lifecycles, wiring low-level hardware interop using CameraX, or integrating ML Kit or Media3 effects.
repo: android/skills
लोकप्रियता
- GitHub स्टार
- 10k
- रैंकिंग में स्थान
- #11908
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 29/10/2026
कमेंट
- …
इस repository की और skills
agp-9-upgrade
10kआपके एजेंट को Android ऐप को Android Gradle Plugin 9 पर ले जाने और उसके breaking changes सुधारने में मदद करती है। मल्टीप्लेटफ़ॉर्म प्रोजेक्ट के लिए नहीं।
android-for-cars-parked-apps
10kआपके एजेंट को Android वीडियो, गेम या ब्राउज़र ऐप को Android Auto और Android Automotive पर parked ऐप के रूप में चलाने के लिए ढालने में मदद करती है।
appfunctions
10kआपके एजेंट को Android ऐप के मुख्य काम ढूँढकर उन्हें AppFunctions के रूप में देने में मदद करती है, ताकि AI एजेंट और वॉइस कमांड उन्हें चला सकें।
litert-lm
10kआपके एजेंट को Android ऐप बनाने में मदद करती है, जो LiteRT-LM Kotlin API से डिवाइस पर एक खुला टेक्स्ट AI मॉडल चलाता है।
मिलती-जुलती skills
android-clean-architecture
280kयह आपके एजेंट को Android projects को व्यवस्थित तरीके से संभालने देता है। यह code को ऐसा ढांचा देता है कि उसकी देखभाल और नए features जोड़ना आसान हो।
compose-multiplatform-patterns
280kKMP projects में Compose Multiplatform और Jetpack Compose patterns इस्तेमाल करने में आपके एजेंट की मदद करता है। इसमें state, navigation, theming और performance शामिल हैं।
dart-flutter-patterns
280kयह आपके एजेंट को Dart और Flutter apps के लिए code लिखने देता है। यह आधुनिक patterns इस्तेमाल करके मज़बूत और आसानी से संभलने वाले apps बनाता है।