Skip to main content

Posts

Showing posts with the label capture image

Camera without preview in android

Camera sample program without preview/How to take photo without a preview in android program package  com.sample import  java.io.FileNotFoundException; import  java.io.FileOutputStream; import  java.io.IOException; import  android.app.Activity; import  android.graphics.Bitmap; import  android.graphics.BitmapFactory; import  android.hardware.Camera; import  android.hardware.Camera.Parameters; import  android.os. Bundle ; import  android.util.Log; import  android.view.SurfaceHolder; import  android.view.SurfaceView; import  android.widget.ImageView; public   class  TakePicture  extends  Activity  implements  SurfaceHolder.Callback {        //a variable to store a reference to the Image View at the main.xml file        private  ImageView  iv_image ;        //a variable to store a reference to the Surface View at the main.xml file      private  SurfaceView  sv ;          //a bitmap to display the captured image        private  Bitmap  bmp ;              //Camera variables        //a surfac

Capture image without surface view as background service in android

Capture image without user knowledge in android/Capture image as background service in android/Take photo without preview in android/ Camera without preview in android  package com.example.picture; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import android.app.Service; import android.content.Context; import android.content.Intent; import android.hardware.Camera; import android.hardware.Camera.Parameters; import android.media.AudioManager; import android.os.IBinder; import android.util.Log; import android.view.SurfaceHolder; import android.view.SurfaceView; public class CameraService extends Service {       //Camera variables       //a surface holder       private SurfaceHolder sHolder ;        //a variable to control the camera       private Camera mCamera ;       //the camera parameters       private Parameters parameters ;       /** Called when the activity is first created. */     @Override     p