Hey. I am new to Android and have not touched Java for a long time.
I am working on an application specifically for the Nexus S with Android 2.3.1. I would like the application to quickly take a few photos with few user inputs. At the moment, I would like to get 10 images from the camera as quickly as possible. In my code, I acceptPicture () runs as follows:
takepicture = (Button) findViewById(R.id.button); // created button from main.xml takepicture.setOnClickListener(new OnClickListener(){ // creating useful button public void onClick(View view){ mCamera.takePicture(mShutterCallback,mPictureCallback,mjpeg); // when clicked take picture } });
This works for one image per click, which is saved using
PictureCallback mjpeg = new PictureCallback() { // for compressed picture data public void onPictureTaken(byte[],data, Camera c { /*Saving image to internal sd card*/ }
I tried putting takePicture () in a for loop, but that didn't work. Any suggestions? Please let me know if you need more information. Thanks in advance.
source share