BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-25-2010, 06:38 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: 7100
PIN: N/A
Carrier: Dev
Posts: 19
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default HTTP Connection

Please Login to Remove!

Hello,

HttpConnection connection = null;
connection =(HttpConnection) Connector.open(url, Connector.READ_WRITE, true);
connection.setRequestMethod(HttpConnection.GET);
// connection.setRequestProperty("Content-Type","application/vnd.syncml+xml");
// connection.setRequestProperty("Content-Length",String.valueOf(0));
// connection.setRequestProperty("User-Agent","Profile/microedition.profiles Configuration/microedition.configuration");
// connection.setRequestProperty("Content-Language","microedition.locale");

));


try
{
InputStream iStream = connection.openInputStream();
}catch(Exception e)
{
e.printStackTrace();
System.out.println("Connection getResponseCode==="+connection.getResponseCode());
System.out.println("Connection Establish==="+e.getMessage());
}
System.out.println("Connection Establish===");

ByteArrayOutputStream baos = new ByteArrayOutputStream();

byte[] buffer = new byte[10000];
int bytesRead = inputStream.read(buffer);
while (bytesRead > 0) {
baos.write(buffer, 0, bytesRead);
bytesRead = inputStream.read(buffer);
}
baos.close();
String result=baos.toString();
ByteArrayInputStream bais =
new ByteArrayInputStream(result.getBytes());


Http connection is not Establishing from this code
Am tring in Black Berry simulator
Is there Need any settings for HTTP Connection

Thanks in adv
Venkatesh
Offline  
Old 06-25-2010, 07:43 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

You should be running the MDS simulator also. MDS emulates a BB device connected to a BES network.
Offline  
Old 06-26-2010, 09:05 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: 7100
PIN: N/A
Carrier: Dev
Posts: 19
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for Solution,,
I tried it and got it.
MDS server is intermediate between net and simulator is it wright?
Offline  
Old 06-26-2010, 09:09 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: 7100
PIN: N/A
Carrier: Dev
Posts: 19
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Data base connection

I have tried Database demo..
Black berry with Sqllite...
In simulator it showing database connected...
But i don't know where the database and how to insert,retrieve,update.
What is SDCard?

How to connect database in localally?

For Database connection any settings need to configure.

please help me...

Thanks in adv,

Venkatesh
Offline  
Closed Thread


Thread Tools

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

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





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.