software

github.com-Fotoapparat-Fotoapparat_-_2017-07-03_18-27-32

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:- Simple, yet powerful API for working with Camera.- Support of Camera1 as well as Camera2.- Last, but not least, non 0% test coverage.

How it works

Step One

Add CameraView to your layout

xml

Step Two

Configure Fotoapparat instance

javaFotoapparat .with(context) .into(cameraView) // view which will draw the camera preview .photoSize(biggestSize()) // we want to have the biggest photo possible .lensPosition(back()) // we want back camera .focusMode(firstAvailable( // (optional) use the first focus mode which is supported by device continuousFocus(), autoFocus(), // in case if continuous focus is not available on device, auto focus will be used fixed() // if even auto focus is not available - fixed focus mode will be used )) .flash(firstAvailable( // (optional) similar to how it is done for focus mode, this time for flash autoRedEye(), autoFlash(), torch() )) .frameProcessor(myFrameProcessor) // (optional) receives each frame from preview stream .logger(loggers( // (optional) we want to log camera events in 2 places at once logcat(), // ... in logcat fileLogger(this) // ... and to file )) .build();

Set up

Camera permission will be automatically added to your AndroidManifest.xml. Do not forget to request this permission on Marshmallow and higher.

Credits

We want to say thanks to Mark Murphy for the awesome job he did with CWAC-Camera. We were using his library for a couple of years and now we feel that Fotoapparat is a next step in the right direction.

We also want to say many thanks to Leander Lenzing for the amazing icon. Don't forget to follow his work in dribbble.

License

```Copyright 2017 Fotoapparat

Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.```

To restore the repository, download the bundle Fotoapparat-Fotoapparat_-_2017-07-03_18-27-32.bundle and run: