Blackberry device not connecting to the internet when run on device
Please Login to Remove!
Hi,
I have a software which need to validate user name and password when user log in. The software works perfectly on the emulator but when I run the same software on the device it does not work. When I press log in button it's do nothing even no error messages. But In the emulator it send relevant information to the server and validate the user. If credentials are OK users can see the next screen. Any body please help me on this.
Here is the relevant method.
public void validateUser(strServiceURL)
{
try
{
HttpConnection connection = null;
InputStream inputStream = null;
connection = (HttpConnection) Connector.open(strServiceURL, Connector.READ_WRITE, true);
inputStream = connection.openInputStream();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse( inputStream );
Element rootElement = document.getDocumentElement();
rootElement.normalize();
if(String.valueOf(rootElement.getElementsByTagName ("status").item(0).getChildNodes().item(0).getNode Value() ).equals("TRUE"))
{
UiApplication.getUiApplication().pushScreen( new DefaultView() );
}
else
{
Dialog.alert("User Invalid.");
}
}
catch ( Exception e )
{
System.out.println( e.toString() );
}
}
The strServiceURL variable include server url with user id and password binded to the query string. When I run on the emulator I added ";deviceside=true" additionally to the URL.
Thank you.
Prasad
|