[Resolved] Problems saving/loading photos from album on android

Yes, so far, this issue is only happening to you and “noeguer” up above.
We know for a fact that we have customers using our camera API without issue on Android.

You need to look at the Android log on your device and post the results here.
Until then, we can’t help you further. Especially since none of our device can reproduce this issue. As they say, “help us help you”. [import]uid: 32256 topic_id: 32632 reply_id: 131647[/import]

ok, problem solved.

settings->developer options->applications->dont keep activity (destroy all activity…) just uncheck it and all works fine.

Thx Joshua Quick for you help.

Lets hope this thread could help someone with the same “stupid” problem as me. [import]uid: 185275 topic_id: 32632 reply_id: 133641[/import]

Oh, that explains everything. Your device was set up to destroy the activity as soon as you leave it. Thanks for posting this. It should indeed help others. [import]uid: 32256 topic_id: 32632 reply_id: 133719[/import]

ok, problem solved.

settings->developer options->applications->dont keep activity (destroy all activity…) just uncheck it and all works fine.

Thx Joshua Quick for you help.

Lets hope this thread could help someone with the same “stupid” problem as me. [import]uid: 185275 topic_id: 32632 reply_id: 133641[/import]

Oh, that explains everything. Your device was set up to destroy the activity as soon as you leave it. Thanks for posting this. It should indeed help others. [import]uid: 32256 topic_id: 32632 reply_id: 133719[/import]

Im having this same issue.

The camera seems to be working on most devices, but some users are complaining that the game is “reestarting” once they try to take a picture. Do you think there might be another way out? Emailing all my users asking them to change configuration on their device is not an option… and so far I receive complains on this from more than 20 people already, which is lowering my evaluations on the app store!!

Please help.

Error seems to occur mostly on these devices: Galaxy Note (GT-N7000), Galaxy S 4 (jflte), Galaxy S III (m0), HTC Desire X (protou), Prestigio MultiPad 7" Pro Duo PMP5570C

I don’t think there is anything we can do about this.  This is an operating system option and your app can’t prevent the OS from shutting down your app.  But that said, this is a developer option which I’ve never seen set *on* by default.
 
That said, you may get a clue that this is happening via your launch arguments.  That is, when returning to your app from the gallery app, you should receive an Android intent in your launch arguments providing information from the gallery app.  If you can detect that, then you can at least alert the end-user to change this setting.  Just be warned that the intent information will be different when returning from different photo apps (ie: Gallery, Google+, SkyDrive, DropBox, etc.).
 
You can print everything in your launch arguments by adding the following code to your “main.lua” file…

local function printTable(table, stringPrefix) if not stringPrefix then stringPrefix = "### " end if type(table) == "table" then for key, value in pairs(table) do if type(value) == "table" then print(stringPrefix .. tostring(key)) print(stringPrefix .. "{") printTable(value, stringPrefix .. " ") print(stringPrefix .. "}") else print(stringPrefix .. tostring(key) .. ": " .. tostring(value)) end end end end local launchArgs = ... print("### --- Launch Arguments ---") printTable(launchArgs)

Thanks! Will try this out!

I triedd, but unfortunatly it makes no difference… :frowning:

Follows the log from ddms:

06-18 13:46:48.585: V/Corona(31306): > Class.forName: network.LuaLoader

06-18 13:46:48.585: V/Corona(31306): < Class.forName: network.LuaLoader

06-18 13:46:48.590: V/Corona(31306): Loading via reflection: network.LuaLoader

06-18 13:46:48.950: I/Corona(31306): loading ads … 

06-18 13:46:49.335: I/Corona(31306): [RevMob] Session started for App Id: xxx

06-18 13:46:49.340: I/Corona(31306): [RevMob] Install already registered in this device

06-18 13:46:49.400: V/Corona(31306): > Class.forName: CoronaProvider.analytics.flurry.LuaLoader

06-18 13:46:49.400: V/Corona(31306): < Class.forName: CoronaProvider.analytics.flurry.LuaLoader

06-18 13:46:49.405: V/Corona(31306): Loading via reflection: CoronaProvider.analytics.flurry.LuaLoader

06-18 13:46:49.420: I/Corona(31306): ### — Launch Arguments —

06-18 13:46:49.420: I/Corona(31306): ### androidIntent

06-18 13:46:49.420: I/Corona(31306): ### {

06-18 13:46:49.420: I/Corona(31306): ###    categories

06-18 13:46:49.425: I/Corona(31306): ###    {

06-18 13:46:49.425: I/Corona(31306): ###       1: android.intent.category.LAUNCHER

06-18 13:46:49.425: I/Corona(31306): ###    }

06-18 13:46:49.425: I/Corona(31306): ###    url: 

06-18 13:46:49.425: I/Corona(31306): ###    action: android.intent.action.MAIN

06-18 13:46:49.430: I/Corona(31306): ###    extras

06-18 13:46:49.430: I/Corona(31306): ###    {

06-18 13:46:49.430: I/Corona(31306): ###    }

06-18 13:46:49.430: I/Corona(31306): ### }

06-18 13:46:49.430: I/Corona(31306): ### url: 

06-18 13:46:49.435: I/Corona(31306): Loaded Opening

06-18 13:47:03.310: I/Corona(31306): module loaded

06-18 13:47:19.540: V/Corona(32048): > Class.forName: network.LuaLoader

06-18 13:47:19.540: V/Corona(32048): < Class.forName: network.LuaLoader

06-18 13:47:19.540: V/Corona(32048): Loading via reflection: network.LuaLoader

06-18 13:47:19.865: I/Corona(32048): loading ads … 

06-18 13:47:20.000: I/Corona(32048): [RevMob] Session started for App Id: xxx

06-18 13:47:20.000: I/Corona(32048): [RevMob] Install already registered in this device

06-18 13:47:20.025: V/Corona(32048): > Class.forName: CoronaProvider.analytics.flurry.LuaLoader

06-18 13:47:20.025: V/Corona(32048): < Class.forName: CoronaProvider.analytics.flurry.LuaLoader

06-18 13:47:20.025: V/Corona(32048): Loading via reflection: CoronaProvider.analytics.flurry.LuaLoader

06-18 13:47:20.040: I/Corona(32048): ### — Launch Arguments —

06-18 13:47:20.040: I/Corona(32048): ### androidIntent

06-18 13:47:20.040: I/Corona(32048): ### {

06-18 13:47:20.045: I/Corona(32048): ###    categories

06-18 13:47:20.045: I/Corona(32048): ###    {

06-18 13:47:20.045: I/Corona(32048): ###       1: android.intent.category.LAUNCHER

06-18 13:47:20.045: I/Corona(32048): ###    }

06-18 13:47:20.045: I/Corona(32048): ###    url: 

06-18 13:47:20.045: I/Corona(32048): ###    action: android.intent.action.MAIN

06-18 13:47:20.050: I/Corona(32048): ###    extras

06-18 13:47:20.055: I/Corona(32048): ###    {

06-18 13:47:20.055: I/Corona(32048): ###    }

06-18 13:47:20.055: I/Corona(32048): ### }

06-18 13:47:20.060: I/Corona(32048): ### url: 

06-18 13:47:20.065: I/Corona(32048): Loaded Opening

Hmm… if that’s the case, then I don’t think there is anything you and I can do about this.  The Android “intent” that the photo gallery app is sending back to your app is getting lost.  That intent contains information about the photo that was selected, and without it, there is no way to know which photo the end-user has selected.  On top of that, we can’t prevent the operating system from force quitting your application.

The only thing that I can think of is for us to add the ability to detect if the “Don’t keep activities” developer option has been checked on and for you to display a warning to the end-user to disable this option in order for this feature to work.  I can’t think of any other work-around.

Im having this same issue.

The camera seems to be working on most devices, but some users are complaining that the game is “reestarting” once they try to take a picture. Do you think there might be another way out? Emailing all my users asking them to change configuration on their device is not an option… and so far I receive complains on this from more than 20 people already, which is lowering my evaluations on the app store!!

Please help.

Error seems to occur mostly on these devices: Galaxy Note (GT-N7000), Galaxy S 4 (jflte), Galaxy S III (m0), HTC Desire X (protou), Prestigio MultiPad 7" Pro Duo PMP5570C

I don’t think there is anything we can do about this.  This is an operating system option and your app can’t prevent the OS from shutting down your app.  But that said, this is a developer option which I’ve never seen set *on* by default.
 
That said, you may get a clue that this is happening via your launch arguments.  That is, when returning to your app from the gallery app, you should receive an Android intent in your launch arguments providing information from the gallery app.  If you can detect that, then you can at least alert the end-user to change this setting.  Just be warned that the intent information will be different when returning from different photo apps (ie: Gallery, Google+, SkyDrive, DropBox, etc.).
 
You can print everything in your launch arguments by adding the following code to your “main.lua” file…

local function printTable(table, stringPrefix) if not stringPrefix then stringPrefix = "### " end if type(table) == "table" then for key, value in pairs(table) do if type(value) == "table" then print(stringPrefix .. tostring(key)) print(stringPrefix .. "{") printTable(value, stringPrefix .. " ") print(stringPrefix .. "}") else print(stringPrefix .. tostring(key) .. ": " .. tostring(value)) end end end end local launchArgs = ... print("### --- Launch Arguments ---") printTable(launchArgs)

Thanks! Will try this out!

I triedd, but unfortunatly it makes no difference… :frowning:

Follows the log from ddms:

06-18 13:46:48.585: V/Corona(31306): > Class.forName: network.LuaLoader

06-18 13:46:48.585: V/Corona(31306): < Class.forName: network.LuaLoader

06-18 13:46:48.590: V/Corona(31306): Loading via reflection: network.LuaLoader

06-18 13:46:48.950: I/Corona(31306): loading ads … 

06-18 13:46:49.335: I/Corona(31306): [RevMob] Session started for App Id: xxx

06-18 13:46:49.340: I/Corona(31306): [RevMob] Install already registered in this device

06-18 13:46:49.400: V/Corona(31306): > Class.forName: CoronaProvider.analytics.flurry.LuaLoader

06-18 13:46:49.400: V/Corona(31306): < Class.forName: CoronaProvider.analytics.flurry.LuaLoader

06-18 13:46:49.405: V/Corona(31306): Loading via reflection: CoronaProvider.analytics.flurry.LuaLoader

06-18 13:46:49.420: I/Corona(31306): ### — Launch Arguments —

06-18 13:46:49.420: I/Corona(31306): ### androidIntent

06-18 13:46:49.420: I/Corona(31306): ### {

06-18 13:46:49.420: I/Corona(31306): ###    categories

06-18 13:46:49.425: I/Corona(31306): ###    {

06-18 13:46:49.425: I/Corona(31306): ###       1: android.intent.category.LAUNCHER

06-18 13:46:49.425: I/Corona(31306): ###    }

06-18 13:46:49.425: I/Corona(31306): ###    url: 

06-18 13:46:49.425: I/Corona(31306): ###    action: android.intent.action.MAIN

06-18 13:46:49.430: I/Corona(31306): ###    extras

06-18 13:46:49.430: I/Corona(31306): ###    {

06-18 13:46:49.430: I/Corona(31306): ###    }

06-18 13:46:49.430: I/Corona(31306): ### }

06-18 13:46:49.430: I/Corona(31306): ### url: 

06-18 13:46:49.435: I/Corona(31306): Loaded Opening

06-18 13:47:03.310: I/Corona(31306): module loaded

06-18 13:47:19.540: V/Corona(32048): > Class.forName: network.LuaLoader

06-18 13:47:19.540: V/Corona(32048): < Class.forName: network.LuaLoader

06-18 13:47:19.540: V/Corona(32048): Loading via reflection: network.LuaLoader

06-18 13:47:19.865: I/Corona(32048): loading ads … 

06-18 13:47:20.000: I/Corona(32048): [RevMob] Session started for App Id: xxx

06-18 13:47:20.000: I/Corona(32048): [RevMob] Install already registered in this device

06-18 13:47:20.025: V/Corona(32048): > Class.forName: CoronaProvider.analytics.flurry.LuaLoader

06-18 13:47:20.025: V/Corona(32048): < Class.forName: CoronaProvider.analytics.flurry.LuaLoader

06-18 13:47:20.025: V/Corona(32048): Loading via reflection: CoronaProvider.analytics.flurry.LuaLoader

06-18 13:47:20.040: I/Corona(32048): ### — Launch Arguments —

06-18 13:47:20.040: I/Corona(32048): ### androidIntent

06-18 13:47:20.040: I/Corona(32048): ### {

06-18 13:47:20.045: I/Corona(32048): ###    categories

06-18 13:47:20.045: I/Corona(32048): ###    {

06-18 13:47:20.045: I/Corona(32048): ###       1: android.intent.category.LAUNCHER

06-18 13:47:20.045: I/Corona(32048): ###    }

06-18 13:47:20.045: I/Corona(32048): ###    url: 

06-18 13:47:20.045: I/Corona(32048): ###    action: android.intent.action.MAIN

06-18 13:47:20.050: I/Corona(32048): ###    extras

06-18 13:47:20.055: I/Corona(32048): ###    {

06-18 13:47:20.055: I/Corona(32048): ###    }

06-18 13:47:20.055: I/Corona(32048): ### }

06-18 13:47:20.060: I/Corona(32048): ### url: 

06-18 13:47:20.065: I/Corona(32048): Loaded Opening

Hmm… if that’s the case, then I don’t think there is anything you and I can do about this.  The Android “intent” that the photo gallery app is sending back to your app is getting lost.  That intent contains information about the photo that was selected, and without it, there is no way to know which photo the end-user has selected.  On top of that, we can’t prevent the operating system from force quitting your application.

The only thing that I can think of is for us to add the ability to detect if the “Don’t keep activities” developer option has been checked on and for you to display a warning to the end-user to disable this option in order for this feature to work.  I can’t think of any other work-around.

Yes, please do that… I already mentioned that last year…

http://forums.coronalabs.com/topic/36744-android-app-quits-when-go-to-cameraphoto-album-need-to-read-system-variable-to-solve-it/

So, this bug of the app crashing when going to Photo Album is still happening with me and is making users leave a lot of bad reviews of my game…

I finally was able to reproduce it and this bug is also happening on the Corona Photo Picker sample. I just need to select like ~9 photos and on the 10th the app restarts…

It appears that the system is killing the process even having 51% of free memory… here is a extract of the log:

03-19 14:26:39.962: D/dalvikvm(676): GC\_EXPLICIT freed 166K, 51% free 3173K/6471K, external 1596K/2108K, paused 97ms 03-19 14:26:39.993: W/GLThread(19105): onSurfaceCreated 03-19 14:26:39.993: I/RenderView(19105): OSC 03-19 14:26:40.005: D/LocalDataSource(19105): registerContentObserver 03-19 14:26:40.083: D/MediaFeed(19105): Thread End 03-19 14:26:40.091: I/RenderView(19105): \>\>\>\>\>OSC 03-19 14:26:40.091: W/GLThread(19105): onSurfaceChanged(480, 800) 03-19 14:26:40.091: I/RenderView(19105): First Draw 03-19 14:26:40.142: I/GLThread(19105): sending render notification tid=128 03-19 14:26:40.145: I/MediaItemTexture(19105): Decoding Start 03-19 14:26:40.145: I/MediaItemTexture(19105): Decoding End 03-19 14:26:40.145: I/MediaItemTexture(19105): Decoding Start 03-19 14:26:40.149: I/MediaItemTexture(19105): Decoding End 03-19 14:26:40.153: I/MediaItemTexture(19105): Decoding Start 03-19 14:26:40.153: I/MediaItemTexture(19105): Decoding End 03-19 14:26:40.157: I/MediaItemTexture(19105): Decoding Start 03-19 14:26:40.161: I/MediaItemTexture(19105): Decoding End 03-19 14:26:40.208: I/MediaItemTexture(19105): Decoding Start 03-19 14:26:40.212: I/MediaItemTexture(19105): Decoding End 03-19 14:26:40.212: I/MediaItemTexture(19105): Decoding Start 03-19 14:26:40.212: I/MediaItemTexture(19105): Decoding End 03-19 14:26:40.220: I/MediaItemTexture(19105): Decoding Start 03-19 14:26:40.220: I/MediaItemTexture(19105): Decoding End 03-19 14:26:40.224: I/MediaItemTexture(19105): Decoding Start 03-19 14:26:40.227: I/MediaItemTexture(19105): Decoding End 03-19 14:26:40.282: I/ActivityManager(523): Process com.redbeachgames.renato.PhotoPicker (pid 19078) has died. 03-19 14:26:40.282: I/ActivityManager(523): Low Memory: No more background processes. 03-19 14:26:40.282: I/WindowManager(523): WIN DEATH: Window{40954908 SurfaceView paused=false} 03-19 14:26:40.290: I/WindowManager(523): WIN DEATH: Window{409d1c50 com.redbeachgames.renato.PhotoPicker/com.ansca.corona.CoronaActivity paused=false} &nbsp;

Any ideas to solve that?

UPDATE: Since this thread is with “RESOLVED” in the title, I am opening a new one here: http://forums.coronalabs.com/topic/45599-app-being-killed-by-android-while-at-album/

It’s not a bug.  It happens if the end-user checks on the Developer Option “Don’t keep activities”.  This makes the operating system destroy the last shown activity when displaying a new activity, such as the photo album.  In Corona, this would trigger an “applicationExit” event.  From a native development stand-point, this also prevents the Activity.onActivityResult() method in Java from getting called, making it *impossible* to know which photo was selected.  But that said, this is a Developer Option on an Android device that is not accessible to most end-users.  The Developer Options menu has to be unlocked.

Regarding loading over 10 camera photos crashing your app, that’s because your app ran out of memory.  Apps are not given all of the RAM that is available on the device.  They’re is a maximum heap limit that an app can use, which varies between devices (the limit is set by the device manufacturer).  Now, Corona always checks if we’ve successfully allocated the memory needed for the image when decoding an image file and surrounds everything with try/catch blocks, but that said, OutOfMemory errors can’t always be caught reliably.  I find that some forks of the Android OS, such as the Xperia Play, just flat out kill the app when attempting to decode a PNG or JPEG giving zero opportunity to handle it gracefully.

If you’re running out of memory, my best advice is to:

  • 1st, avoid loading too many large images on Android.  There are too many cheap low-end Android devices out there, making this extremely risky.  We already have a ton of safety mechanisms in place, but there is only so much we can do.

  • 2nd, add the “largeHeap” setting to your “build.settings” file.  But just note that not all devices honor this setting and Google recommends avoid it.

   http://docs.coronalabs.com/guide/distribution/buildSettings/index.html#large-heap

I am using the Corona Photo Picker app on a Galaxy S. I am pretty sure that this problem will happen on your test devices there also…

On the Corona Photo Picker it takes 9-10 times to show the error. On my game (that has other assets) it only takes 2-4 times…

So, can i assume that there is some memory leak problem in the media.SelectPhoto function?

In addition, I added a memoryWarning listener and it is not being called anytime… 

When the app opens (after being killed) coming from the Gallery, it shows some errors also (I don’t know if they have useful info…)

03-19 14:26:41.681: I/ActivityThread(19377): Pub com.redbeachgames.renato.PhotoPicker.files: com.ansca.corona.storage.FileContentProvider 03-19 14:26:41.727: D/dalvikvm(19377): Trying to load lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/liblua.so 0x40514a98 03-19 14:26:41.735: D/dalvikvm(19377): Added shared lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/liblua.so 0x40514a98 03-19 14:26:41.735: D/dalvikvm(19377): No JNI\_OnLoad found in /data/data/com.redbeachgames.renato.PhotoPicker/lib/liblua.so 0x40514a98, skipping init 03-19 14:26:41.735: D/dalvikvm(19377): Trying to load lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libjnlua5.1.so 0x40514a98 03-19 14:26:41.739: D/dalvikvm(19377): Added shared lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libjnlua5.1.so 0x40514a98 03-19 14:26:41.743: D/dalvikvm(19377): Trying to load lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libjnlua5.1.so 0x40514a98 03-19 14:26:41.743: D/dalvikvm(19377): Shared lib '/data/data/com.redbeachgames.renato.PhotoPicker/lib/libjnlua5.1.so' already loaded in same CL 0x40514a98 03-19 14:26:41.743: I/dalvikvm(19377): threadid=1: recursive native library load attempt (/data/data/com.redbeachgames.renato.PhotoPicker/lib/libjnlua5.1.so) 03-19 14:26:41.743: D/dalvikvm(19377): Trying to load lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libopenal.so 0x40514a98 03-19 14:26:41.770: I/OpenAL\_SLES(19377): alc\_opensles\_init 03-19 14:26:41.770: D/dalvikvm(19377): Added shared lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libopenal.so 0x40514a98 03-19 14:26:41.770: D/dalvikvm(19377): Trying to load lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libmpg123.so 0x40514a98 03-19 14:26:41.782: D/dalvikvm(19377): Added shared lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libmpg123.so 0x40514a98 03-19 14:26:41.782: D/dalvikvm(19377): No JNI\_OnLoad found in /data/data/com.redbeachgames.renato.PhotoPicker/lib/libmpg123.so 0x40514a98, skipping init 03-19 14:26:41.782: D/dalvikvm(19377): Trying to load lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libvorbisidec.so 0x40514a98 03-19 14:26:41.782: D/dalvikvm(19377): Added shared lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libvorbisidec.so 0x40514a98 03-19 14:26:41.782: D/dalvikvm(19377): No JNI\_OnLoad found in /data/data/com.redbeachgames.renato.PhotoPicker/lib/libvorbisidec.so 0x40514a98, skipping init 03-19 14:26:41.782: D/dalvikvm(19377): Trying to load lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libalmixer.so 0x40514a98 03-19 14:26:41.786: D/dalvikvm(19377): Added shared lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libalmixer.so 0x40514a98 03-19 14:26:41.786: D/dalvikvm(19377): No JNI\_OnLoad found in /data/data/com.redbeachgames.renato.PhotoPicker/lib/libalmixer.so 0x40514a98, skipping init 03-19 14:26:41.786: D/dalvikvm(19377): Trying to load lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libcorona.so 0x40514a98 03-19 14:26:41.958: D/dalvikvm(19377): Added shared lib /data/data/com.redbeachgames.renato.PhotoPicker/lib/libcorona.so 0x40514a98 03-19 14:26:42.298: D/libEGL(19377): loaded /system/lib/egl/libEGL\_POWERVR\_SGX540\_120.so 03-19 14:26:42.321: D/libEGL(19377): loaded /system/lib/egl/libGLESv1\_CM\_POWERVR\_SGX540\_120.so 03-19 14:26:42.337: D/libEGL(19377): loaded /system/lib/egl/libGLESv2\_POWERVR\_SGX540\_120.so 03-19 14:26:42.427: D/dalvikvm(19377): Note: class Landroid/opengl/GLWrapperBase; has 211 unimplemented (abstract) methods 03-19 14:26:42.431: V/GLSurfaceView(19377): glGetString(7937) returns PowerVR SGX 540; 03-19 14:26:42.474: V/Corona(19377): \> Class.forName: network.LuaLoader 03-19 14:26:42.474: V/Corona(19377): \< Class.forName: network.LuaLoader 03-19 14:26:42.474: V/Corona(19377): Loading via reflection: network.LuaLoader 03-19 14:26:42.477: I/Corona(19377): Platform: GT-I9000 / ARM Neon / 2.3.6 / PowerVR SGX 540 / OpenGL ES 2.0 03-19 14:26:42.759: V/Corona(19377): \> Class.forName: CoronaProvider.licensing.google.LuaLoader 03-19 14:26:42.759: V/Corona(19377): \< Class.forName: CoronaProvider.licensing.google.LuaLoader

The issue here is that the operating system is force quitting your app because it is using too much memory.  There’s nothing not much we can do about it.  And we already go well out of our way to avoid this low memory situation by unloading all images/textures from memory when a Corona app gets suspended to avoid this very issue, because it used to be a common issue a few years ago with older memory-starved devices.

So, you really have no choice other than to redesign your app to consume less memory.  I recommend the following:

  • When selecting a photo from the gallery, have it saved to file instead of displayed.

  • When displaying all photos in your app, only display smaller thumbnails of the images which consume less memory.  You can do this by reducing the scale of the photo and then doing a display.save() on them.

  • Only display 1 photo at a time in your app at full resolution.  Free it from memory via removeSelf() and collectgarbage() in Lua before loading the next large photo.