I am connecting to a web server from a BlackBerry simulator for the 9630, to get an image and display it on screen.
But while testing this same app in the 8520 and 9700 simulators, it doesn’t work. I think it didn’t connect to the web service.
I need to be able to connect to a web service from all simulators.
String filepath="file:///store/home/user/loan1.jpg";
FileConnection fc = (FileConnection)Connector.open(filepath,Connector.READ_WRITE);
String photoXml=
"<MortgageGetPhoto><LoanOfficerID>82</LoanOfficerID></MortgageGetPhoto>";
byte[] imgArry=
Base64InputStream.decode(new DataParsingComm().ILGetImage(photoXml));
EncodedImage image = EncodedImage.createEncodedImage(imgArry,0,imgArry.length);
BitmapField bitf=new BitmapField() {
public void layout(int width, int height) {
super.layout(100, 100);
}
};
bitf.setImage(image);
HorizontalFieldManager bfm = new HorizontalFieldManager(FIELD_HCENTER);
bfm.add(bitf);
add(bfm);
It seems you should verify this before asking your question. Set a breakpoint in the debugger, and see where code execution fails.