Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.ralfgehrer:androidcamerautil:'
}
dependencies {
implementation("com.github.ralfgehrer:androidcamerautil:")
}
<dependency>
<groupId>com.github.ralfgehrer</groupId>
<artifactId>androidcamerautil</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.ralfgehrer" % "androidcamerautil" % ""
:dependencies [[com.github.ralfgehrer/androidcamerautil ""]]
I tried hard to avoid implementing different strategies based on the device configuration (e.g. manufacturer, model, ...). Unfortunately, I did not get around it. Going through hundreds of posts and talking to several developers, nobody found a solution that works on all devices without implementing device configuration specific code.
<h2>Code related notes</h2> Please feel free to check out the code and test it on your devices. The [CameraIntentHelper](https://github.com/ralfgehrer/AndroidCameraUtil/blob/master/library/src/de/ecotastic/android/camerautil/lib/CameraIntentHelper.java) class provides the main functionality.CameraIntentActivity within the sample package is an example Activity on how to implement the CameraIntentHelper. CameraIntentFragment held by the ParentActivity showcases the CameraIntentHelper implementation within a Fragment.
<h2>List of tested devices</h2> The code was _successfully_ tested on the following devices with Android API-Level >= 8 and stock Android.With regards to custom Roms, the code was successfully tested on the following devices with Android API-Level >= 8 and the CyanogenMod.