Attaching image to email on Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Sevak Ajemyan
Posts: 5
Joined: Mon Jun 06, 2016 12:09 pm

Attaching image to email on Android

Post by Sevak Ajemyan » Mon Jun 06, 2016 2:50 pm

Hi there,

I am using mergPopActivity external to attach an image to an email or share it via social sites. This works correctly and opens the email application, but I get an error "Permission denied for the attachment" when sending the email.

Can you please review the code and let me know if there is any solution to this ?

Code: Select all

 try
      put "" into tText
      put "" into tUrl
      export the last image of card "sendpostcard" to url ("binfile:"&specialFolderPath("documents")&"/postcardimage.jpg") as jpeg
      put specialFolderPath("documents")&"/postcardimage.jpg" into tImage

      mergPopActivity tText,tImage,tUrl
      
      answer the result
      
      --answer it 
   catch e
      --answer e
   end try
Thanks in advance,

Sevak

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Attaching image to email on Android

Post by Klaus » Mon Jun 06, 2016 3:10 pm

Hi Sevak,

1. welcome to the forum! :D

2. Please try again with the correct "export snapshot" syntax!
...
## export the last image of card "sendpostcard" to url ("binfile:"&specialFolderPath("documents")&"/postcardimage.jpg") as jpeg
export last image of card "sendpostcard" to FILE (specialFolderPath("documents")&"/postcardimage.jpg") as jpeg
...

If in doubt, ALWAYS take a look into the dictionary!


Best

Klaus

Sevak Ajemyan
Posts: 5
Joined: Mon Jun 06, 2016 12:09 pm

Re: Attaching image to email on Android

Post by Sevak Ajemyan » Mon Jun 06, 2016 4:01 pm

Hi Klaus,

Thank you for qick response. The problem isn't with exporting the image, it works both in the code you provided and the one I posted. The two codes easily export the image into a folder but the problem is that the image isn't possible to send via email. It still shows the error.

The same code works great on IOS with mergeIOS.lcext external, problem occurs only on Android with mergAndroid.lcext external.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Attaching image to email on Android

Post by Klaus » Mon Jun 06, 2016 4:47 pm

Aha, OK, maybe a bug in the Android external?
Sorry, I do not develop for mobile...

Post Reply