📸 A library that allows you to capture images secretly, in background without alerting users.

Overview

HiddenCamera

A library that allows you to capture images secretly, in background without alerting users.

Build Status Download

Gradle Dependency

Add the dependency to your app's build.gradle:

implementation 'com.cottacush:HiddenCamera:0.0.2'

Usage

HiddenCam uses CameraX under the hood. It is very easy to get started with Hidden cam. First, initialize the camera engine with a Context, A File that represents the base storage folder where the captured images will be saved to, and an OnImageCapturedListener to get capture results:

val hiddenCam = HiddenCam(context, baseStorageFolder, captureListener)

Then prepare the camera for capturing by calling the start() method:

hiddenCam.start()

You can now start capturing images with:

hiddenCam.captureImage()

When you are no longer actively capturing images, stop the camera engine to free the camera hardware by calling:

hiddenCam.stop()

Finally, to clean up call

hiddenCam.destroy()

That's all for basic setup. The captured images should be save at the storage folder provided.

Customisation

HiddenCam attempts to use some default values to improve ease of use. Customization can be done by supplying additional arguments to the HiddenCam() constructor.

Capture Mode (Reccuring or one shot)

The capture mode is specified by the CaptureTimeFrequency class.

OneShot

This capture mode should be used when you want to capture images manually with the capture() function. It is the default setting for the CaptureTimeFrequency parameter

val hiddenCam = HiddenCam(context, baseStorageFolder, captureListener, captureFrequency = OneShot)

Recurring

This capture mode should be used when you want to activate continuous captures at a specified interval. The captures will start as soon as you call the the start() function on your HiddenCam instance. Manual calls to the capture() function will be ignored.

val hiddenCam = HiddenCam(context, baseStorageFolder, captureListener, captureFrequency = Recurring(captureIntervalMillis))

where captureIntervalMillis is the interval.

Resolution and Aspect Ratio

You can either set Resolution or AspectRatio, not both. If Resolution is not set, HiddenCam will try to use the best resolution based on the selected (or default) AspectRatio and phone's camera hardware capability. Resolution can manually be specified by passing a Size object to HiddenCam constructor. For example, a resolution of 1080 X 1920 can be applied as follows:

val hiddenCam = HiddenCam(context, baseStorageFolder, captureListener, targetResolution = Size(1080, 1920))

To override the phone's default Aspect ratio, you can pass a TargetAspectRatio enum to the camera instance. For example, an aspect ratio 16:9 can be applied as follows:

val hiddenCam = HiddenCam(context, baseStorageFolder, captureListener, targetAspectRatio = TargetAspectRatio.RATIO_16_9)

Rotation

By default, the camera rotation is set to match the default display's rotation during the creation of the HiddenCam object. This should work for most cases. If you need something more specific, you can set the rotation:

val rotation: Int = {...}
val hiddenCam = HiddenCam(context, baseStorageFolder, captureListener, targetRotation = rotation)

Camera Type

You can use use the CameraType enum to specify weather you want to use a front camera, or a back camera. The default settings is FRONT_CAMERA. For example, to use a back camera, you can do:

val hiddenCam = HiddenCam(context, baseStorageFolder, captureListener, cameraType = CameraType.BACK_CAMERA)

Full Configuration

Eventually, a fully customised HiddenCam instance would look like this:

hiddenCam = HiddenCam(
            context = context,
            baseFileDirectory = baseStorageFolder,
            imageCapturedListener = captureListener,
            targetAspectRatio = TargetAspectRatio.RATIO_16_9,
            targetResolution = Size(1920, 1080),
            targetRotation = windowManager.defaultDisplay.rotation,
            cameraType = CameraType.FRONT_CAMERA,
            captureFrequency = Recurring(captureIntervalMillis = 15 * 1000)
        )

License

Copyright (c) 2019 Cotta & Cush Limited.

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, software
distributed 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 and
limitations under the License.
Issues
  • Readme Update

    Readme Update

    This PR updates the Readme and adds updated links for CI badge and Maven Central Download.

    opened by efguydan 2
  • Igor8282 patch 1

    Igor8282 patch 1

    opened by Igor8282 1
  • Library not working in upgrade version

    Library not working in upgrade version

    my Gradle version : 4.1.0 jetbrains.kotlin:kotlin-gradle-plugin : 1.4.30

    it's not working in the latest version , it gives error like this :

    Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.60-eap-25. Searched in the following locations: - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.60-eap-25/kotlin-stdlib-jdk8-1.3.60-eap-25.pom - https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.60-eap-25/kotlin-stdlib-jdk8-1.3.60-eap-25.pom - https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.60-eap-25/kotlin-stdlib-jdk8-1.3.60-eap-25.pom Required by: project :app > com.cottacush:HiddenCamera:0.0.2

    opened by PiyushMangukiya03 1
  • Readme Update

    Readme Update

    Update Readme after deploying to MavenCentral

    documentation 
    opened by efguydan 1
  • Feature/scheduling

    Feature/scheduling

    opened by rasheedsulayman 0
  • Sample usage setup, support for capture modes (OneShot and Recurring), code cleanup

    Sample usage setup, support for capture modes (OneShot and Recurring), code cleanup

    This PR adds sample usage in form of a runnable App. It also adds support for capture modes (One shot and Recurring). Finally, general code cleanup and little refactor was done.

    opened by rasheedsulayman 0
  • Feature/dark image fix

    Feature/dark image fix

    opened by efguydan 0
  • Documentation for CaptureTimeFrequency.

    Documentation for CaptureTimeFrequency.

    opened by rasheedsulayman 0
  • Readme documentation, first pass

    Readme documentation, first pass

    Readme documentation, first pass.

    opened by rasheedsulayman 0
  • Chore: Add KDocs

    Chore: Add KDocs

    opened by efguydan 0
  • I cannot run hidden cam in a service.

    I cannot run hidden cam in a service.

    I am getting image path using interface and here is the code.

        hiddenCam = HiddenCam(
            context = this,
            baseFileDirectory = baseStorageFolder,
            imageCapturedListener = this
        )
    

    but the interface is not returning the image path or capturing the image.

    opened by sayyedrizwan 0
  • Sorry, but this lib won't work as intended in pop-up camera phones

    Sorry, but this lib won't work as intended in pop-up camera phones

    I'm happy you are working for this lib, congratulations! This is something that I realized, and I feel you should add it in the description of the lib. Because someone could include your lib, and when the time comes, that app will suffer for opening the camera and capturing with no intimation to the user about it.

    discussion 
    opened by mumayank 2
Releases(v0.0.3)
Owner
Cotta & Cush Limited
We are web, mobile and data engineering experts.
Cotta & Cush Limited
📸 Use Android camera to take pictures and videos, based on `camera2` api.

Camera Use Android camera to take pictures and videos, based on camera2 api. Features Auto filled CameraView for previewing Support both image capture

Hong Duan 112 Aug 15, 2021
A library to take picture easy, transform your data in different format and save photos in your device

A Magic library to take photos and select pictures in Android. In a simple way and if you need it also save the pictures in device, and facial recogni

Fabian Rosales (Frosquivel Developer) 329 Sep 5, 2021
Quick photo and video camera with a flash, customizable resolution and no ads.

Simple Camera A camera with flash, zoom and no ads. The camera is usable for both photo taking and video recording. You can switch between front and r

Simple Mobile Tools 552 Sep 18, 2021
Pix is a Whatsapp image picker replica. with this, you can integrate an image picker just like WhatsApp.

Pix (WhatsApp Style Image and Video Picker) Pix is a WhatsApp image picker replica. with this you can integrate a image picker just like WhatsApp. Upc

Akshay sharma 618 Sep 11, 2021
Instagram like Image Picker for Android

ImagePicker A simple Instagram like library to select images from the gallery and camera. Screenshot Usage For full example, please refer to the sampl

Akvelon 16 Aug 20, 2021
Camera Folder: "Take a Photo from Camera" everywhere where you can open a photo file

When "Camera Folder" is installed many Android-Apps that can open jpg files can also take a photo from camera.

k3b 7 Sep 14, 2021
Image Picker library for Android

Ronnie-Image-Picker Asks for Camera and storage permission and return uri of the images taken or picked from the gallery. Min Api Level: 16 Build Syst

Ronnie Otieno 16 Sep 9, 2021
Android library to choose image from gallery or camera with option to compress result image

ImagePicker Android library to choose image from gallery or camera with option to compress result image. Download Add this to your project's build.gra

Mayank Nagwanshi 63 Sep 6, 2021
Measures human heart rate using camera and flash light.

Heart-Rate-Ometer Introduction Measures human heart rate using camera and flash light. How-it-works https://github.com/phishman3579/android-heart-rate

Jan Rabe 78 Jul 29, 2021
Wrapper around the android Camera class that simplifies its usage

EasyCamera Wrapper around the android Camera class that simplifies its usage (read more about the process) Usage: // the surface where the preview wil

Bozhidar Bozhanov 646 Aug 3, 2021