Inadequate dictionary listing for mobileComposeEmail

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
howardBUSMuQ1
Posts: 10
Joined: Fri Mar 01, 2013 4:28 am

Inadequate dictionary listing for mobileComposeEmail

Post by howardBUSMuQ1 » Sat Feb 22, 2014 1:53 am

I've tried a million variations of code to send an e-mail with an image file as an attachment and cannot get it to work on Android.

The dictionary listing for mobileComposeMail is not much use because
1) it gives no example of using the attachment array with a key of 'file';
2) it gives no direction on which keys of the attachment array are necessary to use - it only states that you must have one or other of 'data' or 'file', but no mention of when to use one rather than the other and no mention at all of the keys 'type' or 'name' - these just mysteriously appear in the examples. There may be other keys which could be used, but who knows?
3) it gives no definitions of the values which are valid for 'type'

Just for the lols, here are variations of code which I know don't work. In every case where an attachment is apparently saved to the email, it is 0.00 kb. Any suggestions welcome.

-- the default folder is set to the 'documents' folder
-- the image file is saved to the documents folder (as a PNG) file with the extension .png
-- the name of the image file is put into a variable, vFileNm
-- the preceding code checks for the existence of the image file (using the vFileNm variable) in the documents folder

1.
put url "binfile:" & vFileNm into tAttachment["file"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment

2.
put url "file:" & vFileNm into tAttachment["file"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment

3.
put url "binfile:" & vFileNm into tAttachment["data"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment

4.
put url "file:" & vFileNm into tAttachment["data"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment

5.
put vFileNm into tAttachment["file"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment

6.
put vFileNm into tAttachment["data"]
put "image/png" into tAttachment["type"]
put "my picture" into tAttachment["name"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment

7.
put vFileNm into tAttachment["file"]
mobileComposeMail "Image Example", "howard@firkin.biz",,,,tAttachment

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Inadequate dictionary listing for mobileComposeEmail

Post by Simon » Sat Feb 22, 2014 2:01 am

Hi howardBUSMuQ1,
Sorry you went through so much work...
Attachments are broken on Android... It's a bug that has been documented.
I think in the most recent release it has been fixed, not really sure.

Simon
Edit Yes, it's fixed in 6.6.0 dp1. Haven't tested it yet.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

howardBUSMuQ1
Posts: 10
Joined: Fri Mar 01, 2013 4:28 am

Re: Inadequate dictionary listing for mobileComposeEmail

Post by howardBUSMuQ1 » Sat Feb 22, 2014 7:21 am

Simon wrote:Hi howardBUSMuQ1,
Sorry you went through so much work...
Attachments are broken on Android... It's a bug that has been documented.
I think in the most recent release it has been fixed, not really sure.

Simon
Edit Yes, it's fixed in 6.6.0 dp1. Haven't tested it yet.

Thank you, Simon. I'm actually a bit relieved to know it's a bug. I'd assumed I was missing something obvious (which is the usual problem).

Thanks for your reply.

Howard

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Inadequate dictionary listing for mobileComposeEmail

Post by Simon » Sat Feb 22, 2014 7:52 am

Hi Howard,
I'm seeing it popular these days to check here;
http://quality.runrev.com/
every now and then

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Inadequate dictionary listing for mobileComposeEmail

Post by Simon » Sun Feb 23, 2014 5:50 am

Hi Howard,
here are my findings
http://forums.runrev.com/viewtopic.php? ... 230#p97230

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply