Skip to main content
September 6, 2013
Question

ios app crash after download due to low memory in ipad 1

  • September 6, 2013
  • 1 reply
  • 1161 views

my ios application download some .zip files and then start unzip. if .zip file is higher than 50MB, program crash after downloading. i can see it is fully downloaded in progress event but complete event cannot dispatch. also app crash when zip file is higher than 150MB in ipad 3.

This topic has been closed for replies.

1 reply

Adobe Employee
September 6, 2013

Could you please share code snippet or sample application to reproduce the problem. Also, please share the iOS and AIR SDK version you are using?

Regards,

Nimit

September 6, 2013

air 3.7

ios 6.3  

     //download button click:

               ...

                        loader.dataFormat = URLLoaderDataFormat.BINARY;

                        loader.load(selectedContent.fileurl);

                        loader.addEventListener(ProgressEvent.PROGRESS, downloadProgress);

                        loader.addEventListener(Event.COMPLETE, downloadComplete);

               ...

private function downloadProgress(event:ProgressEvent):void
{


loadingText.text = lang.getWord("player.mobile.downloading") + Math.round(event.bytesLoaded / 1024) + "/" + Math.round(event.bytesTotal / 1024);




}

private function downloadComplete(event:Event):void

        {

         

            var fileName:String = "z" + downloadContent.loid.toString() + ".zip"; // new String(downloadContent.fileurl).split("/").pop();

            //call the saveLocally function; loader.data has the bytes of the loaded resource

         

            saveLocally("zip/" + fileName, loader.data);

           

            loadingText.text = lang.getWord("player.mobile.downloadFinished");

            loader.close();

            loader == null;

            try

            {

                unzipFile("zip/" + fileName);

               

            }

            catch (err:Error)

            {

                loadingText.visible = false;

                downloadContent = null;

                UI.hideActivityIndicator();

               

                Warn(lang.getWord("player.mobile.downloadError"));

               

                refreshList();

            }

        }

Participating Frequently
September 8, 2013

Are you sure that you are not just running out of memory on whatever iPad you are testing it? If you fill up the RAM memory, your iPad crashes and that's quite normal...