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
New Contributor
Posts: 2
Registered: ‎08-04-2011
My Device: Bold 9900
My Carrier: newbi mobile developer

getResponseCode= 0 for onyx 2 (9780)

Anyone can help,
My app can't running on 9780
when the app try connect to server, responseCode form server = 0, so throw into exception.
only at 9780, for other device no problem... 

Regards,

Florencia.

Regards,

Florensia.
Contributor
Posts: 46
Registered: ‎07-30-2010
My Device: Bold
My Carrier: 9700

Re: getResponseCode= 0 for onyx 2 (9780)

can you give example of your code and explain what you're trying to do?

Highlighted
New Contributor
Posts: 2
Registered: ‎08-04-2011
My Device: Bold 9900
My Carrier: newbi mobile developer

Re: getResponseCode= 0 for onyx 2 (9780)

try {

String type = "application/x-www-form-urlencoded";
Customurl = ServerConnection.getUrlBySettingInetConverage(URL_LOGIN);


connection = (HttpConnection) Connector.open(Customurl);
connection.setRequestMethod(HttpConnection.POST);
connection.setRequestProperty("Content-Type", type);
connection.setRequestProperty("Content-Language", "en-US");
connection.setRequestProperty("Content-Length", Integer.toString(inputparamByte.length));

os = connection.openOutputStream();
os.write(inputparamByte);

int responseCode = connection.getResponseCode();

} catch (Exception ex) {
throw new Exception(ex.getClass() + " "  + ex.getMessage() + " "+ServerConnection.getErrorCode());
				
} finally {
try {
		inputStream.close();
		inputStream = null;
	    } catch (Exception e) {
	    }
				
				try {
					os.close();
					os = null;
				} catch (Exception e) {
				}
				
				try {
					connection.close();
					connection = null;
				} catch (Exception e) {
				}
			}

 

 

Regards,

Florensia.