Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

[Resolved] Problems saving/loading photos from album on android
Started by noeguer_android Nov 02 2012 08:59 PM

73 replies to this topic
[TOPIC CONTROLS]
Page 1 of 3 1 2 3
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

noeguer_android

[GLOBAL: userInfoPane.html]
noeguer_android
  • Observer

  • 11 posts
  • Corona SDK

Hi,

im trying to compile my working application from IOS to android, but it doesnot work propertly, when im trying to save or load my photos from my phone the appication seems to "reboot" and start again, dunno why.

Im trying to run the media->camera application from demos directory at the simulator but it doesnot work too, its do the same, seems like the android "reboot" the application, ¿what im doing wrong?¿why that demo didnt work on my android?

android version: 4.0.4
mobile: samsung galaxy s2
java: se6
SO: Win7
uid: 185275 topic_id: 32632 reply_id: 332632


[TOPIC: post.html]
#2

noeguer

[GLOBAL: userInfoPane.html]
noeguer
  • Contributor

  • 265 posts
  • Corona SDK

I have that same phone, and i confirm it. Media ->camera application seems to launch the camera, it takes the photo but it crashs the app when the app came back...
The background stay landscape and it doesnt show any photo. Strange...
uid: 113117 topic_id: 32632 reply_id: 130620


[TOPIC: post.html]
#3

noeguer_android

[GLOBAL: userInfoPane.html]
noeguer_android
  • Observer

  • 11 posts
  • Corona SDK

yes, i already try with latest build but didnt work.

why your media->camera demo didnt work?

Android: 4.0.4
SO: w7 x64
Java: jre6
corona: CoronaSDK-2012.964.msi 11/11/2012
uid: 185275 topic_id: 32632 reply_id: 130623


[TOPIC: post.html]
#4

noeguer

[GLOBAL: userInfoPane.html]
noeguer
  • Contributor

  • 265 posts
  • Corona SDK

Dont know, it doesn't show the image and the app looks likes to reboot. Can anyone of the team check it out?
uid: 113117 topic_id: 32632 reply_id: 130624


[TOPIC: post.html]
#5

noeguer_android

[GLOBAL: userInfoPane.html]
noeguer_android
  • Observer

  • 11 posts
  • Corona SDK

please, could someone from team check it ?
uid: 185275 topic_id: 32632 reply_id: 131044


[TOPIC: post.html]
#6

noeguer

[GLOBAL: userInfoPane.html]
noeguer
  • Contributor

  • 265 posts
  • Corona SDK

I think it is better you report a bug...on top bar.
uid: 113117 topic_id: 32632 reply_id: 131103


[TOPIC: post.html]
#7

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

I just tried our sample app "Media/Camera" that is included with the Corona SDK (build #970) and it worked.

I tested it on the following devices:
- Galaxy Nexus running Android 4.0.4
- Kindle Fire HD running Android 4.0.3
- Samsung Galaxy SII running Android 2.3.4
- HTC Evo 4G running Android 2.2

If the device rebooted on you, then it sounds like the operating system crashed. That's definitely not a Corona issue. Did you root your phone? Perhaps that is the cause of the OS crash.

Or perhaps the built-in camera app itself is crashing because you are out of space on external storage? You might want to double check that. In fact, I recommend that you try your device's built-in camera app to see if it can take picture correctly as well.

okae, if you haven't tried our Camera sample app, then I suggest you give it a try "as-is". Note the build.settings file too, because it contains Android permissions that are very important to make camera functionality work.

Also, have a look at the Android log when running your app. You can do so by running the Android SDK tool "adb logcat" or "ddms". This log may provide clues as to what exactly is going wrong.
uid: 32256 topic_id: 32632 reply_id: 131185


[TOPIC: post.html]
#8

noeguer_android

[GLOBAL: userInfoPane.html]
noeguer_android
  • Observer

  • 11 posts
  • Corona SDK

I have tested your camera sample app inSamsung Galaxy s2 with android 4.0.4 firmware bulp8
Not rooted and the app is not working at all.
to save a photo i have to deprecate the first shot , take a second one...and the image saved is the first shot.really strange.
i repeat samsumng galaxy s2 with 4.0.4...please check it out.

It looks like the fuction sessionComplete doesnt recieve the image.
When i launch the camera there are only two buttons in android, save or dismiss, save saves the image to the gallery and dismiss obviously dismiss the image...but the image from the camera is not shown into the app... It reboots the app.

uid: 185275 topic_id: 32632 reply_id: 131395


[TOPIC: post.html]
#9

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

okae,

I just tried it again today. It's working for me. I can't reproduce this issue.

At this point, you are the only person who can isolate this issue. You need to look at the Android log on your device to see what's going wrong. You can do so by running the Android SDK's "adb logcat" or "ddms" tool. Look for any errors that might be coming up.

Also, I don't know what you mean by the camera is "rebooting" the app. Can you explain please? Is it crashing? Or is your app receiving an "applicationStart" system event when returning from the camera?
uid: 32256 topic_id: 32632 reply_id: 131631


[TOPIC: post.html]
#10

noeguer_android

[GLOBAL: userInfoPane.html]
noeguer_android
  • Observer

  • 11 posts
  • Corona SDK

Can you tell me if you tried it under Samsung galaxy S2 under 4.0.4 android version?
Because i cant beleive that im the only one under this issue.

I repeat, media->camera application from your demo pack under this system didnt work:
-Samsung galaxy S2 4.0.4, firmware BULP8
-Windows 7 x64
-jdk-6u37-windows-i586.exe installed
-CoronaSDK 2012.971

check out my explanation about whats happend with your applications two post above under that system...
uid: 185275 topic_id: 32632 reply_id: 131636


[TOPIC: post.html]
#11

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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".
uid: 32256 topic_id: 32632 reply_id: 131647


[TOPIC: post.html]
#12

noeguer_android

[GLOBAL: userInfoPane.html]
noeguer_android
  • Observer

  • 11 posts
  • Corona SDK

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.
uid: 185275 topic_id: 32632 reply_id: 133641


[TOPIC: post.html]
#13

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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.
uid: 32256 topic_id: 32632 reply_id: 133719


[TOPIC: post.html]
#14

marcior

[GLOBAL: userInfoPane.html]
marcior
  • Enthusiast

  • 60 posts
  • Corona SDK

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



[TOPIC: post.html]
#15

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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)



[TOPIC: post.html]
#16

marcior

[GLOBAL: userInfoPane.html]
marcior
  • Enthusiast

  • 60 posts
  • Corona SDK

Thanks! Will try this out!



[TOPIC: post.html]
#17

marcior

[GLOBAL: userInfoPane.html]
marcior
  • Enthusiast

  • 60 posts
  • Corona SDK

I triedd, but unfortunatly it makes no difference... :-(

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


[TOPIC: post.html]
#18

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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.



[TOPIC: post.html]
#19

RedBeach

[GLOBAL: userInfoPane.html]
RedBeach
  • Corona Geek

  • 1,132 posts
  • Corona SDK

[TOPIC: post.html]
#20

RedBeach

[GLOBAL: userInfoPane.html]
RedBeach
  • Corona Geek

  • 1,132 posts
  • Corona SDK

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}
 

 

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/



[TOPIC: post.html]
#21

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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



[TOPIC: post.html]
#22

RedBeach

[GLOBAL: userInfoPane.html]
RedBeach
  • Corona Geek

  • 1,132 posts
  • Corona SDK

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


[TOPIC: post.html]
#23

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

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.



[TOPIC: post.html]
#24

RedBeach

[GLOBAL: userInfoPane.html]
RedBeach
  • Corona Geek

  • 1,132 posts
  • Corona SDK

Joshua, I am already doing all that.

 

As I said, it is not only my game, but the Corona Photo Picker Sample app.

 

So, what you are saying is that Photo Picker app cannot be used more than 10 times, what does not make sense at all....

 

Imagine I am telling you that your Instagram app can only post 10 photos and after that it will restart....... actually, it would only work only 2-3 times since Instagram has a lot more assets than the Photo Picker...

 

 

In addition, I don't think that this is a out-of-memory issue since:

 

1) There is not memory warning being shown

2) I am printing here the textureMemoryUsed before going to the Album and it always prints "textureMemoryUsed= 0" (I made a simpler version of the Photo Picker without any assets, just touch to open the Album and show the image on screen)

 

But being honest with you, I am not even wanting a whole fix for that... I only want a work-around to make this works....

 

 

 

UPDATE: Since the system is killing the app, it is expected to be an out-of-memory issue. But all current indicators are not showing any sign of out-of-memory, so I only see 2 options:

1) It is not out-of-memory problem

2) There is some memory leak that is not being captured by available indicators (memoryWarning event,  textureMemoryUsed,...)

 

UPDATE 2: I forgot to mention a important info. One of my users said that the game was working fine before and after an update it started the problem (he can only open 1 image per session). And I also was only able to reproduce this error recently. So, I conclude that this bug may be introduced in some daily build....



[TOPIC: post.html]
#25

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

I'll have someone double check if there is a memory leak issue... because that PhotoPicker sample app always removes the previous image before showing the Photo Gallery.  It's either that or the garbage collector is being really lazy and we might have to force garbage collection manually to free up memory.  I'll get back to you on this later today.




[topic_controls]
Page 1 of 3 1 2 3
 
[/topic_controls]