title: Get path and imagename of recently captured image through camera
body: <p>I have to upload captured image to ftp server.I am capturing image through camera and i want to get image name and path of that image.I am using following code to get imagepath:</p>
  
  <pre><code>int ACTION_TAKE_PICTURE = 1;
  String selectedImagePath;
  Uri mCapturedImageURI;
  
  Button loadButton;
  ImageView img;
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_new_ftpsdemo);
       img = (ImageView)findViewById(R.id.image);
  
      ContentValues values = new ContentValues();
      values.put(MediaStore.Images.Media.TITLE, "yahoo.jpg");
      mCapturedImageURI  = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
      Intent intentPicture = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
      intentPicture.putExtra(MediaStore.EXTRA_OUTPUT, mCapturedImageURI);
      startActivityForResult(intentPicture,ACTION_TAKE_PICTURE);
  
  }
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if(requestCode == ACTION_TAKE_PICTURE){
          selectedImagePath = getRealPathFromURI(mCapturedImageURI);
          Log.v("selectedImagePath", selectedImagePath);
          img.setImageBitmap( BitmapFactory.decodeFile(selectedImagePath));
      }
  }
  
  
  public String getRealPathFromURI(Uri contentUri)
      {
          try
          {
              String[] proj = {MediaStore.Images.Media.DATA};
              Cursor cursor = managedQuery(contentUri, proj, null, null, null);
              int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
              cursor.moveToFirst();
              return cursor.getString(column_index);
          }
          catch (Exception e)
          {
              return contentUri.getPath();
          }
      }
  </code></pre>
  
  <p>But i am getting imagepath like this:</p>
  
  <pre><code>/mnt/sdcard/DCIM/Camera/1352443194885.jpg
  </code></pre>
  
  <p>As i am saving name  "yahoo.jpg".
  I know this may be very simple question but i am unable to get imagename and path same.
  So i am unable to upload image to ftp server.</p>