Fotoapparat
Camera API in Android is hard. Having 2 different API for new and old Camera does not make things any easier. But fret not, that is your lucky day! After several years of working with Camera, we came up with Fotoapparat.
What it provides:
- Camera API which does not allow you to shoot yourself in the foot.
- Simple yet powerful parameters customization.
- Standalone custom
CameraView
which can be integrated into anyActivity
. - Fixes and workarounds for device-specific problems.
- Both Kotlin and Java friendly configurations.
- Last, but not least, non 0% test coverage.
Taking picture becomes as simple as:
How it works
Step One
Add CameraView
to your layout
Step Two
Configure Fotoapparat
instance.
Check the wiki for the configuration
options e.g. change iso
Are you using Java only? See our wiki for the java-friendly configuration.
Step Three
Call start()
and stop()
. No rocket science here.
Take a picture
Finally, we are ready to take a picture. You have various options.
Update parameters
It is also possible to update some parameters after Fotoapparat
was already started.
Or alternatively, you may provide updates on an existing full configuration.
Switch cameras
In order to switch between cameras, Fotoapparat.switchTo()
can be used with the new desired lensPosition
and its cameraConfiguration
.
Set up
Add dependency to your build.gradle
Camera permission will be automatically added to your AndroidManifest.xml
. Do not forget to request this permission on Marshmallow and higher.
Snapshot versions
If you like to test and try the latest added features & bugfixes you can use the -SNAPSHOT
version.
Gradle will download & cache the latest snapshot version, so be sure to delete the cache if you want to try a newer snapshot
version than the downloaded/cached one.