CameraX udostępnia interfejs Extensions API, który umożliwia dostęp do rozszerzeń zaimplementowanych przez producentów na różnych urządzeniach z Androidem, takich jak tryb nocny, HDR, tryb automatyczny, bokeh i retusz twarzy. Listę urządzeń obsługujących rozszerzenia znajdziesz w sekcji Obsługiwane urządzenia.
Architektura rozszerzeń
Poniższy obraz przedstawia architekturę rozszerzeń aparatu.
Aplikacja CameraX korzysta z rozszerzeń za pomocą interfejsu CameraX Extensions API. Interfejs API sprawdza, które rozszerzenia są dostępne, konfiguruje sesję aparatu z rozszerzeniem i komunikuje się z implementacją rozszerzeń aparatu na urządzeniu.
Włączanie rozszerzenia
Aby włączyć rozszerzenie:
- Pobierz instancję
ExtensionsManager. - Sprawdź, czy tryb rozszerzenia jest dostępny dla aparatu, używając
isExtensionAvailable(). Nie każde urządzenie obsługuje wszystkie tryby. - Utwórz
ExtensionSessionConfigz trybem rozszerzenia oraz przypadkami użyciaPreviewiImageCapture. - Powiąż konfigurację sesji z
ProcessCameraProvider.bindToLifecycle(). Tryb rozszerzenia jest stosowany w przypadkach użyciaPreviewiImageCapture.
Kotlin
suspend fun bindNightMode(
context: Context,
lifecycleOwner: LifecycleOwner,
surfaceProvider: Preview.SurfaceProvider,
) {
val cameraProvider = ProcessCameraProvider.awaitInstance(context)
val extensionsManager =
ExtensionsManager.getInstance(context, cameraProvider)
val cameraSelector = CameraSelector.DEFAULT_BACK_CAMERA
// Not every device supports every mode, and binding a mode that the
// camera doesn't support fails. Check availability first.
val isNightAvailable = extensionsManager.isExtensionAvailable(
cameraSelector, ExtensionMode.NIGHT
)
if (!isNightAvailable) {
// Bind a regular session instead (not shown) so that the camera
// still works on devices without the Night extension.
return
}
val preview = Preview.Builder().build()
preview.setSurfaceProvider(surfaceProvider)
val imageCapture = ImageCapture.Builder().build()
// The session config ties the extension mode to the use cases, so
// CameraX applies Night mode to both Preview and ImageCapture.
val sessionConfig = ExtensionSessionConfig(
ExtensionMode.NIGHT,
extensionsManager,
preview,
imageCapture,
)
cameraProvider.bindToLifecycle(
lifecycleOwner, cameraSelector, sessionConfig
)
}
Java
void bindNightMode(Context context, LifecycleOwner lifecycleOwner,
Preview.SurfaceProvider surfaceProvider) {
Executor mainExecutor = ContextCompat.getMainExecutor(context);
ListenableFuture<ProcessCameraProvider> providerFuture =
ProcessCameraProvider.getInstance(context);
// Both the camera provider and ExtensionsManager initialize
// asynchronously. Bind only after both are ready.
providerFuture.addListener(() -> {
try {
ProcessCameraProvider cameraProvider = providerFuture.get();
ListenableFuture<ExtensionsManager> managerFuture =
ExtensionsManager.getInstanceAsync(
context, cameraProvider);
managerFuture.addListener(() -> {
try {
bindNightModeSession(managerFuture.get(),
cameraProvider, lifecycleOwner,
surfaceProvider);
} catch (ExecutionException | InterruptedException e) {
Log.e(TAG, "Failed to get ExtensionsManager", e);
}
}, mainExecutor);
} catch (ExecutionException | InterruptedException e) {
Log.e(TAG, "Failed to get the camera provider", e);
}
}, mainExecutor);
}
void bindNightModeSession(ExtensionsManager extensionsManager,
ProcessCameraProvider cameraProvider,
LifecycleOwner lifecycleOwner,
Preview.SurfaceProvider surfaceProvider) {
CameraSelector cameraSelector = CameraSelector.DEFAULT_BACK_CAMERA;
// Not every device supports every mode, and binding a mode that the
// camera doesn't support fails. Check availability first.
if (!extensionsManager.isExtensionAvailable(
cameraSelector, ExtensionMode.NIGHT)) {
// Bind a regular session instead (not shown) so that the camera
// still works on devices without the Night extension.
return;
}
Preview preview = new Preview.Builder().build();
preview.setSurfaceProvider(surfaceProvider);
ImageCapture imageCapture = new ImageCapture.Builder().build();
// The session config ties the extension mode to the use cases, so
// CameraX applies Night mode to both Preview and ImageCapture.
ExtensionSessionConfig sessionConfig = new ExtensionSessionConfig(
ExtensionMode.NIGHT, extensionsManager, preview, imageCapture);
cameraProvider.bindToLifecycle(
lifecycleOwner, cameraSelector, sessionConfig);
}
Obsługiwane zastosowania
W tabeli poniżej znajdziesz przypadki użycia, które możesz powiązać z włączonym rozszerzeniem:
| Przypadek użycia | Z włączonym rozszerzeniem |
|---|---|
Preview, ImageCapture |
Obsługiwane. Tryb rozszerzenia został zastosowany. |
VideoCapture |
Obsługiwane. VideoCapture nagrywa udostępniony strumień Preview. |
ImageAnalysis |
Nieobsługiwane. |
Sprawdzanie, czy aparat obsługuje konfigurację sesji
Jeśli dodasz więcej przypadków użycia, np. VideoCapture, lub ustawisz inne funkcje, przed powiązaniem kamery sprawdź, czy obsługuje ona całą kombinację:
- Wywołaj
isExtensionAvailable()z tym samymCameraSelectori trybem. - Przekaż tabelę
ExtensionSessionConfigdoProcessCameraProvider.getCameraInfo(). ZwracaCameraInfokamery, którąbindToLifecycle()powiązałby z tą konfiguracją. - Zadzwoń do:
isSessionConfigSupported()na numerCameraInfo.
Jeśli któryś z testów się nie powiedzie, powiąż zwykły element SessionConfig.
Kotlin
fun createSessionConfig(
mode: Int,
vararg useCases: UseCase,
): SessionConfig {
// getCameraInfo() throws if no camera matches the extension, so check
// that the mode is available first.
if (extensionsManager.isExtensionAvailable(cameraSelector, mode)) {
val extensionConfig =
ExtensionSessionConfig(mode, extensionsManager, *useCases)
// Check the camera that would actually be bound for this config,
// and verify that it supports these use cases together with the
// extension, for example VideoCapture.
if (cameraProvider.getCameraInfo(cameraSelector, extensionConfig)
.isSessionConfigSupported(extensionConfig)
) {
return extensionConfig
}
}
// The same use cases can still run in a regular session, so the app
// keeps working without the extension.
return SessionConfig(*useCases)
}
cameraProvider.bindToLifecycle(
lifecycleOwner,
cameraSelector,
createSessionConfig(
ExtensionMode.NIGHT, preview, imageCapture, videoCapture
),
)
Java
SessionConfig createSessionConfig(int mode, UseCase... useCases) {
// getCameraInfo() throws if no camera matches the extension, so check
// that the mode is available first.
if (extensionsManager.isExtensionAvailable(cameraSelector, mode)) {
ExtensionSessionConfig extensionConfig =
new ExtensionSessionConfig(
mode, extensionsManager, useCases);
// Check the camera that would actually be bound for this config,
// and verify that it supports these use cases together with the
// extension, for example VideoCapture.
if (cameraProvider.getCameraInfo(cameraSelector, extensionConfig)
.isSessionConfigSupported(extensionConfig)) {
return extensionConfig;
}
}
// The same use cases can still run in a regular session, so the app
// keeps working without the extension.
return new SessionConfig(useCases);
}
cameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector,
createSessionConfig(
ExtensionMode.NIGHT, preview, imageCapture, videoCapture));
Przełączanie i wyłączanie rozszerzeń
Aby przełączyć się na inny tryb rozszerzenia, wywołaj ponownie bindToLifecycle() z nowym ExtensionSessionConfig. Aby wyłączyć rozszerzenia, powiąż zwykły element SessionConfig z tymi samymi przypadkami użycia. Nie musisz najpierw wywoływać funkcji unbind() ani unbindAll(): wcześniej powiązana konfiguracja sesji i jej przypadki użycia zostaną automatycznie odłączone.
Kotlin
// Binding a new session config unbinds the previous one and its use
// cases, so you don't need to call unbindAll() before switching modes.
cameraProvider.bindToLifecycle(
lifecycleOwner,
cameraSelector,
ExtensionSessionConfig(
ExtensionMode.NIGHT, extensionsManager, preview, imageCapture
),
)
// A regular SessionConfig with the same use cases turns the extension off
// while Preview and ImageCapture keep working.
cameraProvider.bindToLifecycle(
lifecycleOwner,
cameraSelector,
SessionConfig(preview, imageCapture),
)
Java
// Binding a new session config unbinds the previous one and its use
// cases, so you don't need to call unbindAll() before switching modes.
cameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector,
new ExtensionSessionConfig(ExtensionMode.NIGHT,
extensionsManager, preview, imageCapture));
// A regular SessionConfig with the same use cases turns the extension off
// while Preview and ImageCapture keep working.
cameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector,
new SessionConfig(preview, imageCapture));
Ulepszanie procesu rejestrowania
Przetwarzanie zdjęcia w niektórych trybach rozszerzeń, takich jak tryb nocny i HDR, może potrwać kilka sekund. Aby informować użytkowników podczas oczekiwania, używaj podglądu po zrobieniu zdjęcia i postępu przechwytywania, jeśli urządzenie obsługuje te funkcje:
- Podgląd szybko dostarcza obraz o niskiej rozdzielczości, który można wyświetlać, dopóki nie będzie gotowy ostateczny obraz.
- Postęp procesu przechwytywania raportuje postęp przetwarzania od 0 do 100, który możesz wyświetlić jako wskaźnik postępu.
Przed powiązaniem włącz podgląd po wyświetleniu za pomocą ImageCapture.Builder.setPostviewEnabled(). Jeśli aparat nie obsługuje podglądu po zrobieniu zdjęcia, obraz podglądu nie jest generowany.
Po powiązaniu użyj ImageCapture.getImageCaptureCapabilities() z CameraInfo powiązanego aparatu, aby sprawdzić isPostviewSupported() i isCaptureProcessProgressSupported(), a następnie odpowiednio skonfiguruj interfejs.
Kotlin
// Postview must be configured before binding. If the camera doesn't
// support postview, enabling it has no effect.
val imageCapture = ImageCapture.Builder()
.setPostviewEnabled(true)
.build()
val camera = cameraProvider.bindToLifecycle(
lifecycleOwner,
cameraSelector,
ExtensionSessionConfig(
ExtensionMode.NIGHT, extensionsManager, preview, imageCapture
),
)
// Postview and progress support depend on the extension-enabled camera,
// so query the capabilities of the bound camera.
val capabilities =
ImageCapture.getImageCaptureCapabilities(camera.cameraInfo)
setUpCaptureUi(
showPostview = capabilities.isPostviewSupported,
showProgress = capabilities.isCaptureProcessProgressSupported,
)
// Extension captures can take several seconds. Progress updates and an
// early postview image show users that the capture is being processed.
val results = imageCapture.takePicture(
outputFileOptions,
onCaptureProcessProgressed = { progress -> updateProgress(progress) },
onPostviewBitmapAvailable = { bitmap -> showPostview(bitmap) },
)
// Processing is done. Replace the postview with the final image.
showFinalImage(results.savedUri)
Java
// Postview must be configured before binding. If the camera doesn't
// support postview, enabling it has no effect.
ImageCapture imageCapture = new ImageCapture.Builder()
.setPostviewEnabled(true)
.build();
Camera camera = cameraProvider.bindToLifecycle(
lifecycleOwner, cameraSelector,
new ExtensionSessionConfig(ExtensionMode.NIGHT,
extensionsManager, preview, imageCapture));
// Postview and progress support depend on the extension-enabled camera,
// so query the capabilities of the bound camera.
ImageCaptureCapabilities capabilities =
ImageCapture.getImageCaptureCapabilities(camera.getCameraInfo());
setUpCaptureUi(
capabilities.isPostviewSupported(),
capabilities.isCaptureProcessProgressSupported());
// Extension captures can take several seconds. Progress updates and an
// early postview image show users that the capture is being processed.
imageCapture.takePicture(outputFileOptions, mainExecutor,
new ImageCapture.OnImageSavedCallback() {
@Override
public void onCaptureProcessProgressed(int progress) {
updateProgress(progress);
}
@Override
public void onPostviewBitmapAvailable(@NonNull Bitmap bitmap) {
showPostview(bitmap);
}
@Override
public void onImageSaved(
@NonNull ImageCapture.OutputFileResults results) {
// Processing is done. Replace the postview with the final
// image.
showFinalImage(results.getSavedUri());
}
@Override
public void onError(@NonNull ImageCaptureException exception) {
Log.e(TAG, "Capture failed", exception);
}
});
Robienie zdjęć w trybie ultra HDR
Niektóre urządzenia obsługują robienie zdjęć w trybie Ultra HDR, gdy rozszerzenie jest włączone. Format wyjściowy musi zostać ustawiony przed powiązaniem. Jeśli format nie jest obsługiwany, powiązanie się nie powiedzie. Najpierw sprawdź obsługę: gdy isExtensionAvailable() zwróci true, pobierz CameraInfo aparatu z włączonym rozszerzeniem za pomocą getCameraInfo() i ExtensionSessionConfig, a następnie sprawdź, czy getSupportedOutputFormats() zawiera OUTPUT_FORMAT_JPEG_ULTRA_HDR.
Kotlin
// Supported output formats can differ when an extension is enabled, so
// query them from the extension-enabled camera. isExtensionAvailable()
// must have returned true for this selector and mode first; otherwise,
// getCameraInfo() throws.
val extensionCameraInfo = cameraProvider.getCameraInfo(
cameraSelector,
ExtensionSessionConfig(ExtensionMode.NIGHT, extensionsManager),
)
val supportedFormats = ImageCapture
.getImageCaptureCapabilities(extensionCameraInfo)
.supportedOutputFormats
// Binding fails if the output format isn't supported, so request Ultra HDR
// only when the extension-enabled camera supports it.
val imageCapture = ImageCapture.Builder().apply {
if (ImageCapture.OUTPUT_FORMAT_JPEG_ULTRA_HDR in supportedFormats) {
setOutputFormat(ImageCapture.OUTPUT_FORMAT_JPEG_ULTRA_HDR)
}
}.build()
cameraProvider.bindToLifecycle(
lifecycleOwner,
cameraSelector,
ExtensionSessionConfig(
ExtensionMode.NIGHT, extensionsManager, preview, imageCapture
),
)
Java
// Supported output formats can differ when an extension is enabled, so
// query them from the extension-enabled camera. isExtensionAvailable()
// must have returned true for this selector and mode first; otherwise,
// getCameraInfo() throws.
CameraInfo extensionCameraInfo = cameraProvider.getCameraInfo(
cameraSelector,
new ExtensionSessionConfig(ExtensionMode.NIGHT, extensionsManager));
Set<Integer> supportedFormats =
ImageCapture.getImageCaptureCapabilities(extensionCameraInfo)
.getSupportedOutputFormats();
// Binding fails if the output format isn't supported, so request Ultra HDR
// only when the extension-enabled camera supports it.
ImageCapture.Builder builder = new ImageCapture.Builder();
if (supportedFormats.contains(ImageCapture.OUTPUT_FORMAT_JPEG_ULTRA_HDR)) {
builder.setOutputFormat(ImageCapture.OUTPUT_FORMAT_JPEG_ULTRA_HDR);
}
ImageCapture imageCapture = builder.build();
cameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector,
new ExtensionSessionConfig(ExtensionMode.NIGHT,
extensionsManager, preview, imageCapture));
Monitorowanie i dostosowywanie rozszerzenia
Po powiązaniu użyj ExtensionsManager.getCameraExtensionsInfo() i ExtensionsManager.getCameraExtensionsControl() z powiązaną kamerą, aby monitorować i dostosowywać rozszerzenie.
Dostosowywanie siły rozszerzenia
Jeśli isExtensionStrengthAvailable() zwraca true, wywołaj setExtensionStrength() z wartością od 0 do 100. Wartość 0 oznacza, że rozszerzenie nie jest przetwarzane, a 100 to wartość domyślna. To, co kontroluje intensywność, zależy od trybu. Na przykład w trybie nocnym określa, ile obrazów jest łączonych i jak jasny jest ostateczny obraz.
Bieżąca wartość to getExtensionStrength().
Kotlin
val camera = cameraProvider.bindToLifecycle(
lifecycleOwner,
cameraSelector,
ExtensionSessionConfig(
ExtensionMode.NIGHT, extensionsManager, preview, imageCapture
),
)
// Pass the bound extension-enabled camera. For a camera without an
// extension, strength isn't available and the control is null.
val extensionsInfo =
extensionsManager.getCameraExtensionsInfo(camera.cameraInfo)
val extensionsControl =
extensionsManager.getCameraExtensionsControl(camera.cameraControl)
// Not every device lets apps adjust the strength, so check support before
// showing a strength control.
if (extensionsInfo.isExtensionStrengthAvailable) {
// For example, connect this to a slider in your UI.
extensionsControl?.setExtensionStrength(50)
}
Java
Camera camera = cameraProvider.bindToLifecycle(
lifecycleOwner, cameraSelector,
new ExtensionSessionConfig(ExtensionMode.NIGHT,
extensionsManager, preview, imageCapture));
// Pass the bound extension-enabled camera. For a camera without an
// extension, strength isn't available and the control is null.
CameraExtensionsInfo extensionsInfo =
extensionsManager.getCameraExtensionsInfo(camera.getCameraInfo());
CameraExtensionsControl extensionsControl =
extensionsManager.getCameraExtensionsControl(
camera.getCameraControl());
// Not every device lets apps adjust the strength, so check support before
// showing a strength control.
if (extensionsInfo.isExtensionStrengthAvailable()
&& extensionsControl != null) {
// For example, connect this to a slider in your UI.
extensionsControl.setExtensionStrength(50);
}
Wyświetlanie bieżącego trybu rozszerzenia
ExtensionMode.AUTO może przełączać się na tryby takie jak nocny lub HDR w zależności od sceny. Jeśli isCurrentExtensionModeAvailable() zwraca true, obserwuj getCurrentExtensionMode(), aby pokazać użytkownikom, który tryb jest aktywny.
Kotlin
val camera = cameraProvider.bindToLifecycle(
lifecycleOwner,
cameraSelector,
ExtensionSessionConfig(
ExtensionMode.AUTO, extensionsManager, preview, imageCapture
),
)
val extensionsInfo =
extensionsManager.getCameraExtensionsInfo(camera.cameraInfo)
// In AUTO mode, the active mode can change with the scene, for example to
// NIGHT in low light. The LiveData is null when the device doesn't report
// the current mode.
if (extensionsInfo.isCurrentExtensionModeAvailable) {
extensionsInfo.currentExtensionMode?.observe(lifecycleOwner) { mode ->
showActiveModeBadge(mode)
}
}
Java
Camera camera = cameraProvider.bindToLifecycle(
lifecycleOwner, cameraSelector,
new ExtensionSessionConfig(ExtensionMode.AUTO,
extensionsManager, preview, imageCapture));
CameraExtensionsInfo extensionsInfo =
extensionsManager.getCameraExtensionsInfo(camera.getCameraInfo());
// In AUTO mode, the active mode can change with the scene, for example to
// NIGHT in low light. The LiveData is null when the device doesn't report
// the current mode.
LiveData<Integer> currentMode = extensionsInfo.getCurrentExtensionMode();
if (extensionsInfo.isCurrentExtensionModeAvailable()
&& currentMode != null) {
currentMode.observe(lifecycleOwner, this::showActiveModeBadge);
}
Sugeruj tryb nocny
Wskaźnik trybu nocnego informuje aplikację, kiedy scena jest na tyle ciemna, że rozszerzenie trybu nocnego może być przydatne, dzięki czemu możesz zasugerować użytkownikowi przełączenie się na ten tryb. Wskaźnik jest wyświetlany, gdy kamera działa bez rozszerzenia. Użyj CameraInfo.isNightModeIndicatorSupported(), aby sprawdzić obsługę, a następnie obserwuj CameraInfo.getNightModeIndicator(). Gdy wartość to NightModeIndicator.RECOMMENDED, wyświetl sugestię.
Jeśli użytkownik zaakceptuje, powiąż ExtensionSessionConfig z ExtensionMode.NIGHT.
Wskaźnik trybu nocnego wymaga CameraX w wersji 1.7.0 lub nowszej oraz urządzenia z Androidem 16 (API na poziomie 36) lub nowszym. isNightModeIndicatorSupported() zwraca false na niższych poziomach interfejsu API.
Kotlin
// The indicator is reported while a regular (non-extension) session is
// running with Preview, so the app can suggest Night mode only when the
// scene is dark enough to need it.
val cameraInfo = camera.cameraInfo
// Don't suggest a mode that the camera can't bind.
val isNightAvailable = extensionsManager.isExtensionAvailable(
cameraSelector, ExtensionMode.NIGHT
)
// If the indicator isn't supported, its value is always UNKNOWN.
if (cameraInfo.isNightModeIndicatorSupported && isNightAvailable) {
cameraInfo.nightModeIndicator.observe(lifecycleOwner) { indicator ->
showNightModeSuggestion(
visible = indicator == NightModeIndicator.RECOMMENDED
)
}
}
fun onNightModeSuggestionAccepted() {
// Binding the extension session config replaces the regular session.
cameraProvider.bindToLifecycle(
lifecycleOwner,
cameraSelector,
ExtensionSessionConfig(
ExtensionMode.NIGHT, extensionsManager, preview, imageCapture
),
)
}
Java
// The indicator is reported while a regular (non-extension) session is
// running with Preview, so the app can suggest Night mode only when the
// scene is dark enough to need it.
CameraInfo cameraInfo = camera.getCameraInfo();
// Don't suggest a mode that the camera can't bind.
boolean isNightAvailable = extensionsManager.isExtensionAvailable(
cameraSelector, ExtensionMode.NIGHT);
// If the indicator isn't supported, its value is always UNKNOWN.
if (cameraInfo.isNightModeIndicatorSupported() && isNightAvailable) {
cameraInfo.getNightModeIndicator().observe(lifecycleOwner,
indicator -> showNightModeSuggestion(
indicator == NightModeIndicator.RECOMMENDED));
}
void onNightModeSuggestionAccepted() {
// Binding the extension session config replaces the regular session.
cameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector,
new ExtensionSessionConfig(ExtensionMode.NIGHT,
extensionsManager, preview, imageCapture));
}
Zależności
Interfejs CameraX Extensions API jest zaimplementowany w bibliotece camera-extensions.
Rozszerzenia zależą od podstawowych modułów CameraX (core, camera2 i lifecycle). Używaj tej samej wersji we wszystkich bibliotekach androidx.camera.
Kotlin
dependencies {
val camerax_version = "1.7.0"
implementation("androidx.camera:camera-core:${camerax_version}")
implementation("androidx.camera:camera-camera2:${camerax_version}")
implementation("androidx.camera:camera-lifecycle:${camerax_version}")
// The CameraX Extensions library
implementation("androidx.camera:camera-extensions:${camerax_version}")
}
Dynamiczny
dependencies {
def camerax_version = "1.7.0"
implementation "androidx.camera:camera-core:${camerax_version}"
implementation "androidx.camera:camera-camera2:${camerax_version}"
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
// The CameraX Extensions library
implementation "androidx.camera:camera-extensions:${camerax_version}"
}
Migracja z wycofanego interfejsu API selektora kamery
ExtensionsManager.getExtensionEnabledCameraSelector()
jest wycofany od wersji CameraX 1.7.0-alpha02. Zamiast tego użyj ExtensionSessionConfig, jak pokazano w tej tabeli:
| Wycofano | Zamiennik |
|---|---|
getExtensionEnabledCameraSelector(cameraSelector, mode) |
ExtensionSessionConfig(mode, extensionsManager, useCases) |
bindToLifecycle(owner, extensionCameraSelector, preview, imageCapture) |
bindToLifecycle(owner, cameraSelector, extensionSessionConfig) |
getCameraInfo(extensionCameraSelector) |
getCameraInfo(cameraSelector, extensionSessionConfig) |
unbindAll(), a następnie powiąż ponownie, aby przełączyć tryby |
Powiąż nową konfigurację sesji. Poprzedni zostanie automatycznie odłączony. |
Dodatkowe materiały
Więcej informacji o CameraX znajdziesz w tych materiałach.
Ćwiczenie w Codelabs
Przykładowy kod
Katalog Camera Samples (zobacz przykład rozszerzeń)
Inne informacje
Narzędzie do sprawdzania rozszerzeń dostawcy CameraX