Export a picture to internal memory of the mobilephone
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Export a picture to internal memory of the mobilephone
Hi!Maybe is banal but how can export a image from app to a folder from internal memory of the mobilephone(Android)?I want a simple example.
Thank you!
Thank you!
Re: Export a picture to internal memory of the mobilephone
Hi Razvan,
Check out the forum thread viewtopic.php?f=7&t=20444.
It's got a good explanation of how to take a picture, put it on the stack of the app, and then export that image to the mobile phone's internal memory.
Hope that helps,
Jacob
Check out the forum thread viewtopic.php?f=7&t=20444.
It's got a good explanation of how to take a picture, put it on the stack of the app, and then export that image to the mobile phone's internal memory.
Hope that helps,
Jacob
Re: Export a picture to internal memory of the mobilephone
Thank you JacobS!
mobileExportImageToAlbum don't working in my case or i don't use correct this function.
I found this code on the forum and this one working well.
mobileExportImageToAlbum don't working in my case or i don't use correct this function.
I found this code on the forum and this one working well.
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
Re: Export a picture to internal memory of the mobilephone
Hello Razvan,
The problem with simply putting the image into url("binfile:picTest.jpg") is that Android is not notified to rescan the receiving folder, and therefore the gallery app will not "see" the new pic until Android rescans. This is not a great workaround to mobileExportImageToAlbum for apps that wish to allow users to see deposited photos instantly in their gallery app since the app would have to inform the user: "OK, now reboot your phone to see the photo in your gallery app"
The problem with simply putting the image into url("binfile:picTest.jpg") is that Android is not notified to rescan the receiving folder, and therefore the gallery app will not "see" the new pic until Android rescans. This is not a great workaround to mobileExportImageToAlbum for apps that wish to allow users to see deposited photos instantly in their gallery app since the app would have to inform the user: "OK, now reboot your phone to see the photo in your gallery app"
-
- VIP Livecode Opensource Backer
- Posts: 7230
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Export a picture to internal memory of the mobilephone
The Android rescan issue doesn't just affect LiveCode, it's pretty common for many apps. I downloaded a small utility that does a rescan so I don't have to reboot the device. I'm using Rescan Media but there are probably others. It's such a common problem that my old Archos tablet had a button in its system prefs to rescan.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Export a picture to internal memory of the mobilephone
Hi Jacque,
Is the reason its common for many apps because:
A) android doesn't provide an api call to tell the OS it needs to rescan
----OR----
B) Other folks writing apps with the native android api's simply neglect making the rescan api call? (laziness on their part)
....I ask because *if* the answer is "B", then LiveCode is deficient in providing a way to let android know it needs to rescan and the fact that other developers wrote apps that simply neglect to make the call doesn't really exonerate LiveCode from not having the functionality.
Is the reason its common for many apps because:
A) android doesn't provide an api call to tell the OS it needs to rescan
----OR----
B) Other folks writing apps with the native android api's simply neglect making the rescan api call? (laziness on their part)
....I ask because *if* the answer is "B", then LiveCode is deficient in providing a way to let android know it needs to rescan and the fact that other developers wrote apps that simply neglect to make the call doesn't really exonerate LiveCode from not having the functionality.
-
- VIP Livecode Opensource Backer
- Posts: 7230
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Export a picture to internal memory of the mobilephone
I don't know. There must be some way to do it, but it might be some tricky thing these utilites use that isn't strictly an API. As far as I know, the only time the device does a rescan natively is on reboot, and otherwise you need to manually force it. You could try researching how that happens.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com