Communication between mobile phone (j2me) and pc using IrDa

Discussion in 'Java' started by Michal, May 23, 2004.

  1. Michal

    Michal Guest

    Welcome
    I need an advice if something like this is possible at all:

    I have MIDP1.0 compatibile phone and I have written simple database
    application using J2ME and RecordStore object as a data storage.
    Now I would like to have "send to pc" button wchich will save the data
    to my PC in any form. I found that it is possible to create
    HttpConnection with a web server and perform data exchange using WAP -
    there are plenty of examples how to do it. But what if I don't have a
    web server (accessible from internet) and don't want to pay for WAP
    connections? Is it possible to exchange data between j2me app and my PC
    using for example IrDa connection (peer-to-peer) ?

    Thanks in advance
    Michal
     
    Michal, May 23, 2004
    #1
    1. Advertising

  2. Michal

    JScoobyCed Guest

    "Michal" <> wrote :

    >But what if I don't have a
    > web server (accessible from internet) and don't want to pay for WAP
    > connections? Is it possible to exchange data between j2me app and my PC
    > using for example IrDa connection (peer-to-peer) ?
    >
    > Thanks in advance
    > Michal


    Hi. I don't think you can do that using MIDP 1.0. I know it is possible
    using MIDP 2.0 as the serial communication has been included (you can use a
    Virtual COM port on your PC from your IR port).
    Another option is to install a simple web server (like the free Apache) on
    your PC. It's simple if you use the basic configuration.
    A last option is to develop a native library for your mobile (using the
    phone SDK, if any available) to do the Java-to-IrDa link. But for this I
    think it's quite complicated (though very interesting :) )

    JScoobyCed
    -------------
     
    JScoobyCed, May 24, 2004
    #2
    1. Advertising

  3. Michal wrote:

    > Welcome
    > I need an advice if something like this is possible at all:
    >
    > I have MIDP1.0 compatibile phone and I have written simple database
    > application using J2ME and RecordStore object as a data storage.
    > Now I would like to have "send to pc" button wchich will save the data
    > to my PC in any form. I found that it is possible to create
    > HttpConnection with a web server and perform data exchange using WAP -
    > there are plenty of examples how to do it. But what if I don't have a
    > web server (accessible from internet) and don't want to pay for WAP
    > connections? Is it possible to exchange data between j2me app and my PC
    > using for example IrDa connection (peer-to-peer) ?


    It's possible *only* if the the OEM has given you a
    javax.microedition.io.Connection class that works with the IR port on your
    handheld. If such is the case, then you can talk over the IR protocol to
    the PC and do what you're hoping to do.

    --
    /**
    * @author Darryl L. Pierce <>
    * @see The J2ME FAQ <http://mypage.org/mcpierce/j2mefaq.html>
    * @quote "What do you care what others think, Mr. Feynman?"
    * @geek echo '$_ = "Jvtu bopuifs Pfsm ibdlfs."; y/a-z/za-y/; print' |
    perl
    */
     
    Darryl L. Pierce, May 24, 2004
    #3
  4. JScoobyCed wrote:

    > "Michal" <> wrote :
    >
    >>But what if I don't have a
    >> web server (accessible from internet) and don't want to pay for WAP
    >> connections? Is it possible to exchange data between j2me app and my PC
    >> using for example IrDa connection (peer-to-peer) ?

    >
    > Hi. I don't think you can do that using MIDP 1.0.


    You can if the OEM has given you an irDA Connection class.

    > I know it is possible
    > using MIDP 2.0 as the serial communication has been included (you can use
    > a Virtual COM port on your PC from your IR port).


    That doesn't guarantee that the irDA port is going to be treated as a COM
    port. The spec. *suggests* it, but (as we've seen with MIDP 1.0
    implementations) OEMs are free to (and usually do) ignore such suggestions
    in favor of their own way of doing things.

    > Another option is to install a simple web server (like the free Apache) on
    > your PC. It's simple if you use the basic configuration.
    > A last option is to develop a native library for your mobile (using the
    > phone SDK, if any available) to do the Java-to-IrDa link. But for this I
    > think it's quite complicated (though very interesting :) )


    Or you can abstract that library and put a layer between your application
    and the OEM code. This, for example, is how I've written my games that need
    sound and have to run on both MIDP 2.0 devices and also SprintPCS devices.
    I have a SoundPlayer interface and have two concrete instances
    (MidpSoundPlayer and SprintSoundPlayer), one of which is determined and
    compiled in at build-time. This way, I keep one code base but can target
    different runtime functionality.

    --
    /**
    * @author Darryl L. Pierce <>
    * @see The J2ME FAQ <http://mypage.org/mcpierce/j2mefaq.html>
    * @quote "What do you care what others think, Mr. Feynman?"
    * @geek echo '$_ = "Jvtu bopuifs Pfsm ibdlfs."; y/a-z/za-y/; print' |
    perl
    */
     
    Darryl L. Pierce, May 24, 2004
    #4
  5. Michal

    Michal Guest

    JScoobyCed wrote:

    > "Michal" <> wrote :
    >
    >
    >>But what if I don't have a
    >>web server (accessible from internet) and don't want to pay for WAP
    >>connections? Is it possible to exchange data between j2me app and my PC
    >>using for example IrDa connection (peer-to-peer) ?
    >>
    >>Thanks in advance
    >>Michal

    >
    >
    > Hi. I don't think you can do that using MIDP 1.0. I know it is possible
    > using MIDP 2.0 as the serial communication has been included (you can use a
    > Virtual COM port on your PC from your IR port).
    > Another option is to install a simple web server (like the free Apache) on
    > your PC. It's simple if you use the basic configuration.
    > A last option is to develop a native library for your mobile (using the
    > phone SDK, if any available) to do the Java-to-IrDa link. But for this I
    > think it's quite complicated (though very interesting :) )
    >
    > JScoobyCed
    > -------------
    >
    >

    Thanks for the feedback. I don't think I am able to create such native
    library (even if possible - Nokia 6310i). I just gave up with that and I
    will use WWW. Maybe it's time for thinking about a better mobile - one
    with midp 2.0 :)

    regards
    Michal
     
    Michal, May 24, 2004
    #5
  6. Michal

    MichalR Guest

    Darryl L. Pierce wrote:

    > Michal wrote:
    >
    >
    >>Welcome
    >>I need an advice if something like this is possible at all:
    >>
    >>I have MIDP1.0 compatibile phone and I have written simple database
    >>application using J2ME and RecordStore object as a data storage.
    >>Now I would like to have "send to pc" button wchich will save the data
    >>to my PC in any form. I found that it is possible to create
    >>HttpConnection with a web server and perform data exchange using WAP -
    >>there are plenty of examples how to do it. But what if I don't have a
    >>web server (accessible from internet) and don't want to pay for WAP
    >>connections? Is it possible to exchange data between j2me app and my PC
    >>using for example IrDa connection (peer-to-peer) ?

    >
    >
    > It's possible *only* if the the OEM has given you a
    > javax.microedition.io.Connection class that works with the IR port on your
    > handheld. If such is the case, then you can talk over the IR protocol to
    > the PC and do what you're hoping to do.
    >


    Impossible in Nokia6310i. Now I hunger for Midp2.0 - compatibile device :)

    thanks,
    michal
     
    MichalR, May 24, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Zahoor
    Replies:
    1
    Views:
    827
    Darryl L. Pierce
    Nov 15, 2003
  2. Chris
    Replies:
    6
    Views:
    4,533
    alexvesp123
    Sep 19, 2008
  3. Replies:
    3
    Views:
    2,996
  4. Qie Tao
    Replies:
    1
    Views:
    704
    Luke Webber
    Aug 9, 2006
  5. chen selina
    Replies:
    0
    Views:
    1,359
    chen selina
    Jul 13, 2010
Loading...

Share This Page