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
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Accessing the network using the BlackBerry Torch (9800) Smartphone Simulator

Hi all,

 

If anyone is experiencing pages not loading when using the Browser or connectivity issues in applications with the BlackBerry Torch (9800) smartphone simulator then please read this post for information on how to gain network access from the simulator.

 

*Note that this issue is not specific to this particular simulator, these same steps will need to be taken for any BlackBerry smartphone simulator to receive network access*

 

To enable internet connectivity in the BlackBerry Smartphone Simulator for use by the browser or any Java application requiring an internet connection, start the MDS Connection Service (MDS-CS) or simulate connecting the Simulator to a WLAN network.

 

1) Start the BlackBerry MDS-CS simulator

The MDS-CS simulator is included with the BlackBerry JDE, BlackBerry Java Plug-in for Eclipse or as a stand-alone installer; all available for download here. It can be started in the following ways:

 

  1. Installed with the BlackBerry JDE (from the Windows Start Menu):
    Start > All Programs > Research In Motion >  BlackBerry JDE 6.0 > MDS-CS

  2. Installed independantly:
    Start > All Programs > Research In Motion > BlackBerry Email and MDS Services Simulators 4.1.4 > MDS

  3. Start automatically when launching the simulator from the development environment:
  •  BlackBerry Java Plug-in for Eclipse:
    Run > Run Configurations > BlackBerry Simulator (select the active instance or create a new instance) > Simulator (tab) > General (sub-tab) > check "Launch Mobile Data System Connection Service (MDS-CS) with simulator"

  • BlackBerry JDE:
    Edit > Preferences > Simulator (tab) > General (sub-tab) > check "Launch Mobile Data System Connection Service (MDS-CS) with simulator"

 

2) Simulate connecting the Simulator to a WLAN network

  1. Click the banner at the top of the simulator’s screen
  2. Click Set Up Wi-Fi Network.
  3. Click Default WLAN Network.

 

After one of the two above steps are completed the smartphone simulator should have network access.

 

Important related information:

 

 

Cheers,

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Accessing the network using the BlackBerry Torch (9800) Smartphone Simulator

just to add:

if you use deviceside=true on a simulator the connection works without starting the mds-cs.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
titakalpesh
Posts: 203
Registered: ‎07-30-2009
My Device: Bold(9780),Curve(8520)
My Carrier: Vodafone

Re: Accessing the network using the BlackBerry Torch (9800) Smartphone Simulator

Hi

 

this thing is also work for below version also pleas try it because it create the tcp connection.

 

Regards,

Tita

Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Accessing the network using the BlackBerry Torch (9800) Smartphone Simulator

Thanks Simon!

 

Yes, using ;deviceside=true will simulate the Direct TCP connection allowing the simulator to connect through the computer's network without using the MDS-CS simulator.

 

As an FYI, this is essentially the same type of connection what's happening when we simulate connecting to the WLAN network, a Direct TCP connection will be used for the Browser as well as for other applications on the simulator.

 

Cheers,

 

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Contributor
rnezami
Posts: 28
Registered: ‎08-07-2010
My Device: Not Specified

Re: Accessing the network using the BlackBerry Torch (9800) Smartphone Simulator

Appreciate if you tell me where to set deviceside=true.

thx

Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Accessing the network using the BlackBerry Torch (9800) Smartphone Simulator

You can append the deviceside parameters to the target URL when making the connection. 

 

ex:

(StreamConnection)Connector.open
("socket://testserver:600;deviceside=true");

 

Taken from Different ways to make an HTTP or socket connection.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Contributor
rnezami
Posts: 28
Registered: ‎08-07-2010
My Device: Not Specified

Re: Accessing the network using the BlackBerry Torch (9800) Smartphone Simulator

Thanks. Yes, I have tried it. It has no effect, at least not for 9800. So I just use the option of launching MDS in the simulator option page and it works. But would be much easier if deviceside=true would work since MDS takes a little while to launch each time.

Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Accessing the network using the BlackBerry Torch (9800) Smartphone Simulator

The MDS-CS simulator could be left open to save having to launch it each time the simulator is run. 

 

I just tested ";deviceside=true" here and was unable to reproduce your results, the simulator was able to make the network connection successfully. Please try running the HTTPDemo sample application included with the BlackBerry SDK, point it to the following URL and see if it can fetch the page successfully:

http://www.blackberry.com;deviceside=true

 

If this does not work, does your environment require a proxy to browse to the Internet?

What operating system are you running (including whether 32 or 64 bit)?

 

Thanks,

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Developer
rishabh_jain04
Posts: 95
Registered: ‎01-25-2010
My Device: 9530

Re: Accessing the network using the BlackBerry Torch (9800) Smartphone Simulator

[ Edited ]

Hi  

 

My system is running under proxy and i have configured my MDS setting to work behind proxy and i am able to make http connection.

 

Connection refused:

Peer refused the connection

 

 

Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Accessing the network using the BlackBerry Torch (9800) Smartphone Simulator

When using Direct TCP your connection falls back to using your computer's default. Depending on how your proxy is configured your computer may not use it by default, which would explain why this connection is being refused by your network. I would suggest sticking with using the MDS-CS simulator with ";deviceside=false" appended to URLs if it is working as expected for network connections.

 

For the XMPP issue there could be a few reasons why it is happening but I will respond to that thread shortly to continue.

 

Regards,

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.