0

I have ported my android application to BB10. In my application there is one feature where we can send email with image attachment. In android it works fine but in BB10 image is not attached to mail.

I implement custom content provider for android. So when I select any image it will give the path as "content://providername/mail/attachment/image name" but it doesn't work on BB10.

In the BB10 relative path like "content: //" is not working. BB10 only works on Absolute path.

Code sample:

Path of image: content://com.abc.provider.local.file/mail/attachment/1.jpg Uri.parse(LocalFileProvider.MAIL_FILE_URI + picture.getFileName()

  In above code

LocalFileProvider.MaIL_FILE_URL = content://com.aba.provider.local.file/mail/attachment picture.getFileName() = 1.jpg Now how to convert this path to Absolute path Example like : file://

Megha
  • 1,581
  • 2
  • 18
  • 33

1 Answers1

0

BB10 has the bar-descriptor.xml file that contains info about your app. One of the settings is the location of assets. For example - if you want to include a directory called "assets" with your package - you would have the followinf xml entry in your ..bar.xml file

<asset path="assets">assets</asset>

This assumes that you have the folder called "assets" in the root of your project.

Now you can place additional folders and files under "assets" and you can get at it by using the following URI

asset:///graphics/myimage.png

This would be an image located under /assets/graphics/myimage.png

Hope this helps.

djogon
  • 281
  • 2
  • 3