We can take Picture using android Default Camera Application in androids and use the captured image in our application Using Media Store Content provider API.
Here I am i will mention the Code to start the Camera Intent using MediaStore Content Provider.
Using java Syntax Highlighting
- @Override
- public void onClick(View v) {
- Intent intent2= new Intent("android.media.action.IMAGE_CAPTURE");
- startActivityForResult(intent2,INTENTCODE);
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
And write code to receive the Captured image in OnActiviy Result
Using java Syntax Highlighting
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- // TODO Auto-generated method stub
- super.onActivityResult(requestCode, resultCode, data);
- if (resultCode != RESULT_OK) {
- return;
- }else{
- Bitmap temp= (Bitmap)data.getExtras().get("data");
- mImageView.setImageBitmap(leftImage);
- }
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
If You need to Name your Image you can use this method to satrt Acivity
Using java Syntax Highlighting
- Intent intent2= new Intent("android.media.action.IMAGE_CAPTURE");
- Uri uri = Uri.fromFile(new File("tempImage"));
- intent2.putExtra(MediaStore.EXTRA_OUTPUT,uri);
- startActivityForResult(intent2,INTENTCODE);
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
Cheers..
Bins..........



