Whats the problem in this? As far as i can see, you are doing it right. May
be just remove the file:// from the beginning. I am not sure, but one of
them will definitely work.

Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com



On Tue, Jan 4, 2011 at 11:43 PM, rakshith raj <[email protected]> wrote:

> Hi fellas,
>
> I am writing a email application so need a help on the following
> problem:
>
> How to retrieve a file from path "file:///data/data/<my-app>/files/
> sam.txt"
>
> so that i can mail this file using JavaMail API
>
> here file attachment code is:
>
> public void addAttachment(String filename) throws Exception {
>
>            BodyPart messageBodyPart = new MimeBodyPart();
>            DataSource source = new FileDataSource(filename);
>            messageBodyPart.setDataHandler(new DataHandler(source));
>            messageBodyPart.setFileName(filename);
>
>            _multipart.addBodyPart(messageBodyPart);
>  }
>
> Note: I don't want the Inbuilt Email app of Android to do the above.
>
>
> --
> 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