Communication between mobile phone (j2me) and pc using IrDa

M

Michal

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
 
J

JScoobyCed

Michal said:
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
-------------
 
D

Darryl L. Pierce

Michal said:
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 <[email protected]>
* @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
*/
 
D

Darryl L. Pierce

JScoobyCed said:
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 <[email protected]>
* @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
*/
 
M

Michal

JScoobyCed said:
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
 
M

MichalR

Darryl said:
Michal wrote:




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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top