Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / December 2005

Tip: Looking for answers? Try searching our database.

Midlets with Serial Port

Thread view: 
Rishi PIdva - 13 Dec 2005 02:10 GMT
Hi,

I wish to use J2ME for development on PDA and cellphones. After a lot of
search, I still have few things unclear. I would REALLY appreciate some
thoughts/insight on these. I have fair bit of experience in Java and lot
of background in programming in general.

I will describe the basic requirements first:
We wish to connect our PDA to a serial (RS232) device to read serial
data which would be then transferred to PC over wireless network. The
wireless network needs to be secure, preferably SSL.

1) Which virtual machine will be the best? I dont mind using
PersonalJava instead of J2ME for the same.

2) Also I noticed than MIDP 2.0 has https connection etc but most of the
devices doesn't support MIDP 2.0 right? Please correct me if I am wrong.

3) What classes can I use to communicate with Serial devices in J2ME.
These are not "virtual" serial (like USB and IR) devices but real ones.
It would have been much easier in C++ or C but we don't wish to
recompile our code for each of the target platform thats why Java :).

PLEASE HELP.

-Rishi

PS: It is not a class assignment which I think might be quite evident also.
Rishi PIdva - 14 Dec 2005 00:04 GMT
Any Help?? No one works with Java on small devices here?? I find it hard
to digest. I would really appreciate response from someone who has
actually worked on this line.

> Hi,
>
[quoted text clipped - 24 lines]
>
> PS: It is not a class assignment which I think might be quite evident also.
Rhino - 14 Dec 2005 16:14 GMT
There are a few Java midlet developers on this newsgroup but I'm not sure
how many. It's entirely possible that none of us have worked with RS232 in
midlets; I know I haven't. I've also never used PersonalJava so I can't
comment on its merits with respect to J2ME.

You may want to consider posting your questions in a few other places,
including:
- comp.lang.java.programmer
- the forums on Java Ranch (their forums are situated in a part of the site
called "the Big Moose Saloon"; the J2ME forum is available here:
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=forum&f=41)
- the Java Mobility Forums at Sun
(http://forums.java.sun.com/category.jspa?categoryID=22)

You might also find sufficient information to answer your question at the
J2ME Technical Articles at Sun
(http://developers.sun.com/techtopics/mobility/allarticles/).

Rhino

> Any Help?? No one works with Java on small devices here?? I find it hard
> to digest. I would really appreciate response from someone who has
[quoted text clipped - 29 lines]
>> PS: It is not a class assignment which I think might be quite evident
>> also.
Darryl L. Pierce - 16 Dec 2005 17:54 GMT
> Any Help?? No one works with Java on small devices here?? I find it hard
> to digest. I would really appreciate response from someone who has
> actually worked on this line.

Well, you *will* have to wait more than three hours for a response to your
question when dealing with Usenet.

1. Usenet isn't a hotline/helpdesk
2. Usenet is not real time
3. Usenet isn't obliged to answer any questions
4. Usenet requires patience

I'll be glad to help you, assuming you understand the above points. ;)

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart

Darryl L. Pierce - 16 Dec 2005 17:55 GMT
<snip>

Ignore the three hour point in that last email. I mixed the times up on your
post and another.

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart

Darryl L. Pierce - 16 Dec 2005 17:52 GMT
> I will describe the basic requirements first:
> We wish to connect our PDA to a serial (RS232) device to read serial
[quoted text clipped - 3 lines]
> 1) Which virtual machine will be the best? I dont mind using
> PersonalJava instead of J2ME for the same.

J2ME is not a VM: it's an umbrella term. Most handsets do not support
PersonalJava, and at any rate PJava has been EOL'd. You ought to target the
MIDP, which is a J2ME technology.

> 2) Also I noticed than MIDP 2.0 has https connection etc but most of the
> devices doesn't support MIDP 2.0 right? Please correct me if I am wrong.

That's not correct. MIDP 2.0 is growing by leaps and bounds and most
handsets available today are MIDP 2.0.

> 3) What classes can I use to communicate with Serial devices in J2ME.

You will need to use the Generic Connector Framework in the
javax.microedition.io package. You will use a the Connector.open() method
to create a Connection object. From this you can start communicating
through the COM port.

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart

Rishi PIdva - 31 Dec 2005 00:53 GMT
>>1) Which virtual machine will be the best? I dont mind using
>>PersonalJava instead of J2ME for the same.
>
> J2ME is not a VM: it's an umbrella term. Most handsets do not support
> PersonalJava, and at any rate PJava has been EOL'd. You ought to target the
> MIDP, which is a J2ME technology.

Sorry for my bad terminology but I was aware of that. I actually meant
J2ME CLDC MIDP2.0 compliant VM. PJava is EOL'd but how about CDC profile?

>>2) Also I noticed than MIDP 2.0 has https connection etc but most of the
>>devices doesn't support MIDP 2.0 right? Please correct me if I am wrong.
>
> That's not correct. MIDP 2.0 is growing by leaps and bounds and most
> handsets available today are MIDP 2.0.

I was actually checking it for the existing handsets like Nokia 6260,
6600, SE P910 etc and they were still using MIDP 1.0 :(..I would be very
happy if more and more devices come with MIDP 2.0. Also I refered to
MIDP 2.0 Specification and it just says 'CommConnection' Class 'MAY' be
implemented..So I might be stuck where many providers don't implement it.

>>3) What classes can I use to communicate with Serial devices in J2ME.
>
> You will need to use the Generic Connector Framework in the
> javax.microedition.io package. You will use a the Connector.open() method
> to create a Connection object. From this you can start communicating
> through the COM port.

Thanks!! I think I will try this route. Currently I decided to use
SuperWaba but didn't quite like it as SerialPort Implementation in it a
blocking I/O based on either the number of bytes read or timeout. I
think I need to do more study and research :).

But thanks Darryl for your help and I did wait a day before posting
again which you realized.

-Rishi
Darryl L. Pierce - 31 Dec 2005 14:46 GMT
> Sorry for my bad terminology but I was aware of that. I actually
> meant J2ME CLDC MIDP2.0 compliant VM. PJava is EOL'd but how about
> CDC profile?

The configuration (in this case the CLDC) defines the VM. The profile
(in this case the MIDP) defines a series of additional, device-specific
APIs. PersonalJava and CDC are not related technologies: PJava has been
superceded by the Personal Profile which itself is a set of APIs
provided on top of the VM defined by the CDC.

>>> 2) Also I noticed than MIDP 2.0 has https connection etc but most
>>> of the devices doesn't support MIDP 2.0 right? Please correct me
[quoted text clipped - 5 lines]
> I was actually checking it for the existing handsets like Nokia 6260,
>  6600, SE P910 etc and they were still using MIDP 1.0 :(

That doesn't seem correct. The S/E P900 was a MIDP 2.0 device, I would
be surprised that they went back to MIDP 1.0 for the next version. Where
did you find this information?

> ..I would be very happy if more and more devices come with MIDP 2.0.
> Also I refered to MIDP 2.0 Specification and it just says
> 'CommConnection' Class 'MAY' be implemented..So I might be stuck
> where many providers don't implement it.

That's because not all devices have a serial port. So it would make no
sense for the MIDP to require support for hardware that may not be
available. The only protocol that is required is HTTP (and now HTTPS)
because all MIDs have to have some form of networking ability.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.