×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    121

    Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    Hello!

    I develop a Symbian Server (S60 1st, 2nd and 3rd)

    I want to provide services to FlashLite 2.0 and 2.1 Applications.

    The only available method that I have found is using HTTP.

    (Talk HTTP Server from Symbian C++ and HTTP Client from Flash Lite)

    Questions:

    1. Is there HTTP Server API for Symbian C++ anywhere?
    2. Do you think there are better IPC available?

    Thank you!

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    I think you can read a text file from Flash-Lite, thus if the communication is simple and one way, you could maybe use shared text file.

    yucca

  3. #3
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    121

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    Hello!

    I used HTTP, but acomplished bad performance (FlashLite 2.0 HTTP Stack does not use KeepAlive on Local connections).

    FlashLite 2.1, which is now available, offers XMLSocket API.

    I will test it and post results.

    Have a nice weekend!

  4. #4
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    I am now trying to do it through TCP Socket

    TCP Server written in C++,

    and

    TCP Client in Flash Lite

    I want to use command (from client to server) and XML file (from server back to client as response) for data exchanging.

    Is there any better idea for it?

  5. #5
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    121

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    I have used XML over TCP Socket using XMLSocket API and works fine. I recommend you this option.

  6. #6
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Question Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    I have now problem with Flash Lite using XMLsocket on target-device "Nokia N70".

    I wrote a simple flash lite demo, using XMLSocket to connect with TCP Server written inSymbian C++.

    ---------------------------------------------------------
    var socket:XMLSocket = new XMLSocket();

    socket.onData = function(data) {
    in_txt.text = data + in_txt.text;
    };

    socket.connect("127.0.0.1", 2001);

    send_btn.onRelease = function() {
    socket.send(out_txt.text);
    out_txt.text = "";
    }
    -------------------------------------------------------------------


    I tested on PC with Flash Player, it works ok, send tcp packet and receive packet.

    But when running on N70 Handy, it can only send packets but doesn't receive any. (Flash Lite Player 2.1)

    This Flash programm is using Flash Lite 2.0 or 2.1 and Actionscript 2.0.



    What is going wrong here?

    Thanks

  7. #7
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    121

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    This class works properly for me:
    Code:
    import TcpTransport;
    
    class XMLSocketWrapper extends XMLSocket {
    
     private var listener:TcpTransport;
     
     public function XMLSocketWrapper(listener:TcpTransport) {        
            this.listener = listener;
     }
    
     function onConnect(success) { // overwrite XMLSocket.onConnect function
    	 listener.onSocketConnect(success);
     }
    
     function onXML( xml:XML ){ // overwrite XLMSocket.onXML function
    	// A callback function that is invoked when an XML object arrives from the server
    	listener.onSocketXML(xml);
    
     }
    
    }
    Hope that helps!

  8. #8
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    Hi AlfredoRU, thanks for your code,

    but it looks difficult for me.

    what kind of class is TcpTransport ? I can't use it.


    Regards

  9. #9
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    121

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    Hi!

    TcpTransport could be any class that implements:

    1. function onSocketConnect(success:Boolean):Void

    2. function onSocketXML(xml:XML):Void

    and registers as a listener. Check this code:



    public function TcpTransport() {
    this.connected = NOT_CONNECTED;
    Logger.log("TcpTransport 1");
    // We create the object and register the listener
    this.xmlSocket = new XMLSocketWrapper(this);
    Logger.log("TcpTransport 2");

    if (!this.xmlSocket.connect("127.0.0.1", NIA_PORT)) {
    Logger.log("Connection to server failed!")
    }
    }


    ------------------------------------

    function onSocketConnect(success:Boolean):Void


    function onSocketXML(xml:XML):Void


    Bye!

  10. #10
    Nokia Developer Champion
    Join Date
    Apr 2005
    Location
    Boston
    Posts
    517

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    Ciao


    just a note, only Flash Lite 2.1 supports XML Sockets.
    Alessandro

  11. #11
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    Quote Originally Posted by biskero
    Ciao


    just a note, only Flash Lite 2.1 supports XML Sockets.
    Alessandro
    Nokia N70 supports only Flash Lite 1.1, althrought it has a Flash Lite Player 2.1, is that right?


    Thanks a lot

  12. #12
    Nokia Developer Champion
    Join Date
    Apr 2005
    Location
    Boston
    Posts
    517

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    Ciao,

    no the N70 supports all the FL players.
    It does not come with FL (only certain regions have it), you need to install it.

    Alessandro

  13. #13
    Registered User
    Join Date
    Sep 2003
    Posts
    25

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    Hi all, I'm interested in this matter as well. I'm working on a server-client application on my Nokia 6680, building up a Python server and a flashlite 2.1 client using XMLSocket.
    I have a question for you: when the FL app tries to connect to the server, it prompts users to connect to the internet, asking them to choose an access point. I think there's something wrong with it, because the server to connect is on the phone, so why should it connect to the internet?
    Do you know something about this issue?
    thanks

    best regards
    Antonio

  14. #14
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    121

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    Hello!

    I have the same problem. Let me know if you find a solution.

    Thank you.

  15. #15
    Nokia Developer Champion
    Join Date
    Apr 2005
    Location
    Boston
    Posts
    517

    Re: Communicate Symbian C++ Program and FlashLite 2.0 and 2.1 program

    Ciao

    it's not an issue. Every time you want to establish a connection, whether is to the internet or to the local server you are asking to FL player to make an network connection. So the pop up is there for security reason.

    Alessandro

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×