Too many threads in Blackberry with Phonegap / WebWorks

I am developing a Blackberry application using Cordova / PhoneGap . I am extracting several images (map tiles) from the server. In addition, every 60 seconds I send location information.

However, from time to time, when I receive images or send information, I get an error message. If I am on a simulator (BB 9930, OS 7.0.0.318), I get an AppError 104: Too many threads message and my application crashes. When I test my application on the device (BB 8520, OS 5.0.0.5.592), the application not only disconnects, but also does BB reset.

I saw other posts with the same problem (like this , this, or this ). However, I did not find a solution when creating the application using Cordova / PhoneGap (JavaScript).

Thanks!

+8
javascript multithreading cordova blackberry blackberry-webworks
source share
3 answers

This may not be related, but I had a similar problem when executing a large request from my own application on BB Bold. After receiving the response, the connecting thread was not closed properly.

try the following:

  • change GET ↔ POST.
  • change HTTP ↔ HTTPS.

if you own the server, evaluate the change in the API to return all images as a whole and use offset / clipping when displaying them. You will save bandwidth and open fewer connections. Your application will load faster.

for example: http://www.ibloomstudios.com/articles/misunderstood_css_clip/

0
source share

I doubt the phoneGap API calls this because it is basically a layer. Perhaps you have a problem with the simulator?

0
source share

Since you are also testing the Blackberry 8520, it is recommended that you support the maximum number of MAX threads - at the same time - at any given time in the application - less than 12

Since you are using Phonegap, it is likely that it can initiate these threads for your application.

If the device is connected to your system, connect it to Blackberry JDE and see which streams are active for analysis if you can transfer your tasks.

Do you use AJAX to get map fragments and send locations to your server?

If you use AJAX, you can save the counter in JavaScript to check your requests.

Also, if you tried WebWorkers , they will let you do everything in one thread.

If all else fails, you can also develop your own Phonegap plugin to perform similar actions with the Java Script API.

0
source share

All Articles