Saving to camera roll

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

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
Daveinthebigcity
Posts: 19
Joined: Wed Aug 27, 2014 12:13 am

Saving to camera roll

Post by Daveinthebigcity » Tue Oct 21, 2014 6:19 pm

Hi,
I know this problem has been posted before but I can't seem to get to the bottom of it.
I'm trying to get my android to save a photo to the gallery. I can get the native camera to launch and it allows me to take a photo and then gives me the option to save or discard. When I click save.......nothing!
Any pointers? The code examples don't seem to be in context so it's hard to see where I'm going wrong. Does anyone have any working code samples for the default android gallery?

I've used the on MouseUp command to launch the camera using mobilePickPhoto "camera" and have tried to name the templateImage both before and after the camera command with no joy. The lessons seem to lack a little depth.
Thanks in advance

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

Re: Saving to camera roll

Post by Simon » Fri Oct 24, 2014 5:20 am

Hi Daveinthebigcity,
Welcome to the forum! :)

Not sure if this helps but it's working here;
http://forums.livecode.com/viewtopic.php?f=53&t=15259

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

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

Re: Saving to camera roll

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

Simon wrote:Hi Daveinthebigcity,
Welcome to the forum! :)

Not sure if this helps but it's working here;
http://forums.livecode.com/viewtopic.php?f=53&t=15259

Simon
Hi Simon,

Its not working there. The image will only show up in the gallery after the phone is rebooted because simply putting the file there does not notify the OS to re-scan the gallery. When the phone is rebooted, the gallery is scanned at that time and thus the image will show up only after a reboot.

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

Re: Saving to camera roll

Post by Simon » Sat Oct 25, 2014 12:13 am

Hi pkocsis,
I see, when unplugging from a usb it also re-scans.

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

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

Re: Saving to camera roll

Post by pkocsis » Sat Oct 25, 2014 12:28 am

Simon wrote:Hi pkocsis,
I see, when unplugging from a usb it also re-scans.

Simon
Hi Simon,

Forgive me, but I don't understand what the usb has to do with it. I don't have my phone plugged into usb. The topic you refer to in the forum link you posted is about mobileExportImageToAlbum being broken on android. The workarounds cannot work for an app that wants to save to the gallery......unless one instructs the user of the app to reboot their phone after utilizing the workaround....or instruct the user to do some other action that forces a rescan.....I guess I'm not getting why it is assumed that the workaround to mobileExportImageToAlbum being broken is at all useful in real world apps.

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

Re: Saving to camera roll

Post by Simon » Sat Oct 25, 2014 12:49 am

Hi pkocsis,
I was just agreeing with you about the scan not happening.
My post was about why it seemed to work for me. :)

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

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

Re: Saving to camera roll

Post by pkocsis » Sat Oct 25, 2014 12:58 am

Ah! :D ...got it! Thanks Simon...

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

Re: Saving to camera roll

Post by newtronsols » Sat Oct 25, 2014 10:05 am

I struggle to understand how LC functionality is claimed for Android - but doesn't work and then the documentation is not amended to say "doesn't work on Android". if I bought a car and it said it uses either diesel or petrol but actually it only uses petrol I would imagine there would be a lot of complaints to trading standards. You could take on a Freelance project believing a project is deliverable with LC - but then find it's not - after days of costs which you could not recover from RunRev or the client. Furthermore the client would never work with you again.

Most of us [if you add up all the dead-ends pursued with LC] have spent weeks trying to get LC functionality that says it works in a certain way - but then doesn't. That's a lot of weeks of frustration.

Imagine: I say I have developed a time travel app - OK it doesn't quite work the way you imagine it should - but hey its got a clock and you travel with it, isn't that the same?

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

Re: Saving to camera roll

Post by Simon » Sat Oct 25, 2014 5:58 pm

I can't prove this but I think it may work on an Asus device...
It's the only one I've found that actually stores the photos in a folder call "Pictures" which is where the export is trying to save the images.
Can't stop the fragmentation in Android. Probably why liveCode iOS is much further ahead.
I could care less about Cocoa and wish they had been spending the time working on the widgets instead, but then there is probably something I don't know about the widgets dependency on Cocoa :roll:
Actually I just thought... Probably Cocoa has to happen to keep the base product relevant.

Hopefully the widgets will be all they say it will be then we can just use the native api MediaStore.Images.Thumbnails.getThumbnail(). But with liveCode-ish code.

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

Daveinthebigcity
Posts: 19
Joined: Wed Aug 27, 2014 12:13 am

Re: Saving to camera roll

Post by Daveinthebigcity » Mon Oct 27, 2014 7:38 pm

Thanks very much for the help. Unfortunately I'm still not getting anywhere using my Samsung Galaxy S3. :-(

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

Re: Saving to camera roll

Post by newtronsols » Thu Dec 04, 2014 12:57 am

Just wondered if you got anywhere. The forum seems to have a lot of these tales that end in unresolved. Sad that people could go away from LC disappointed their app idea fails after weeks of work over a code anomaly that never gets fixed for Android.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5113
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Saving to camera roll

Post by jacque » Thu Dec 04, 2014 7:31 pm

Livecode isn't the only app with this problem, I have others that also can't do a rescan. That's why the Play Store has utilities that allow you to force the scan without rebooting. I have one installed on all my Android devices called Rescan Media. One tap and it updates the gallery.

The problem is widespread enough that Archos actually put a command for it into their Settings app. However, there may be something RR can do to work around it. Have you submitted a request for a fix in the bug database?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Daveinthebigcity
Posts: 19
Joined: Wed Aug 27, 2014 12:13 am

Re: Saving to camera roll

Post by Daveinthebigcity » Tue Jan 27, 2015 1:48 pm

Hi,
No unfortunately I didn't get to the bottom of this. I've come to the conclusion that the mobile specific functions only work properly for ios. All of the android apps work e.g calculator app, basic card controls etc as long as you don't try to build anything using the camera, gps functions etc.
I'm sure there is a workaround if you know a lot about coding but that defeats the object of using livecode. Unfortunately the livecode team haven't given me any solutions which work and have instead directed me back to the forums.

If I have any joy I will update.
Ta

MaxV
Posts: 1574
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Saving to camera roll

Post by MaxV » Tue Jan 27, 2015 4:37 pm

Did you try to use this folder: "/mnt/sdcard2/DCIM/Camera/"?
If not work, try to close gallery app (even from memory) and reopen it. I use quickpick as gallery app.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Daveinthebigcity
Posts: 19
Joined: Wed Aug 27, 2014 12:13 am

Re: Saving to camera roll

Post by Daveinthebigcity » Wed Feb 18, 2015 11:35 am

Thanks. I will take a look :-)

Post Reply

Return to “Android Deployment”