You want to parse the path in the Uri to produce the file path. How
they relate is up to you and your provider to decide.

Here's an example. It converts a content-type Uri into a related
internet URL that refers to a RESTful application.

    private Uri SERVER_URI = Uri.parse("http://restful-app-
authority");

    public static final Uri serverUri(Uri uri) {
        Uri.Builder b = SERVER_URI.buildUpon();
        List<String> segments = uri.getPathSegments();
        int i;
        for(i = 0; i < segments.size() - 1; ++i) {
                b.appendPath(segments.get(i));
        }
        b.appendPath(segments.get(i) + ".json");
        b.encodedQuery(uri.getEncodedQuery());
        return b.build();
    }

On Dec 30, 4:25 am, manoj <[email protected]> wrote:
> Hi all,
>
> I want to get the physical location (path) of the content uri of the
> media file.
>
> say for example, i got the content uri (content://media/external/video/
> media/25) for myvid.mp4. now I want to get the file path of that uri.
>
> How to do it?
>
> Thanks,
> Manoj.

-- 
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