mobileExportImageToAlbum broken?

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
pkocsis
Posts: 105
Joined: Sat Apr 15, 2006 7:20 am

mobileExportImageToAlbum broken?

Post by pkocsis » Fri May 24, 2013 9:53 am

community 6.0.1

On android, trying to export an image to album/gallery by:

put the long ID of image "myImage" into tImageID
mobileExportImageToAlbum tImageID, "my_file"

...yet I get "export failed" every time....(and YES, there is a valid 'image "myImage"')

Does mobileExportImageToAlbum not work on android? How about iOS?

Testing on a sprint Nexus S (Android 4.1.1)

EDIT: It has been suggested in other threads to "export image" to a full path such as "/sdcard/Pictures/my_file.jpg". While indeed a file can be successfully written, this workaround is not so good because (on my Nexus S 4.1.1) a "rescan" of the media library is not performed, and the newly "exported" image is not visible when going to "gallery". One must power down then up in order to make the phone "scan" for new pictures. After a re-boot, the "exported" image can indeed be seen using android's "gallery"...As part of this "export image" workaround, I've been trying to find a way to force android to "re-scan", but have failed in all attempts. (Note that when tapping "gallery", the menu key has a "refresh" option....tapping that option does NOT force android to rescan the Pictures folder for changes)

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: mobileExportImageToAlbum broken?

Post by Mag » Sat Nov 09, 2013 4:18 pm

Under iOS, mobileExportImageToAlbum works fine. Instead I think I have the same problem with this command under Android.

PS
I think that to use "export image" command in Android you need to know exactly where to export, and maybe you need an external to do this (e.g. mergAndroid). In fact under Android, specialFolderPath LC's function, gives you only "engine", "documents" and "cache" directories.

Anyway I tried to do in that way, but maybe I'm missing something because it don't work:

Code: Select all

put mergStoragePath("pictures") into myPath -- uses mergAndroid external
answer myPath -- and the path looks like OK (maybe): /mnt/sdcard/Pictures
export image myImage of card myCard to file (myPath &"/photo34443.jpg") as JPEG -- don't work

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: mobileExportImageToAlbum broken?

Post by Mag » Sat Dec 14, 2013 2:16 pm

OK, mobileExportImageToAlbum don't work because a LiveCode bug.
The other way (using mergStoragePath - mergAndroid external) it seems does work.

Any other way to export an image/video on the Android's device camera roll?

pkocsis
Posts: 105
Joined: Sat Apr 15, 2006 7:20 am

Re: mobileExportImageToAlbum broken?

Post by pkocsis » Fri Oct 24, 2014 2:26 am

I know RR has been busy with 665 670 and 7 (and the 6.5 series before that), but as far as I can tell, mobileExportImageToAlbum has *NEVER* worked on android. Complaints and bug reports are nearly a year old.

Such a fundamental feature, and it just flat out does not work ("export failed"). I'm astonished its never been addressed....(sigh).....

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

Re: mobileExportImageToAlbum broken?

Post by Simon » Fri Oct 24, 2014 4:09 am

Hi pkocsis,
You probably don't want a workaround but... here.

Code: Select all

on mouseUp
   set the defaultFolder to "/mnt/sdcard/DCIM/"
   put image "myImage" into url("binfile:picTest.jpg")
   answer the result
end mouseUp
That will show up in the Gallery.
If loading via USB, remember to unplug it or the sd card won't show up.

Simon
Edit; For those devices that don't have an sd card you just search for DCIM in the root.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: mobileExportImageToAlbum broken?

Post by Mag » Fri Oct 24, 2014 9:53 am

pkocsis wrote:I know RR has been busy with 665 670 and 7 (and the 6.5 series before that), but as far as I can tell, mobileExportImageToAlbum has *NEVER* worked on android. Complaints and bug reports are nearly a year old.

Such a fundamental feature, and it just flat out does not work ("export failed"). I'm astonished its never been addressed....(sigh).....

I had to throw a project due to this bug, hours and hours trying to find a working workaround. Of course maybe I'm clumsy but I have not found anything really reliable to show pictures in all devices. This is the life of those who use LiveCode to make apps. :roll:

newtronsols
Posts: 192
Joined: Tue Mar 11, 2014 12:57 pm

Re: mobileExportImageToAlbum broken?

Post by newtronsols » Fri Oct 24, 2014 2:45 pm

Simon wrote:Hi pkocsis,
You probably don't want a workaround but... here.

Code: Select all

on mouseUp
   set the defaultFolder to "/mnt/sdcard/DCIM/"
   put image "myImage" into url("binfile:picTest.jpg")
   answer the result
end mouseUp
That will show up in the Gallery.
If loading via USB, remember to unplug it or the sd card won't show up.

Simon
Edit; For those devices that don't have an sd card you just search for DCIM in the root.
i tried this with the example in the bug report: http://quality.runrev.com/show_bug.cgi?id=11417

But had the message "can't open file".

pkocsis
Posts: 105
Joined: Sat Apr 15, 2006 7:20 am

Re: mobileExportImageToAlbum broken?

Post by pkocsis » Fri Oct 24, 2014 11:39 pm

Simon wrote:Hi pkocsis,
You probably don't want a workaround but... here.

Code: Select all

on mouseUp
   set the defaultFolder to "/mnt/sdcard/DCIM/"
   put image "myImage" into url("binfile:picTest.jpg")
   answer the result
end mouseUp
That will show up in the Gallery.
If loading via USB, remember to unplug it or the sd card won't show up.

Simon
Edit; For those devices that don't have an sd card you just search for DCIM in the root.
Thanks Simon but it only shows up if the phone is rebooted since this workaround does not notify the OS to re-scan. Is there some way I can fake the OS into rescanning the gallery?

Post Reply

Return to “Android Deployment”