Wednesday, June 11, 2008

First Java ME Research

Okay, here's what i've found with our Java ME's demo app to run in my ipaq since my first blog.

At last i've found a suitable JVM for my Java ME purpose. It's Creme JVM from http://www.nsicom.com/. It supports some important features that i seek :
* Memory usage up to 128M. So if you're developing a mobile app which is quite significant in size or data, you should consider buying a pocket pc with bigger user memory (user memory is not to be perceived to be the same as RAM, be careful !) and run it using creme.
* Can run full screen !
* Can activate GPRS connection from cremex extension library
* Supports swing via JSR 209 (AGUI). Creme provides this as extension CAB file that can be installed after the installation of creme jvm in the pocket pc.
* Supports JNI, especially important for native printing

Here are some requirement of the CDC demo app i'm working on :
0. Rich user interface
Creme supports Swing ! No it's not slow, nor that it's fast. It's working just fine to me :)
1. Starts automatically, full screen when the ppc is activated
This is accomplished easily by putting the lnk file to the startup folder in the windows mobile directory
2. The app always stay on top
Creme also provides an extension class that can make it always stay on top.
3. Must be able to sync via WiFi
I just need to use java.net.URL or Apache HttpClient's library to connect to a servlet, fetching or downloading data.
4. Must be able to sync via GPRS with HTTPS with custom generated certificate
To be able to activate GPRS is already provided from from cremex extension library. Creme also got HTTPS support using jsse 1.0.3. One just need to place it in the creme\lib\ext directory. I tried java.net.URL for this HTTPS thing and it works nice, but using the apache httpclient is still problematic. The httpclient seems to be unable to find the SSL implementation.
5. Got embedded database
Apache Derby Rocks ! It supports CDC 1.0 and 1.1 in newer versions !
6. The app cant be closed by the users, only by those admins with the correct passwords. So the menu File -> Exit will prompt for a password. Wrong password takes you back to the app screen. This can be easily achived in Swing.
7. H/W keyboards wont be usable, like the camera button, the windows button that could trigger the start menu activation, etc. Only virtual keyboard will be usable. This is not supported by Creme yet by default, but Creme's support told me that this is going to be easily added if i were to become their customer, he he ..
8. Being able to print transactions on the field. We use Datecs PP-55 thermal printer for this necessity. The people from Datecs is kind enough to give me a sample of CPP source for text printing, and i use JNI calls for that. Works like magic.

Find out how to combine netbeans mobility pack with creme vm here. You should find this helpful as netbeans provides you some easiness like :
- It's an Java IDE, so you get all the quick fix, auto completion, refactoring, etc.
- Make one jar that consists of your classes and all the third party jars needed to run your program to be copied later to pocket pc.
- It has a GUI Builder that is suitable to design swing screens. To use the GUI Builder really helps you develop patience .. haha, but still a blessing than coding it manually.

I'll keep posting for updates.

Monday, October 15, 2007

Java ME !

Update :

    11-06-2008
  • - It turns out the VM from Sun that i blogged earlier is for embedded xp or something, and clearly not for Pocket PC

  • - For the stuffs i tried all these time since my first blog, please refer to the next blog




Have just drowned myself in searching various resources regarding J2ME for the upcoming project in the company i'm working for. The project is quite simple from the non-embedded view, just some GUI, some networking for synchronization, and some printing(preferably wireless). I've been in j2se and j2ee for some years, but still new in j2me. As a real newcomer, i found myself amazed with the new (and a lot!)acronyms, but the sun's site does a good job in explaining nearly everything.

Well, at least nearly everything, except the JVM for running the java app in PocketPC platform, which is the platform our clients preferred in this project. During my bloody googling, to my surprise, i found out that there were no standard JVM from Sun to run java app in PocketPC for years. But here's the good news i got lately from sun's site about J2SE in embedded devices. It's still in evaluation phase, and it seems that you can't ship it freely. But anyway it's a good start.

For those who are still searching alternative JVMs, allow me to share some lists i've found quite potential to use in my project .. I've yet to test them, since i dont have the device yet.
1. J9 from IBM
2. MySaifu
3. CrEMe

Here's my firefox's bookmarks related to j2me resources that i build during past few days of googling ..



Marc Nuri's Happy Coding Blog » JVM for Windows Mobile (J2ME) // PocketPC - PDA
Using Java on the Pocket PC - the complete tutorial - FirstLoox.org - Forums
Using Java on the Pocket PC - the complete tutorial Pocket Loox 718/720
Fair And Biased: Java on PocketPC (Unofficial FAQ)
IBM - Problem: Reducing the J9 Footprint: Required and Optional Libraries
What J9 libraries are required for a target? What J9 libraries are optional for a target? What J9 libraries can be safely removed from a target?
Mysaifu JVM - How to use
Kaffe.org
J9 IBM JVM for PocketPC PDA's
Java Virtual Machines for PocketPC PDA's
J9 - Eclipsepedia
Kaffe.org - Ports
Configuring Toonel .45
Smartphone & Pocket PC Magazine Expert: Werner "Menneisyys" Ruotsalainen - New Version of Free, Great Bandwidth Saver, Toonel, is Out – With Even More Features And Better Compatibility!
Thinlet
Enterprise J2ME
SuperWaba : The Real Power of Mobile Computing
Mobility Everywhere
HP Deskjet 460 Mobile Printer series overview - HP Small & Medium Business products
Overview & highlighted features for the HP Deskjet 460 Mobile Printer series. Includes links to view detailed specifications, compare this model or series with other products, buy online, locate a reseller, or view other relevant information tailored for Small & Medium Business, including special offers (if applicable).
Embedded Interaction - Working with J2ME - Java Driver for Brother MW-140BT mobile bluetooth printer
java.net: Getting Started with Java and Bluetooth
The JSR-82 is a powerful API that allows Java devices to communicate over the Bluetooth protocol. Bruce Hopkins shows how to develop Java Bluetooth applications.
Smartphone & Pocket PC Magazine Expert: Werner "Menneisyys" Ruotsalainen - Java Midlets on the Pocket PC - the Complete Tutorial
Java Support on Pocket PC
Configuring Java (J9) on a Pocket PC with RMI and SWT and SVG using CDC (Connected Device Configuration) and personal profile: some experiences
J9




Hopefully you can find it useful ..

If you happen to have developed such projects, please share also, thanks !