This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Moving a big gob of java server stuff to a windows mobile contraption Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Moving a big gob of java server stuff to a windows mobile contraption" Watch "Moving a big gob of java server stuff to a windows mobile contraption" New topic
Author

Moving a big gob of java server stuff to a windows mobile contraption

paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20275
    ∞

About two hours ago I was handed a funny looking contraption that is running "windows mobile 5.0".

What they would like to have happen is to mash my tomcat app onto this contraption. Currently my app feeds a flex app to make the data look all fancy/hollywood. I suppose I could make something look close enough using HTML or Swing.

The contraption has 64 megs of memory. Currently about 20 megs are available to run something.

My tomcat app current consumes 38 megs, but my app fits into a a 100k war file that uses some hefty jar files. I think I could whittle things down to under 2 megs.

I'm guessing that this will need to be JME - is that an accurate guess? Would JSE even run on this contraption?


permaculture Wood Burning Stoves 2.0 - 4-DVD set
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15662
    
  15

If this device is the HTC Mogul phone (which would fit the description), officially, it can't run Java - Sprint, in particular doesn't want to hear about it. Unofficially, I can say that I had no problems doing basic apps on its predecessor (the Apache) using the IBM J9 JVM.

Obviously, if you really want/need to make this app self-contained on the device, you're looking for some major trauma, if for no other reason than that you'd be moving from a J2EE server app architecture to a Java Midlet app architecture.

If you're content to make the base website mobile-friendly, that's easier (hint, Pocket IE is similar to regular IE in name only - it's not a very smart browser). As long as you can make it entirely web-based, it's mostly a matter of detecting the environment (or providing a mobile URL) and crunching down the page output to be endurable on a 320x240 screen.

Yes, you have a completely different set of core packages on a J2ME device. Although many of the classes and methods are the same as for its larger brethen, some items are missing to keep the size down. It's quite possible that many of the third-party libraries (such as Jakarta) may not like this more cramped environment.

Swing is not the normal UI for Midlets - there's a java.lcdui package structure for J2ME UI, in keeping with the contstraints to keep things small and UI-neutral.

The best platform for J2ME is a J2ME-friendly device. Many such devices carry specs telling which mobile profile they support and what JSR's are builtin - things like GPS and media playing/recording features such as programmatic use of the camera.

I'm afraid I've no experience in a major Java app on a Windows Mobile device . I used C#.Net for my biggest phone app. For that, of course, you need a recent-vintage Windows machine and the .Net developer's kit. J2ME development can be done under any OS that supports Java. And as a bonus, there are some Eclipse plugins to assist.


Customer surveys are for companies who didn't pay proper attention to begin with.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I'll add, that if you need to re-write the app to just run on the Windows Mobile device, it probably would be faster and I hate to say easier to code it in .Net C# or VB.net

If you use the simple lcdui that is in J2ME, the look won't be too pretty, especially on such a device, you can go low level and code through x/y coordinates, which isn't as PITA as it sounds. There is J2ME Polish's UI components that can make an app look pretty too.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

Note that there are actually some not-too-shabby J2SE JVMs that run on these smallish devices; in particular MySaifu really doesn't suck at all, and targets Windows Mobile. If you could concievably move to a lighter servlet engine, you might be able to just plop the whole thing down.

Blackdown's JVMs work on Linux running on iPAQs, too, if that's an option. I have one of those babies right here (Familiar Linux).


[Jess in Action][AskingGoodQuestions]
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20275
    ∞

There is a lot of code that is all about talking to a wacky contraption and interpreting what it says. That's most of the code base. The libs that do all this talking are huge, but we use just a small slice for this need. So the obfuscator just might do the trick on that.

I'm thinking of taking out all the tomcat stuff and slapping some really basic GUI on it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Moving a big gob of java server stuff to a windows mobile contraption
 
Similar Threads
Windows Swapping with Java Apps
Website hosting
finding or replacing gnu.xml.datatype. JAXPDatatypeFactory
JNI + windows mobile + mysaifu JVM (JavaRanch hat to the one that can solve this!)
kicking off my java app on windows mobile