{"id":5502,"date":"2014-03-30T23:15:07","date_gmt":"2014-03-30T23:15:07","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/blackberry-downloading-a-file-collection-of-common-programming-errors\/"},"modified":"2014-03-30T23:15:07","modified_gmt":"2014-03-30T23:15:07","slug":"blackberry-downloading-a-file-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/blackberry-downloading-a-file-collection-of-common-programming-errors\/","title":{"rendered":"BlackBerry downloading a file-Collection of common programming errors"},"content":{"rendered":"<p>I have a blackberry application that is downloading a file from online. Sometimes the download succeeds and other times it fails somewhere in the middle. It only seems to be a problem on the Curve 9360 device. When it fails, on the device it closes my app and shows a pop-up that says<\/p>\n<blockquote>\n<p>&#8220;Uncaught exeption Application [MyApp] is not responding; process terminated&#8221;<\/p>\n<\/blockquote>\n<p>this is the while loop that it is in when it fails:<\/p>\n<pre><code> byte data[] = new byte[1024];\n\n         try {\n            while ((count = is.read(data)) != -1) {\n                 total += count;\n                 progress = (int)(total*100\/lengthOfWebFile);\n                 if(model.getValue() &lt; progress){\n                     UiApplication.getUiApplication().invokeLater(new Runnable()\n                     {\n                         public void run()\n                         {\n                             EmbeddedMediaScreen.this.model.setValue(progress);\n                         }\n                     });\n                 }\n                 \/\/write this chunk\n                 os.write(data, 0, count);              \n             }\n        } catch (Exception e) {\n\n            e.printStackTrace();\n        }\n<\/code><\/pre>\n<p>I don&#8217;t get any kind of stack trace in the console when this happens. I get the following:<\/p>\n<pre><code>[710.328] Application BBCurve9360DemoLoop(314) is not responding; process terminated\n[710.328] \n[710.429] [0 0]\n[710.429] 0 2\n[710.429] 0 2\n[710.429] 0 2\n[710.429] 0 2\n[710.429] 0 2\n[710.429] 0 2\n[710.429] 0 2\n[710.429] 0 2\n[710.429] 0 2\n[710.429] 0 2\n[710.429] 0 2\n.[lots more \"0 2\"s]\n.\n.\n.\n[710.429] 2 203\n[710.429] 0 2\n[710.429] 0 2\n[710.429] 0 2\n[710.429] 0 2\n.[lots more \"0 2\"s\n.\n.\n<\/code><\/pre>\n<p>Has anyone run across anything like this while pro grammatically downloading a file on a blackberry device?<\/p>\n<p>Can anyone see anything in my IO loop that would cause this type of crash?<\/p>\n<p>And lastly does anyone know if there is someway that I can get an actual stack trace of whatever exception is being thrown?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a blackberry application that is downloading a file from online. Sometimes the download succeeds and other times it fails somewhere in the middle. It only seems to be a problem on the Curve 9360 device. When it fails, on the device it closes my app and shows a pop-up that says &#8220;Uncaught exeption [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5502","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5502"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5502\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}