M
M.I.K.U
Hi at all,
anyone knows this error: ALERT: Native method
'com/sun/midp/io/NetworkConnectionBase::initializeInternal' not found! ? I
use netbeans to my debug and this is my code for connect a remote
webservice:
String getViaHttpConnection(String url) throws IOException {
HttpConnection c = null;
InputStream is = null;
StringBuffer str = new StringBuffer();
try {
c = (HttpConnection)Connector.open(url);
// Get the ContentType
//String type = c.getType();
// Getting the InputStream will open the connection
// and read the HTTP headers. They are stored until
// requested.
is = c.openInputStream(); <--- Close the emulator and show
the error in the subject!
// Get the length and process the data
int len = (int)c.getLength();
int ch;
while ((ch = is.read()) != -1) {
str.append((char)ch);
}
} finally {
if (is != null)
is.close();
if (c != null)
c.close();
}
// Before returning, the resultant String should be parsed to get
Exchange Rate
String val = str.toString();
return val;
}
anyone knows this error: ALERT: Native method
'com/sun/midp/io/NetworkConnectionBase::initializeInternal' not found! ? I
use netbeans to my debug and this is my code for connect a remote
webservice:
String getViaHttpConnection(String url) throws IOException {
HttpConnection c = null;
InputStream is = null;
StringBuffer str = new StringBuffer();
try {
c = (HttpConnection)Connector.open(url);
// Get the ContentType
//String type = c.getType();
// Getting the InputStream will open the connection
// and read the HTTP headers. They are stored until
// requested.
is = c.openInputStream(); <--- Close the emulator and show
the error in the subject!
// Get the length and process the data
int len = (int)c.getLength();
int ch;
while ((ch = is.read()) != -1) {
str.append((char)ch);
}
} finally {
if (is != null)
is.close();
if (c != null)
c.close();
}
// Before returning, the resultant String should be parsed to get
Exchange Rate
String val = str.toString();
return val;
}