BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-09-2010, 05:47 PM   #1 (permalink)
New Member
 
Join Date: Mar 2010
Model: 9000
PIN: N/A
Carrier: STUDENT
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Sockets with bb simulator

Please Login to Remove!

Hello

I have a problem. I wan't to establish connexion with socketconnection, but it seems don't work.

To use socket, i must install MDS? If yes can you help me, because I don't know where i can find the MDS, i have searched but there too many version.

Thanks
Offline  
Old 03-09-2010, 06:11 PM   #2 (permalink)
BBF Moderator
 
John Clark's Avatar
 
Join Date: Jun 2005
Model: Z30
OS: 10.2.1.x
PIN: s & needles
Carrier: AT&T
Posts: 34,679
Post Thanks: 4
Thanked 96 Times in 71 Posts
Default

The email simulator and mds should all be in the developer area of BlackBerry.com
Offline  
Old 03-09-2010, 06:15 PM   #3 (permalink)
BBF Moderator
 
John Clark's Avatar
 
Join Date: Jun 2005
Model: Z30
OS: 10.2.1.x
PIN: s & needles
Carrier: AT&T
Posts: 34,679
Post Thanks: 4
Thanked 96 Times in 71 Posts
Default

You need a developer login but here is the link:

https://www.blackberry.com/CorpDevZo...C80F83418E8B2D
Offline  
Old 03-09-2010, 06:42 PM   #4 (permalink)
New Member
 
Join Date: Mar 2010
Model: 9000
PIN: N/A
Carrier: STUDENT
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you verrrryy much


I have a last question. I have tried sockets and it work fine, but how I can send String, between BB application and a Server in my computer.

SocketConnexion allows only byte[] or integer?
Offline  
Old 03-09-2010, 06:44 PM   #5 (permalink)
BBF Moderator
 
John Clark's Avatar
 
Join Date: Jun 2005
Model: Z30
OS: 10.2.1.x
PIN: s & needles
Carrier: AT&T
Posts: 34,679
Post Thanks: 4
Thanked 96 Times in 71 Posts
Default

Sorry, that's above my level of developing knowledge. Hopefully, someone with more developing experience will come along with more info.
Offline  
Old 03-09-2010, 06:48 PM   #6 (permalink)
New Member
 
Join Date: Mar 2010
Model: 9000
PIN: N/A
Carrier: STUDENT
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Merci
Offline  
Old 03-09-2010, 07:08 PM   #7 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

String.getBytes()
Offline  
Old 03-11-2010, 02:50 PM   #8 (permalink)
New Member
 
Join Date: Mar 2010
Model: 9000
PIN: N/A
Carrier: STUDENT
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok I have found :

It's a class Socket to send String

PHP Code:
import java.io.InputStream;
import java.io.OutputStream;

import javax.microedition.io.Connector;
import javax.microedition.io.SocketConnection;

public class 
Socket {

    
String adresse;
    
int port;
    
SocketConnection sc;
    
OutputStream out;
    
InputStream in;

    public 
Socket(String adresseint port) {
        
this.adresse adresse;
        
this.port port;
    }

    public 
void sendMessage(String message) {

        try {
            
sc = (SocketConnectionConnector
                    
.open("socket://"+adresse+":"+port+";deviceside=true");
            
in sc.openInputStream();
            
out sc.openOutputStream();
            
out.write(message.getBytes());
            
bytexxx91;xxx93; buff = new bytexxx91;50xxx93;;
            
in.read(buff);
            
            
in.close();
            
out.close();
            
sc.close();
        } catch (
Exception e) {
            
System.out.println("Erreur");
        }

    }

Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.