All Projects → kevalpatel2106 → Android Hidden Camera

kevalpatel2106 / Android Hidden Camera

Licence: apache-2.0
This library is to take picture using camera without camera preview.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Android Hidden Camera

Magicalcamera
A library to take picture easy, transform your data in different format and save photos in your device
Stars: ✭ 327 (-3.54%)
Mutual labels:  camera, picture
Stereo Vision
This program has been developed as part of a project at the University of Karlsruhe in Germany. The final purpose of the algorithm is to measure the distance to an object by combining two webcams and use them as a Stereo Camera.
Stars: ✭ 160 (-52.8%)
Mutual labels:  camera, picture
Flipsidecamera
The camera app that takes pictures from both sides of your world ! 📷
Stars: ✭ 535 (+57.82%)
Mutual labels:  camera, picture
Cameraview
📸 A well documented, high-level Android interface that makes capturing pictures and videos easy, addressing all of the common issues and needs. Real-time filters, gestures, watermarks, frame processing, RAW, output of any size.
Stars: ✭ 4,137 (+1120.35%)
Mutual labels:  camera, picture
ionic-multi-camera
Take multiple photos one after another
Stars: ✭ 12 (-96.46%)
Mutual labels:  camera, picture
Rpicam
Raspberry PI Surveillance Automation
Stars: ✭ 77 (-77.29%)
Mutual labels:  camera, surveillance
Albumcamerarecorder
一个高效的多媒体支持操作库,可多方面的简单配置操作相册、拍照、录制、录音等功能。也支持配套使用的展示图片、视频、音频的九宫格功能。 (An efficient multimedia support operation library, can be a variety of simple configuration operation album, photo, recording, recording and other functions.Also support supporting the use of the display of pictures, video, audio of the nine grid function.)
Stars: ✭ 106 (-68.73%)
Mutual labels:  camera, picture
Cat-Face-Detector-with-OpenCV-and-JavaFX
📹 A Small OpenCV (Open Source Computer Vision) Example, who has the ability to detect multiple cat faces at the same time 🐱
Stars: ✭ 24 (-92.92%)
Mutual labels:  camera, picture
Album
android 图片视频加载库,单选,多选,预览,自定义UI,相机,裁剪...等等 已适配android10,11
Stars: ✭ 53 (-84.37%)
Mutual labels:  camera, picture
watsor
Object detection for video surveillance
Stars: ✭ 203 (-40.12%)
Mutual labels:  camera, surveillance
Android Camera2 Secret Picture Taker
Take pictures 📷 secretly (without preview or launching device's camera app) using Android CAMERA2 API
Stars: ✭ 275 (-18.88%)
Mutual labels:  camera, picture
Pigeon
Pigeon is a simple 3D printed cloud home surveillance camera project that uses the new Raspberry Pi Zero W
Stars: ✭ 266 (-21.53%)
Mutual labels:  camera, surveillance
Ypimagepicker
📸 Instagram-like image picker & filters for iOS
Stars: ✭ 3,661 (+979.94%)
Mutual labels:  camera, picture
Androidffmpeg
android 读取摄像头和麦克风,使用rtmp推流
Stars: ✭ 298 (-12.09%)
Mutual labels:  camera
Scout
Surveillance Detection Scout: Your Lookout on Autopilot
Stars: ✭ 317 (-6.49%)
Mutual labels:  surveillance
Snowden Archive
💥 A collection of all documents leaked by former NSA contractor and whistleblower Edward Snowden.
Stars: ✭ 297 (-12.39%)
Mutual labels:  surveillance
Onedrawable
✏️ Use only one image to set a background with a click effect for the View
Stars: ✭ 298 (-12.09%)
Mutual labels:  background
Grip
Program for rapidly developing computer vision applications
Stars: ✭ 314 (-7.37%)
Mutual labels:  camera
Rpisurv
Raspberry Pi surveillance
Stars: ✭ 293 (-13.57%)
Mutual labels:  surveillance
Kyshutterbutton
KYShutterButton is a custom button that is similar to the shutter button of the camera app
Stars: ✭ 293 (-13.57%)
Mutual labels:  camera

Android Hidden Camera

Build Status Download API

What is this library for?

This library allows application to take the picture using the device camera without showing the preview of it. Any application can capture the image from front or rear camera from the background service and this library will handle all the complexity on behalf of the application. You can capture images from activity, fragment and even from the background service using this library.

Gradle Dependency:

dependencies {
    compile 'com.kevalpatel2106:hiddencamera:1.3.3'
}

How to integrate?

Step-1: Inherit the builtin class.

Component Class to inherit Sample
Activity com.androidhiddencamera.HiddenCameraActivity public class DemoCamActivity extends HiddenCameraActivity {
Fragment com.androidhiddencamera.HiddenCameraFragment public class DemoCamFragment extends HiddenCameraFragment {
Service com.androidhiddencamera.HiddenCameraService public class DemoCamService extends HiddenCameraService {

Step-2: Create the camera configuration. In this developer can define which camera they want to use, output image format, capture image resolution etc parameters.

//Setting camera configuration
mCameraConfig = new CameraConfig()
    .getBuilder(getActivity())
    .setCameraFacing(CameraFacing.FRONT_FACING_CAMERA)
    .setCameraResolution(CameraResolution.MEDIUM_RESOLUTION)
    .setImageFormat(CameraImageFormat.FORMAT_JPEG)
    .setImageRotation(CameraRotation.ROTATION_270)
    .build();

Step-3: Start the camera in onCreate() by calling startCamera(CameraConfig). Before starting the camera, ask user for the camera runtime permission.

//Check for the camera permission for the runtime
if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) {

    //Start camera preview
    startCamera(mCameraConfig);
} else {
    ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.CAMERA}, 101);
}
  • If you are capturing the image from the service, you have to check if the application has the draw ver other application permission or not? If the permission is not available, application can ask user to grat the permission using HiddenCameraUtils.openDrawOverPermissionSetting().
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) {
    if (HiddenCameraUtils.canOverDrawOtherApps(this)) {
        ...
        ...
    } else {
        //Open settings to grant permission for "Draw other apps".
        HiddenCameraUtils.openDrawOverPermissionSetting(this);
    }
} else {
    //TODO Ask your parent activity for providing runtime permission
}

Step-4: Take image in background whenever you want by calling takePicture(). You will receive captured image file in onImageCapture() callback.

Step -5: Handle errors by overriding onError() callback. In this callback you will receive an error code for each error occurred. You can take specific actions based on the error code.

@Override
public void onCameraError(@CameraError.CameraErrorCodes int errorCode) {
    switch (errorCode) {
        case CameraError.ERROR_CAMERA_OPEN_FAILED:
            //Camera open failed. Probably because another application
            //is using the camera
            break;
        case CameraError.ERROR_IMAGE_WRITE_FAILED:
            //Image write failed. Please check if you have provided WRITE_EXTERNAL_STORAGE permission
            break;
        case CameraError.ERROR_CAMERA_PERMISSION_NOT_AVAILABLE:
            //camera permission is not available
            //Ask for the camra permission before initializing it.
            break;
        case CameraError.ERROR_DOES_NOT_HAVE_OVERDRAW_PERMISSION:
            //Display information dialog to the user with steps to grant "Draw over other app"
            //permission for the app.
            HiddenCameraUtils.openDrawOverPermissionSetting(this);
            break;
        case CameraError.ERROR_DOES_NOT_HAVE_FRONT_CAMERA:
            Toast.makeText(this, "Your device does not have front camera.", Toast.LENGTH_LONG).show();
            break;
    }
}

That's it.

Demo

  • You can download the sample apk from here.
  • sample

Contribute:

Simple 3 step to contribute into this repo:

  1. Fork the project.
  2. Make required changes and commit.
  3. Generate pull request. Mention all the required description regarding changes you made.

Questions

Hit me on twitter Twitter

License

Copyright 2017 Keval Patel

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].