Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
String strPath = Environment.getExternalStorageDirectory() +File.separator;
File path = new File(strPath);
if(!path.exists())
path.mkdirs();
String strFileName = "test.jpg";
String strFilePath = strPath + "/" + strFileName;
File file = new File(strFilePath);
Uri uri = Uri.fromFile(file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
startActivityForResult(intent, 1);