@@ -6,18 +6,18 @@ Open Camera is compiled using Android Studio. (Versions 1.34 or earlier were com
Source Control
==============
The Git repository is available at https://sourceforge.net/p/opencamera/code/ . Note that I work with the auto crlf turned off (otherwise it converts all the Linux line endings into Windows format). If you want to work on the source, please check out the latest version from the repository.
The Git repository is available at https://sourceforge.net/p/opencamera/code/ . Note that I work with the auto crlf turned off (otherwise it converts all the Linux line endings into Windows format). If you want to work on the source (especially if you want to contribute), please check out the latest version from the repository. If you are forking to build a separate application, again the Git repository has the latest code, but taking a source archive corresponding to a released version of Open Camera ( https://sourceforge.net/projects/opencamera/files/ ) may be more stable.
General advice
==============
If you want to build an application using the Open Camera source code, there are various levels you might like to do this at.
CameraController: The classes in the CameraController/ folder encapsultate the Android camera API (both the original, and Android 5's Camera2 API). So one level is to use these classes, to build a new application. These classes are still fairly low level (and you'll still have to do work such as setting up things like the camera preview), but avoid having to deal with Android's camera API directly. They combine the 2 camera APIs under a single interface (though some features are Camera2 specific). They also encapsulate code that covers driver specific behaviours (or driver bug workarounds!), to hide this from the outside world.
CameraController: The classes in the CameraController/ folder encapsultate the Android camera API (both the original, and the Camera2 API introduced in Android 5). So one level is to use these classes, to build a new application. These classes are still fairly low level (and you'll still have to do work such as setting up things like the camera preview), but avoid having to deal with Android's camera API directly. They combine the 2 camera APIs under a single interface (though some features are Camera2 specific). They also encapsulate code that covers driver specific behaviours (or driver bug workarounds!), to hide this from the outside world.
Preview: At a higher level, you might want to take the classes in Preview/ as well as CameraController/. Note the Preview class is a bit of a misnomer - as well as the camera preview, it also includes much of the functionality required to operate the camera. This level would provide you with a camera, but still leave you to define all the higher level parts of the application, such as user-interface, preferences, image processing and saving. As well as controlling the Preview by calling its methods, an instance of ApplicationInterface must be supplied, to allow the Preview to communicate to the application. (As an alternative, you may prefer to start with Open Camera's MyApplicationInterface as a sample, and modify it to your needs.)
Preview: At a higher level, you might want to take the classes in Preview/ as well as CameraController/. Note the Preview class is a bit of a misnomer - as well as the camera preview, it also includes much of the functionality required to operate the camera. This level would provide you with a camera, but still leave you to define all the higher level parts of the application, such as user-interface, preferences, image processing and saving. As well as controlling the Preview by calling its methods, an instance of ApplicationInterface must be supplied, to allow the Preview to communicate to the application. It is recommended to subclass BasicApplicationInterface, which provides a dummy default implementation of many of the methods. (As an alternative, you may prefer to start with Open Camera's MyApplicationInterface as a sample, and modify it to your needs.)
Application: You might prefer to use Open Camera in its entirety, as an Activity within your application (or possibly converting the MainActivity to a fragment). Consider whether Open Camera's Settings should be unified with the settings in your application. All accesses to SharedPreferences use the PreferencesKeys class to find the keys.
Application: You might prefer to use Open Camera in its entirety, as an Activity within your application (or possibly converting the MainActivity to a fragment). Consider whether Open Camera's Settings should be unified with the settings in your application. Accesses to SharedPreferences use the PreferencesKeys class to find the keys.