fork download
  1. //開啟照相機
  2. private void start_camera(){
  3. //Specify the path of the captured image
  4. String strImage = Environment.getExternalStorageDirectory()+"/DCIM/AMAS";
  5. File myImage = new File(strImage, Calendar.getInstance().getTime()+".jpg");
  6. Uri uriMyImage = Uri.fromFile(myImage);
  7. Log.e("FILE_PATH", uriMyImage.toString());
  8. Intent intent_camera = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
  9. intent_camera.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, uriMyImage);
  10. startActivityForResult(intent_camera, OPEN_CAMREA);
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:2: error: class, interface, or enum expected
    private void start_camera(){
            ^
Main.java:5: error: class, interface, or enum expected
    	File myImage = new File(strImage, Calendar.getInstance().getTime()+".jpg");
    	^
Main.java:6: error: class, interface, or enum expected
    	Uri uriMyImage = Uri.fromFile(myImage);
    	^
Main.java:7: error: class, interface, or enum expected
    	Log.e("FILE_PATH", uriMyImage.toString());
    	^
Main.java:8: error: class, interface, or enum expected
    	Intent intent_camera = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
    	^
Main.java:9: error: class, interface, or enum expected
    	intent_camera.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, uriMyImage);
    	^
Main.java:10: error: class, interface, or enum expected
        startActivityForResult(intent_camera, OPEN_CAMREA);
        ^
Main.java:11: error: class, interface, or enum expected
    }
    ^
8 errors
stdout
Standard output is empty