Page 1 of 1

Saving to camera roll

Posted: Tue Oct 21, 2014 6:19 pm
by Daveinthebigcity
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

Re: Saving to camera roll

Posted: Fri Oct 24, 2014 5:20 am
by Simon
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

Re: Saving to camera roll

Posted: Fri Oct 24, 2014 11:50 pm
by pkocsis
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.

Re: Saving to camera roll

Posted: Sat Oct 25, 2014 12:13 am
by Simon
Hi pkocsis,
I see, when unplugging from a usb it also re-scans.

Simon

Re: Saving to camera roll

Posted: Sat Oct 25, 2014 12:28 am
by pkocsis
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.

Re: Saving to camera roll

Posted: Sat Oct 25, 2014 12:49 am
by Simon
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

Re: Saving to camera roll

Posted: Sat Oct 25, 2014 12:58 am
by pkocsis
Ah! :D ...got it! Thanks Simon...

Re: Saving to camera roll

Posted: Sat Oct 25, 2014 10:05 am
by newtronsols
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?

Re: Saving to camera roll

Posted: Sat Oct 25, 2014 5:58 pm
by Simon
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

Re: Saving to camera roll

Posted: Mon Oct 27, 2014 7:38 pm
by Daveinthebigcity
Thanks very much for the help. Unfortunately I'm still not getting anywhere using my Samsung Galaxy S3. :-(

Re: Saving to camera roll

Posted: Thu Dec 04, 2014 12:57 am
by newtronsols
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.

Re: Saving to camera roll

Posted: Thu Dec 04, 2014 7:31 pm
by jacque
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?

Re: Saving to camera roll

Posted: Tue Jan 27, 2015 1:48 pm
by Daveinthebigcity
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

Re: Saving to camera roll

Posted: Tue Jan 27, 2015 4:37 pm
by MaxV
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.

Re: Saving to camera roll

Posted: Wed Feb 18, 2015 11:35 am
by Daveinthebigcity
Thanks. I will take a look :-)