Tuesday, August 16, 2011

Get camera capture image path in android

Get camera capture image path in android

calling camera 
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
                    startActivityForResult(Intent.createChooser(cameraIntent,"Select Picture"), CAMERA_PIC_REQUEST1);




on result activity


 final ContentResolver cr = getContentResolver();    
                   final String[] p1 = new String[] {
                           MediaStore.Images.ImageColumns._ID,
                           MediaStore.Images.ImageColumns.DATE_TAKEN
                   };                   Cursor c1 = cr.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, p1, null, null, p1[1] + " DESC");     
                   if ( c1.moveToFirst() ) {
                      String uristringpic = "content://media/external/images/media/" +c1.getInt(0);
                      Uri newuri = Uri.parse(uristringpic);
                      Log.i("TAG", "newuri   "+newuri);
                   
                }
                   c1.close();
               
                }
then u can
get Uri path capture image
Related Posts Plugin for WordPress, Blogger...