Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
New Developer
Posts: 27
Registered: ‎12-31-2008
My Device: Not Specified

Cannot send UDP datagram with JDE 4.5

Eclipse SDK Version: 3.4.1

BlackBerry JDE Plug-in for Eclipse Version:  1.0.0.50

BlackBerry JDE Component Pack Version:  4.5.0.14

 

The following code will work on JDE 4.2 but not on 4.5. The code throws a java.io.IOException (detailMessage=null) at the send operation.

 

 

import javax.microedition.io.Connector;
import javax.microedition.io.Datagram;
import javax.microedition.io.DatagramConnection;

public class UdpTxMgr implements Runnable {
    Thread udpTxThd;
    DatagramConnection udpTxCon;
    Datagram outDatagram;
    byte[] txBody = {65,66,67,68};

  public void sendDatagram() {
        // Spawn a thread to do the sending.
        udpTxThd = new Thread(this, "udpTxThd");
        udpTxThd.start();
    }

  public void run() {
        try {
            udpTxCon = (DatagramConnection) Connector.open("udp://192.168.0.113:1700;1701");
            outDatagram = udpTxCon.newDatagram(txBody, txBody.length);
            udpTxCon.send(outDatagram);
        } catch (Exception e) {
            System.out.println("Error (UdpTxMgr): " + e.getMessage());
        }
    }
}

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Cannot send UDP datagram with JDE 4.5

This is a known issue in early 4.5.0.x versions of BlackBerry handheld software.  It is fixed in version 4.5.0.83 and higher.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 27
Registered: ‎12-31-2008
My Device: Not Specified

Re: Cannot send UDP datagram with JDE 4.5

Thanks.

 

Where can I find JDE 4.5.0.83? I've searched the developer site (www.BlackBerryDeveloper.com) I'm using eclipse. Is there a component pack for eclipse?

Retired
Posts: 76
Registered: ‎07-11-2008
My Device: Z10
My Carrier: SingTel

Re: Cannot send UDP datagram with JDE 4.5

The issue is in the handheld software not the JDE version. You can either try to test your application on a real device that has handheld software 4.5.0.83 or higher or alternatively you could install and debug against a device simulator which is higher than 4.5 from the following link:

https://www.blackberry.com/Downloads/browseSoftware.do

Sarim
BlackBerry Development Advisor
www.BlackBerryDeveloper.com
New Developer
Posts: 27
Registered: ‎12-31-2008
My Device: Not Specified

Re: Cannot send UDP datagram with JDE 4.5

I was able to get my application working with a 9000 simulator running 4.6.0.190. I need to test it on an 8800. I have an 8800 simulator but it has device software 4.5.0.55.

 

1) How can I get a simulator for 4.5.0.83 or higher?

 

2) My network is Rogers and the highest device software that I can find is 4.5.0.81. Can I load 4.5.0.83 or higher on my 8800 on the Rogers network? If s, how?

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Cannot send UDP datagram with JDE 4.5

Currently, the highest 4.5.0 version of BlackBerry Simulator available is 4.5.0.55.

 

Regarding your actual BlackBerry handheld, you can contact Rogers to see when/if they plan to release a software update.  These releases are controlled by the carriers.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 27
Registered: ‎12-31-2008
My Device: Not Specified

Re: Cannot send UDP datagram with JDE 4.5

Thanks.

 

There seems to be some confusion over version numbering. On the Rogers website they advertise software v4.5.0.108 but when that is loaded the device shows v4.5.0.81 under Options->About. Can you explain the difference?

 

When you refer to v4.5.0.83 is that the version that I should see under Options->About?

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Cannot send UDP datagram with JDE 4.5

The version I am referring to is the BlackBerry application version shown under Options, About on the BlackBerry handheld.

 

Rogers appears to be reporting the bundle version on their website, which represents the BlackBerry application and platform versions packaged together.  These individual elements can be seen on the About screen.  The bundle version is not listed within the BlackBerry handheld itself.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 27
Registered: ‎12-31-2008
My Device: Not Specified

Re: Cannot send UDP datagram with JDE 4.5

Thanks again.

 

Since I'm developing a new application I have the luxury of choosing the platform. I have ordered a Bold and it will be used primarily on the Rogers network. I would really like the ability to debug the application on the device itself but that requires the device and the simulator to be running the same version of software. It looks like Rogers lists v4.6.0.162 for the Bold. Can I get the matching simulator? If so, how? If not, is there any way I can upgrade my simulator?

Retired
Posts: 76
Registered: ‎07-11-2008
My Device: Z10
My Carrier: SingTel

Re: Cannot send UDP datagram with JDE 4.5

You are able to debug your application running on the live device. Please see the following knowledgebase article:

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800901/How_To_-_Debug...

Sarim
BlackBerry Development Advisor
www.BlackBerryDeveloper.com