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
Super Contributor
Posts: 253
Registered: ‎08-19-2010
My Device: BB10, Playbook, 9900, 9800, 9700, 9550, 9530, 9500, 8700.
My Carrier: TT

How to run D:\eclipse-SDK-3.6.2-win32\eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\server\socketdemo

Purpose:

test the socketdemo on blackberry and then connect to a PC with Eclipse/plugin/.../SimpleSocketServer.java

 

How to run D:\eclipse-SDK-3.6.2-win32\eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\server\socketdemo

 

This is really a noob question. How do I run the server-end application in order to make socketdemo work.

 

Thanks your attention,

 

 

-Fight with BB10
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to run D:\eclipse-SDK-3.6.2-win32\eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\server\socketdemo

Opening the run.bat file should do the trick Smiley Wink. If that fails let me know if you get any errors etc (check that the Java command is available from the command-line too).

Garett
@garettBeuk
--
Goodbye everybody!
Super Contributor
Posts: 253
Registered: ‎08-19-2010
My Device: BB10, Playbook, 9900, 9800, 9700, 9550, 9530, 9500, 8700.
My Carrier: TT

Re: How to run D:\eclipse-SDK-3.6.2-win32\eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\server\socketdemo

it says that javac is not an internal/external command or batch file and whatever

 


-Fight with BB10
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to run D:\eclipse-SDK-3.6.2-win32\eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\server\socketdemo

Make sure you have a JAVA_HOME environment variable set to the location of a JDK installation, this will be needed to run the batch file.

Garett
@garettBeuk
--
Goodbye everybody!
Super Contributor
Posts: 253
Registered: ‎08-19-2010
My Device: BB10, Playbook, 9900, 9800, 9700, 9550, 9530, 9500, 8700.
My Carrier: TT

Re: How to run D:\eclipse-SDK-3.6.2-win32\eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\server\socketdemo

http://stackoverflow.com/questions/7709041/javac-is-not-recognized-as-an-internal-or-external-comman...

 

http://answers.yahoo.com/question/index?qid=20090201062453AAYHuM3

 

finally, I set add a path(C:\Program Files\Java\jdk1.7.0\bin).

 

Listening for clients comes out in command line.

 

-Fight with BB10
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to run D:\eclipse-SDK-3.6.2-win32\eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\server\socketdemo

Nice! Now you just need to get the client up and running Smiley Happy

Garett
@garettBeuk
--
Goodbye everybody!
Super Contributor
Posts: 253
Registered: ‎08-19-2010
My Device: BB10, Playbook, 9900, 9800, 9700, 9550, 9530, 9500, 8700.
My Carrier: TT

Re: How to run D:\eclipse-SDK-3.6.2-win32\eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\server\socketdemo

One more quesiton.

 

My blackberry shows "Opening connection."

The server applcation shows "Listening for clients."

 

How could use the demo to do some test (such as transfer data, send a text, and so on)?

 

Thank your attention.

 

 

-Fight with BB10
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to run D:\eclipse-SDK-3.6.2-win32\eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\server\socketdemo

Definitely. You just need to change the URL used in the client sample to point to your server. I'd suggest using the computer's IP as opposed to "localhost" in the URL.

 

By default the sample will exchange a piece of information with the server then disconnect, but it can be expanded.

Garett
@garettBeuk
--
Goodbye everybody!
Super Contributor
Posts: 253
Registered: ‎08-19-2010
My Device: BB10, Playbook, 9900, 9800, 9700, 9550, 9530, 9500, 8700.
My Carrier: TT

Re: How to run D:\eclipse-SDK-3.6.2-win32\eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\server\socketdemo

Does your mean that the following line needs to be change?

 

 

//constants ---------------------------------------------------------------
private static final int PORT = 44444;
//statics -----------------------------------------------------------------
private static final String RESOURCE_PATH = "/SocketServer/src/socketserver/resources";

 

-Fight with BB10
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to run D:\eclipse-SDK-3.6.2-win32\eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\server\socketdemo

Nope, you need to modify the client, either the source or enter the IP on the smartphone each tyime it is run:

 

// Need to get the local host name from the user because access to
// 'localhost' and 127.0.0.1 is restricted.
_hostField = new EditField("Local Host: " , "");

 

Garett
@garettBeuk
--
Goodbye everybody!