|
|
10-10-2007, 04:52 AM
|
#1
|
New Member
Join Date: Oct 2007
Model: 8800
PIN: N/A
Carrier: O2 UK
Posts: 2
|
Socket connection works on emulator, not on handset
Please Login to Remove!
I have created a socket application based on the sample SocketDemo included with the BlackBerry Java Development Environment.
When I run the application on the simulator, it connects to my socket server and sends data without any issues.
When I run the application on my BlackBerry 8800, the thread handling the connection sticks on the following line:
connection = (SocketConnection)Connector.open( "socket://IP:PORT;deviceside=true");
I have experimented with changing deviceside to false with no affect.
I have ensured that the application is allowed to make connections in the security settings.
Other thread posts suggest socket problems can be related to the network provider, so I put my SIM into an XDAII and ran a .NET compact framework application that connects to the same IP and port number that I am trying on the BlackBerry. This works without any issues.
I have also populated the APN settings within the advanced options on the BlackBerry, but this also seems to have no affect.
I am new to BlackBerry's and so am still finding out about the concepts of BES and MDS, but as far as I understand, as I have BlackBerry 4 and I can browse the web / use instant messaging etc. I should be able to raise a socket connection?
Any help on this much appreciated, I am definately stuck!
|
Offline
|
|
11-09-2007, 07:26 AM
|
#2
|
Knows Where the Search Button Is
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: vodafone
Posts: 37
|
Hi gjw81,
I'm in pretty much the exact situation you are in, except that I'm using an HttpConnector instead of a SocketConnector.
I'm looking in to it, and will let you know as soon as I've got an answer!
Hopefully get back to you soon.
Tig*
|
Offline
|
|
11-09-2007, 10:21 AM
|
#3
|
Knows Where the Search Button Is
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: vodafone
Posts: 37
|
Check APN
Hi,
Ok, what I'm going the solution I have found applies to the HttpConnection, but I cannot say for certain how it works. This may annoy you, as its pretty much what everyone says... but here goes.
I've several different connection classes, and I had to make sure that in each one, i've changed my url to include the:
Connection.open(url + ";deviceside=true"... other args if required);
Initially, my testing of this didnt seem to work. I had to change my APN settings. On the forums alone, there were several different APN settings written down, and as I had come to a dead end, I cycled through each of the various apn settings, and tested until I found one that worked.
The one for me was APN: internal with a password and username of web. I'm on vodafone UK.
Hope switching the APN gives you some joy, i'm sure it will work with a little tweaking.
Regards,
Tig*
|
Offline
|
|
11-19-2007, 05:38 AM
|
#4
|
New Member
Join Date: Oct 2007
Model: 8800
PIN: N/A
Carrier: O2 UK
Posts: 2
|
Thanks for the reply Tigmeister.
Yes, the APN was the answer for me as well, although changing it in the BlackBerry settings had no effect for me.
To get it to work, I had to include the APN in the call to Connector.Open, as follows:
Connector.open( "socket://IP:PORT;deviceside=true;apn=mobile.o2.co.uk")
Once I did this, all was well.
|
Offline
|
|
12-04-2007, 12:31 PM
|
#5
|
Knows Where the Search Button Is
Join Date: Dec 2007
Model: 8800
PIN: N/A
Carrier: vodafone
Posts: 21
|
Hi. i too am having this problem. where do i change the APN settings in the device? thanks
|
Offline
|
|
12-05-2007, 05:07 AM
|
#6
|
Knows Where the Search Button Is
Join Date: Dec 2007
Model: 8800
PIN: N/A
Carrier: vodafone
Posts: 21
|
anybody know how i can change the apn settings on a device? thanks in advance and hope someone can assist me in this problem
|
Offline
|
|
04-30-2008, 01:14 AM
|
#7
|
New Member
Join Date: Apr 2008
Model: 8670
PIN: N/A
Carrier: Sprint
Posts: 4
|
Socket Connection Problem
Hi,
I doing some application using Blackberry JDE. I am unable to create Socket connection to make a server connection from client and server.
Here is the sample code.
ConnectionManager connMGR = new ConnectionManager(URL);
StreamConnection conn = connMGR.getConnection();
daOut = connMGR.getDataOutputStream();
I am unable to make socket connection using this and my MDS is also on.
Kindly let me know if any one done with this.
Thanks,
Bala.
|
Offline
|
|
05-15-2008, 02:03 PM
|
#8
|
New Member
Join Date: Apr 2008
Model: 8120
PIN: N/A
Carrier: rogers
Posts: 4
|
ServerSocket no response
Hi,
I am newer of blackberry and I am trying to run up a servers ocket port on simulator 8210 and trying to connect it from a Java application side with new socket("IP",1234), on Java application side, I can get the remote Server Ip address and port number, but stop on read from inputstream, on Simulator(Server) side, there is no any response at all, code is: ServerSocketConnection scn = (ServerSocketConnection) Connector.open("socket://:1234;deviceside=true); scs = (SocketConnection) scn.acceptAndOpen(); it stop on scn.acceptAndOpen(); wont go further step. Can anybody help me this? what is wrong? do I need to set any others? I appreciate very much.
Last edited by Larry Peng; 05-15-2008 at 02:17 PM..
|
Offline
|
|
|
|