Status Update
Comments
ey...@gmail.com <ey...@gmail.com> #2
er...@google.com <er...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
er...@google.com <er...@google.com> #4
Bugjuggler:
bu...@google.com <bu...@google.com> #5
64...@gmail.com <64...@gmail.com> #6
bu...@google.com <bu...@google.com>
er...@google.com <er...@google.com> #7
Hi there,
We're actively looking at this and will provide another method to initialize.
ap...@google.com <ap...@google.com> #8
Branch: androidx-master-dev
commit 9015f3cff4053ad56b8b34b0708e3fe13945187c
Author: Trevor McGuire <trevormcguire@google.com>
Date: Thu Dec 05 18:21:19 2019
CameraX on-demand initialization through resources
Allows initializing CameraX without having to extend Application. A
default config provider can be specified through string resource or by
extending Application.
camera:camera-camera2 provides a default string resource which will be
included by default by the resource merger so users don't need to do
anything if they are ok with the default configuration.
Relnote: "Removed requirement that app must extend Application in order
to initialize CameraX. CameraX will now be initialized with a default
Camera2 configuration as long as the camera-camera2 artifact is included
in the application's build.gradle."
Bug: 146923574
Test: Integration tests are all successfully initialized and run
Change-Id: I58ff5c4440f9fec0afb3d9790f652dd91c2c84bd
A camera/camera-camera2/proguard-rules.pro
M camera/camera-camera2/src/main/AndroidManifest.xml
M camera/camera-camera2/src/main/java/androidx/camera/camera2/Camera2Config.java
A camera/camera-camera2/src/main/res/values/strings.xml
M camera/camera-core/src/main/java/androidx/camera/core/CameraX.java
A camera/camera-core/src/main/res/values/public.xml
A camera/camera-core/src/main/res/values/strings.xml
M camera/integration-tests/coretestapp/src/main/AndroidManifest.xml
D camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CoreApplication.java
M camera/integration-tests/extensionstestapp/src/main/java/androidx/camera/integration/extensions/ExtensionsApplication.java
M camera/integration-tests/viewtestapp/src/main/AndroidManifest.xml
M camera/integration-tests/viewtestapp/src/main/java/androidx/camera/integration/view/ViewCameraXConfigProvider.java
M camera/integration-tests/viewtestapp/src/main/res/values/strings.xml
er...@google.com <er...@google.com> #9
Hi All,
This is merged and will be available in the next release. Please take a look and let us know what you think. Thanks.
ey...@gmail.com <ey...@gmail.com> #10
er...@google.com <er...@google.com> #11
re:
so...@gmail.com <so...@gmail.com> #12
Well.. I also think this behavior is not so good.
What happens, if we want to use camerax in dynamic features module?
Is this really acceptable?
Rather, initialization using ContentProvider looks better.
Please re-consider on-demand initialization more. 🙇♂️
tr...@google.com <tr...@google.com> #13
I notices this issue now. Well.. I also think this behavior is not so good.
As of alpha10
, users no longer need to extend Application
in order to initialize CameraX. Please let us know if this isn't working for you.
What happens, if we want to use camerax in dynamic features module?
I believe the current initialization mechanism introduced in alpha10 should work with dynamic features modules, but I'll admit I haven't yet tested it myself. If you have issues with dynamic features modules specifically, we would like to hear about it.
so...@gmail.com <so...@gmail.com> #14
Camera function is not primary in my application.
So I wanna reduce app size possible.
And I choose dynamic features module.
Then camerax libraries should be used in a dynamic features module only.
I understand, CameraX always needs config setup in application. (if extend Application exists)
If I wrong, so sorry.
tr...@google.com <tr...@google.com> #15
I understand, CameraX always needs config setup in application. (if extend Application exists)
I think there may be some confusion here. To be clear, this behavior was changed in alpha10
. Users no longer need to extend Application. CameraX will be initialized automatically if the user does not extend Application. Only in alpha07
, alpha08
, and alpha09
did users have to extend Application.
I believe this should work for dynamic feature modules as well, but have not yet had a chance to try it.
so...@gmail.com <so...@gmail.com> #16
I will check again for dynamic features module with extended Application.
If some problem exists, then report through another issue.
Have a good day.
fa...@gmail.com <fa...@gmail.com> #17
However, you should correct the order of camera2 dependency in build.gradle, because camera-view & camera-lifecycle will override the androidx_camera_default_config_provider string resource in build time with theirs camera-core dependencies
Correct the docs also pls
dependencies {
// CameraX core library using the camera2 implementation
def camerax_version = "1.0.0-alpha10"
// If you want to use the CameraX View class
implementation "androidx.camera:camera-view:1.0.0-alpha07"
// If you want to use the CameraX Extensions library
implementation "androidx.camera:camera-extensions:1.0.0-alpha07"
// If you want to use the CameraX Lifecycle library
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
implementation "androidx.camera:camera-camera2:${camerax_version}"
}
Description
There should definitely be an alternative to this (I see CameraX.initialize but it's hidden). I have a highly modularized app, and I feel like I'm getting punished by having to leak a camera dependency into my app module just to implement this interface.