Photo Capture Display contd

Take a photo of something related to the Inauguration, enter a caption and then submit your report-

Take a picture:

Enter a caption:

Camera.PictureCallback mPictureCallbackJpeg= new Camera.PictureCallback() {

public void onPictureTaken(byte[] data, Camera c) {

Log.e(getClass().getSimpleName(), "PICTURE CALLBACK JPEG: data.length = " + data.length); String filename = timeStampFormat.format(new Date());

String baseDir = "/sdcard/";

if (new File("/sdcard/dcim/Camera/").exists()) {

baseDir = "/sdcard/dcim/Camera/";

currentPhotoFile = baseDir + filename + ".jpg";

FileOutputStream file = new FileOutputStream(new File(currentPhotoFile)); file.write(data);


catch (Exception e){


Camera.ShutterCallback mShutterCallback = new Camera.ShutterCallback() { public void onShutter() {

Log.e(getClass().getSimpleName(), "SHUTTER CALLBACK");

Camera.Parameters params = camera.getParameters(); params.setPictureFormat(PixelFormat.JPEG); params.setPictureSize(PHOTO_WIDTH,PHOTO_HEIGHT); camera.setParameters(params);

0 0

Post a comment