views:

71

answers:

2

I am busy working on a java app to run on blackberries but on some devices i am testing on, the code does not seem to be working and im having a hard time pinpointing where the problem lies.

My question is: Could the problem with some phones working and not working have to do with the type of network they are running on such GSM vs CDMA and would the code that stops working on some devices be in one of the following areas:

1) Listeners - such as MessageListener and Phone Listener

2) UI Objects - simple test labels and buttons

3) Connection to a web service using ksoap2

The app basically listens for call and sms records and then sends them to a web service. The problem i am getting is that on some devices, i see nothing coming into the web service. I cant really actively debug this easily on the phone as it is running as a test on a device in the u.s (im in south africa) so i'm just wondering if I could get some explanation easily without having to test on the phone over and over to see what happens.

I have developed with v4.7 and devices in the U.S with v4.6 and v5.0 have worked and another pair of devices (v4.6 and v5.0) have not so i dont think its a version problem.

A: 

GSM vs CDMA would not have a (direct) difference. OS can make a difference but you have tested that. If the device is attached to a BES (Blackberry Enterprise Server) that could have an effect if there is a security policy being pushed down to the device.

However I have a feeling it may have to do with your code not checking for all error conditions, and thus not giving you the expected behavoir when the Blackberry encounters poor network conditions, or the web server is under high load and can't respond, or any other errors that can result with a web site (again a BES may be an issue, blocking access to your website).

For example does your code look this this:

if(call received)
  Create Web Request
  Add call parameters to Web Request
  Execute Web Request

Or does it look like this:

if(call received)
  Add call parameters to queue

if(parameters still in queue)
  Create Web Request
  Add parameters to Web Request
  Execute Web Request
  if(request was successful)
     Remove parameters from queue
David
My code is as in your second example however i'm not sure how to check for successful sending to the web service. I am using ksoap2 which uses the HTTPTransport's call method which is a void type method.
Chris
+1  A: 

If you are using the Direct TCP transport, then GSM phones often need to include the network's APN in the URL's connection parameters. This is the biggest pain-point of using Direct TCP. Some GSM carriers do set the APN in the device settings from the factory, but many still do not and it's up to the application to do it (or have the end-user enter the APN values into the device settings).

If you don't want to deal with figuring out the APN for every mobile network you plan on supporting, then you may want to use another transport such as WAP2 (which isn't always available on all devices) or BIS (which requires a membership to the BlackBerry Alliance program).

Marc Novakowski