demetraniemannla2190ParticipantJuly 29, 2012 at 6:03 pm #9387
(sorry, realized this is in the wrong forum after I posted. This is about K1, not K2)Using the default setup for a universal comic app, on one Android device I get Force Closes due to running out of memory. On newer Android devices, once the app runs out of memory, all the pages stop loading and just show up as white boxes.I'm guessing this is because the Lua script generated never uses display.removeObject to remove the loaded pages. Here's my quick fix that seems to work:Modified Reader:loadPage function:Code:function Reader:loadPage( pageNum, frameNum ) if(pageNum > 0)then local pageToRemove = pageNum - 1 display.remove(self.book.pages[pageToRemove]) self.book.pages[pageToRemove] = nil pageToRemove = pageNum + 1 display.remove(self.book.pages[pageToRemove]) self.book.pages[pageToRemove] = nil endAnonymousJuly 29, 2012 at 7:30 pm #12462
The Comic project in Kwik uses Corona Comics SDK “as is” and, honestly, shouldn't be used for real projects due the several known memory issues with that. In fact, this option (comics) will not be available in Kwik 2.About your suggestion, can you please forward me your full Reader.lua file with your changes? Also, I strongly suggest your to use JPG images instead PNG. Doing that, modify line:Code:page = display.newImage( basename .. ".png" )
to ".jpg" instead.Alexdemetraniemannla2190ParticipantJuly 29, 2012 at 9:58 pm #12463
PNG is working quite well for me. My artwork has a limited palette, and using PNG-8 allows me to save almost 80% filesize compared to PNG-24 or JPG. Staying under the 50MB limit for android is pretty challenging! I sent you an email with some updated files (still under construction).AnonymousJuly 29, 2012 at 10:17 pm #12464
I know how hard is to code for Android, that's why I suggested the JPG.
You must be logged in to reply to this topic.