Go Back   BlackBerry Forums at CrackBerry.com > BlackBerry Professionals > Developer's Forum

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-01-2009, 05:22 AM
CrackBerry Newbie
Device Model: 9530 (Storm)
Carrier: AT&T/Cingular
 
Join Date: Jun 2009
Posts: 2
Default HTTP connection time out and component set Position problem...

Hi Everybody,



I am noobie in BlackBerry software development. I use JDE to develop the BlackBerry, and I meet the problem in Http connection and Component Set Position problem.



In the HTTP connection, I have copy one of the sample. It is pass when I build it, but no response (without error....) after I run it.

This is what I copy:

----------------------------------

HttpConnection httpConnection=null;
httpConnection = (HttpConnection) Connector.open(url, Connector.READ_WRITE);
httpConnection.setRequestMethod(HttpConnection.GET );
InputStream inputStream=null;
int responseCode = httpConnection.getResponseCode();

if (responseCode == HttpConnection.HTTP_OK) {
inputStream = httpConnection.openInputStream();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

byte[] buffer = new byte[256];
int len = 0, imageSize = 0;

while (-1 != (len = inputStream.read(buffer))) {
byteArrayOutputStream.write(buffer);
imageSize += len;
}
byteArrayOutputStream.flush();
byte[] imageData = byteArrayOutputStream.toByteArray();
byteArrayOutputStream.close();
System.out.println("----------------");
System.out.println(imageData);
System.out.println("----------------");

}

----------------------------------

The result is connection timeout..... I confirm that my url is right and it can browse by IE and FF. So I don't know what is wrong.



I know that TextField is created in the MainScreen class, but I cannot set its position. I try to use setPositionChild(object, x, y) to set the component directly. It build success but throw exception in the debugging. So I want to know how to set the component position.
Reply With Quote
  #2  
Old 06-01-2009, 06:25 AM
CrackBerry Abuser
Device Model: 9000 (Bold)
Carrier: Vodafone
 
Join Date: Oct 2008
Posts: 489
Default

Some things to think about:
* Have you specified a port, exactly as in the API?
* Have you tried connecting to a server you can packet dump the connection from?
* Have you tried creating a custom field manager?
Reply With Quote
  #3  
Old 06-01-2009, 08:31 AM
CrackBerry Newbie
Device Model: 9530 (Storm)
Carrier: AT&T/Cingular
 
Join Date: Jun 2009
Posts: 2
Default

The Connection timeout problem had been solved. That is because I don't install the MDS service. But the set Position problem still not idea......

HELP!!!~
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



 
 Site Support | Accessory Order Support | App Store Support | Advertise | Newsletter | About Us

Creating smartphone communities
Android Central - Android reviews, news and forums Crackberry - Blackberry news, reviews and community TiPb - iPhone news, accessory reviews & forums
Pre Central - Palm Pre Review, News and Community Treo Central - Treo & Centro News and Forums WMExperts - Windows Mobile Reviews & News

The names RIM and BlackBerry are registered Trademarks of Research in Motion Limited.
CrackBerry.com is in No Way Affiliated with Research in Motion Limited.
Copyright ©2007-2009 Smartphone Experts. Terms and Conditions. Privacy Policy. All rights reserved.