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
New Developer
danietepa
Posts: 23
Registered: ‎08-06-2008
My Device: Not Specified
Accepted Solution

GPSDemo

Hi, i testing that example with a socket server. In the variable  

private static String _hostName = "XXXXXXXXXX:XXXX"  I have write the server ip.

 

In  public synchronized void setHost(String host)

{

_url = "http://" + host; // + ";deviceside=false"; // Don't use direct TCP.

this.notify(); // Notify the thread method so that any pending data can be resent.

}

 

But don´t send the position to the server?

This example is usefull for socket server?

Thx.

 

Please use plain text.
Administrator
MSohm
Posts: 14,528
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: GPSDemo

What happens when you try?  Do you receive an exception?  Are you testing in the BlackBerry Simulator or on a real device?  Are you running the server side portion of the sample?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
peter_strange
Posts: 19,603
Registered: ‎07-14-2008
My Device: Not Specified

Re: GPSDemo

Just to add to Mark's reply, if you are wanting to start a socket connection rather than an http connection, your url should begin "socket:" rather than "http:".  For further information, you should review the Connector API documentation (javax.microedition.io.Connector).
Please use plain text.
New Developer
danietepa
Posts: 23
Registered: ‎08-06-2008
My Device: Not Specified

Re: GPSDemo

I change by socket but error "tunnel error" appears.

thx.

Please use plain text.
Developer
peter_strange
Posts: 19,603
Registered: ‎07-14-2008
My Device: Not Specified

Re: GPSDemo

I normally associate tunnel errors with invalid APN information when using direct TCP, i.e. ";deviceside=false".  Can you tell us the complete URL you are now using?
Please use plain text.
New Developer
danietepa
Posts: 23
Registered: ‎08-06-2008
My Device: Not Specified

Re: GPSDemo

Url I using is _url = "socket://" + host;     In the host i have the ip adress and a port. For example: 78.123.76.3:7896

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: GPSDemo

You need to use the "APN" and "tunnelauthusername" and "tunnelauthpassword" for few carriers.

 

Refer to "javax.microedition.io.connector"

 

Example: "78.123.76.3:7896;deviceside=true;apn=wap.cingular;TunnelAuthUsername=WAP@CINGULARGPRS.COM;TunnelAuthPassword=CINGULAR1"

 

Tnq.


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
Developer
peter_strange
Posts: 19,603
Registered: ‎07-14-2008
My Device: Not Specified

Re: GPSDemo

So you do not have a ;deviceside= in your URl?  I suggest you review the following:

 

What Is - Different ways to make an HTTP or socket connection
Article Number: DB-00396

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

 

I see while researching this that BBDeveloper has added a comment.  Further to that, you can specify the APN options in the BlackBerry Options.  You will find it here:

Options-->Advanced-->TCP

Please use plain text.
New Developer
danietepa
Posts: 23
Registered: ‎08-06-2008
My Device: Not Specified

Re: GPSDemo

Thanks, I change deviceside=true and configure APN and working properly.

Thx.

Please use plain text.