Capture Image programmatically in android -


how can using camera capture picture programmatically without touch capture button in android selfie stick using bluetooth sign.

try this:

public void takepicturenopreview(context context){     // open facing camera default     camera mycamera=camera.open();      if(mycamera!=null){         try{             //set camera parameters if want             //...              // here, unused surface view , holder             surfaceview dummy=new surfaceview(context)             mycamera.setpreviewdisplay(dummy.getholder());                 mycamera.startpreview();               mycamera.takepicture(null, null, getjpegcallback()):          } {             mycamera.close();         }            } else {         //booo, failed!     }     private picturecallback getjpegcallback(){       picturecallback jpeg=new picturecallback() {              @override           public void onpicturetaken(byte[] data, camera camera) {               fileoutputstream fos;               try {                   fos = new fileoutputstream("test.jpeg");                   fos.write(data);                   fos.close();               }  catch (ioexception e) {                  //do               }           }       };    } } 

or try solutions post: taking pictures camera on android programmatically


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -