Here you can find the source of launchCamera(Activity activity)
public static void launchCamera(Activity activity)
//package com.java2s; import java.io.File; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Environment; import android.provider.MediaStore; public class Main { public static int CAMERA_RESULT = 200; public static void launchCamera(Activity activity) { Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); camera.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(getFileToStoreCameraResult())); activity.startActivityForResult(camera, CAMERA_RESULT); }//from w w w . j a v a 2s . c o m public static File getFileToStoreCameraResult() { String directoryPath = Environment.getExternalStorageDirectory() + "/data/yourName/tmp/"; File directory = new File(directoryPath); if (!directory.exists()) directory.mkdirs(); String filePath = directoryPath + "camera_capture"; File file = new File(filePath); return file; } }