Network access

Discussion in 'Questions (Windows Mobile)' started by skipper, Feb 18, 2008.

  1. skipper

    skipper Member Licensed User

    Hello all,

    I'm trying to use the Network.dll to connect the PDA with a PC in the company network. I need to read/write to a SqLite db in a shared forlder on the PC acting as a server.

    The PC as been defined as accepting incoming connection from inside a VPN (but I'm not sure if this is the right configuration: this is the only way I've found to acces the PC using the File Explorer).

    Using the Client.GetIP("MA-MASTER-XX") (where MA-MASTER-XX is the PC name) I get the right IP address (192.168.157.57).

    Now the question are:
    1) how to check if the Wi-Fi is enabled?
    2) How to check if the connection is established?

    Is someone here that could please give me any input?

    Many thanks

    Mimmo
     
  2. Cableguy

    Cableguy Expert Licensed User

    the easyest way would be to check the pc folder for a known file...if the file was not found, then the conection was not successfull...
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    If Client.GetIP returns the server IP then Wi-Fi is enabled and the network is detected.

    Other options to download the file:
    - If your server supports FTP or HTTP downloads you could use those.
    - Create a small application on the server that waits for the device connection and then sends the file.
    See the Chit-Chat and FileTransfer examples: http://www.basic4ppc.com/Downloads.html
     
  4. skipper

    skipper Member Licensed User

    Thanks you Paulo & Erel!

    your solution, Erel, is what I was thinking about... just a kind of "service" running on the server and waiting for incoming connection.

    What do you think about using the Hardware.dll events
    - evNetConnected
    - evNetDisconnected
    for testing the wi-fi on/off without running an external application with RunAppAtEvent? Could you please suggest any guideline?

    Many thanks
    Mimmo
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    These events will fire when the device connects or disconnects to a network.
    I don't think thet can help here.

    You could use GetIP and if it fails show a message like: "No network was detected. Please make sure that WiFi is enabled."
     
Loading...