03-05-2014 03:26 AM
After googling thoroughly I finally decided to post my problem which is really giving me nightmares.
In my app I am trying to connect to a TCP server using the Network Carrier internet and using following connection string
I am able to connect to internet through the phone's browser but not able to connect to TCP server through app.
In my device APN authentication is disabled by default and APN,Userid/Password fields are blank thats why i have taken these parameters as blank valued in the connection string.
When i try to connect through wifi network using following string
I am able to connect to server but not in the case via APN.
Please help me out..
I am just stuck here and finding no way out.
Solved! Go to Solution.
03-05-2014 07:43 AM
03-05-2014 12:17 PM - edited 03-05-2014 12:22 PM
Due to security reasons i cant reveal the IP and port so i am using dummy IP(127.0.01) and port(087) and my URL is
I am not using any '/' after port in URL which I use to connect to server using wifi but I am atill able to connect with the server.So I think issuse is not related to '/' after port number and something else is missing or wrong in the URL.
And socket:// prefix is used while connecting to TCP server and http:// prefix is used to connect to HTTP server.In my case I have to connect to TCP server thats why using socket:// as prefix
03-06-2014 02:15 AM
Finally I got the solution to the problem..
I used ConnectionFactory (Network API) to connect to TCP server and connection string used is just
No need to specify APN,username and password.
following is the code used
ConnectionFactory connFact = new ConnectionFactory(); ConnectionDescriptor connDesc; connDesc = connFact.getConnection("socket://127.0.0.1:8087");