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
Contributor
soumya_rout
Posts: 10
Registered: ‎03-07-2011
My Device: 9700
Accepted Solution

Http connection not working from my j2me application.

HI all,

I am developing a j2me based application where i need to fetch data from server so i used j2me HttpConnection classes. But its working fine in the JDE / Emulator but exception is coming when i try make httpconnection in my BB9700  handset. 

 

 

I googled around for this problem and got to add "Deviceside=true/false;" in the URL. But still it didn't work.(Tried both true/false).

 

Please anyone help me out regarding this problem.

 

Thanks in advance 

 

Developer
yosoh
Posts: 213
Registered: ‎07-18-2008
My Device: Not Specified

Re: Http connection not working from my j2me application.

[ Edited ]

would be easy to answer if you can post the exception you are getting on your device. Also check these articles:

 

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800429/How_To_...

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/627016/635020/calling...

 

 

--------------------------------------------------
problemSolved() ? kudosPlease():kudosPlease();
Contributor
soumya_rout
Posts: 10
Registered: ‎03-07-2011
My Device: 9700

Re: Http connection not working from my j2me application.

Thanks for your reply,

I have already checked these links. They didn't  help me out. 

Could you please give me any other links or codes.

Regular Contributor
gillaraz
Posts: 69
Registered: ‎10-19-2010
My Device: BB8520

Re: Http connection not working from my j2me application.

Have you try wifi connection ?

 

add  ;interface=wifi

Contributor
soumya_rout
Posts: 10
Registered: ‎03-07-2011
My Device: 9700

Re: Http connection not working from my j2me application.

[ Edited ]

I am not using WiFi network. So i don't think it would help me. 

Contributor
soumya_rout
Posts: 10
Registered: ‎03-07-2011
My Device: 9700

Re: Http connection not working from my j2me application.


yosoh wrote:

would be easy to answer if you can post the exception you are getting on your device. Also check these articles:

 

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800429/How_To_...

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/627016/635020/calling...

 

 


Its throwing IOException in device. But while i run it in emulator it works fine. Getting confused whats goin wrong :smileysad:

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Http connection not working from my j2me application.

Sorry, what you are trying to do is not straightforward:  Grab a great big cup of coffee and start here:

 

http://supportforums.blackberry.com/t5/Java-Development/Different-ways-to-make-an-HTTP-or-socket-con...

 

Then I would recommend this Thread, especially the 'Required Reading':

 

http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-c...

 

Finally try this:

 

http://supportforums.blackberry.com/t5/Java-Development/Sample-HTTP-Connection-code-and-BIS-B-Access...

 

I hope this helps. 

Contributor
soumya_rout
Posts: 10
Registered: ‎03-07-2011
My Device: 9700

Re: Http connection not working from my j2me application.

I have tried all the things but still its not working. Please anyone correct me. Where i'm goin wrong. How its ruu=nning in the emulator ? Not in the device ?

 

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Http connection not working from my j2me application.

Easy.  There are three connection method supported on the emulator:

BES (with MDS Simulator)

Direct TCP or carrier

WiFi

 

Whichever one of these methods you are using on the Simulator is not supported on the device, or at least not without some configuration.

 

So which of the three methods above are you actually using?  You will be specifying or defaulting one depending on the connection string you append to your URL.  The various articles I referenced talk about these connection strings so you should be familiar with them. 

Contributor
soumya_rout
Posts: 10
Registered: ‎03-07-2011
My Device: 9700

Re: Http connection not working from my j2me application.

I'm using BES (with MDS Simulator) in simulator. And as per your(peter_strange) articles i have changed the URL as

 

 

httpConnection = (HttpConnection) Connector.open(url+parameter+";deviceside=true");

 

 

And its working good in simulator. 

Now my device only use the BES. So I implmentd the same but its showing Connection Fail :smileysad:

My device uses Vodafone carrier but i'm not using their internet settings. I'm not getting where I went wrong.