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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
grahamb314
Posts: 95
Registered: ‎03-22-2009

http get

Hi there,

 

I want to send some data like the following to a php page:

http://www.website/index.php?msg=Hello

 

How do I call this without using a web browser on the Blackberry?

 

Thanks!

 

 

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008

Re: http get

You create an HTTP connection.

 

See the HTTPDemo source that ships with the JDE sample programs, and review this sticky thread:

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=29103

 

Please use plain text.
Developer
grahamb314
Posts: 95
Registered: ‎03-22-2009

Re: http get

[ Edited ]

Hi

 

Yea I used some of the code from that example:


 

try {
s = (StreamConnection)Connector.open("http://www.website.com/index.php?msg=999999999");
httpConn = (HttpConnection)s;
}

catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

 

 However its not working.

When I go through the browser on the simulater it works fine!

 

Any thoughts?

Thanks

 

Message Edited by grahamb314 on 06-10-2009 02:11 PM
Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008

Re: http get

Did you start MDS? This is required if you are doing an HTTP connection to simulates a BES network (i.e., no connection suffix).

 

You can go direct TCP on the simulator if you add ";deviceside=false" to your URL.

 

Did you review the sticky thread I linked above? All is explained.

 

Please use plain text.
Contributor
christopherbecker
Posts: 28
Registered: ‎11-13-2012
My Carrier: 27768965251

Re: http get

Hi, how do I display the data of the php results?
Please use plain text.
Developer
simon_hain
Posts: 13,754
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: http get


RexDoug wrote:
You can go direct TCP on the simulator if you add ";deviceside=false" to your URL.

direct would be ;deviceside=true.

In any case, it is better to use http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/io/transport/ConnectionFactory...

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.