Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent,SELECT_PICTURE);

GetImage in OnActivityResult

 public void onActivityResult(int requestCode, int resultCode, Intent data)
{
        if (resultCode == RESULT_OK) {
            if (requestCode == SELECT_PICTURE) {
                Uri selectedImageUri = data.getData();
                selectedImagePath = getPath(selectedImageUri);
                Toast.makeText(this, selectedImagePath, Toast.LENGTH_LONG)
                .show();
            }
            if(requestCode == SELECT_GALLERY_PICTURE){
                Uri imageUri = data.getData();
                String imagePath = getPath(imageUri);
                Toast.makeText(this, imagePath, Toast.LENGTH_LONG)
                .show();
            }
        }
    }

    public String getPath(Uri uri) {
        String[] projection = { MediaStore.Images.Media.DATA };
        Cursor cursor = managedQuery(uri, projection, null, null, null);
        int column_index = cursor
                .getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
        cursor.moveToFirst();
        return cursor.getString(column_index);
    }

Use HTTP POST to upload on server.

- Anurag Singh


On Sat, Apr 24, 2010 at 9:05 AM, aswani kumar tholeti <[email protected]
> wrote:

>
> Hi all,
>
>
> how to store sd card image in remote server.any one please help me i posted
> this question many times
>
>
> but i am not getting any reply .it is very urgent to me
>
>
>
> Thanks in advance
>
>
> Aswan
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to