J2ME Development With Eclipse and Antenna (HOWTO)
Here are the steps I compiled for developing Midlets using Eclipse, the J2ME Wireless Toolkit, and Antenna.
- Create new Eclipse Project (java)
- In the Libraries tab, remove JRE 1.4.
- In the Libraries tab, add the J2ME libraries. The J2ME libraries (midpapi.zip, mmapi.zip, and wma.zip) are located in the lib sub-directory of the directory you installed the wireless toolkit.
- Configure the project's source directory. Instead of using the projects root directory for the source code, I recommend configuring the source files to be located in the source sub-directory of the project (ie. Project/source).
- Configure the project's output folder. I recommend the bin subdirectory. (ie. Project/bin)
- Add the antenna task definitions to Eclipse. In the Eclipse (Window-->Preferences-->Ant) tab, add antenna-bin.jar to additional classpath entries.
- Create the code for your midlet.
- Copy the ant build script (build.xml) from the antenna samples in CVS.
- Modify the build script by removing wtkmakeprc section. Unless you are testing on a Palm, you don't need this section.
- Add the "fork" and "executable" properties to the wtkbuild task as follows:
- In eclipse, Right click on the xml file and select "Run Ant...".
When you click "Run" on the build window, the emulator will pop-up and you will see your application running.
[Via Niel Eyde's Weblog]
If you've ever tried to type code, pseudo-code or shell scripts on the Sharp Zaurus, you may have noticed that the little slide-out keyboard is missing some useful keys. If you've done much typing with this thumb-keyboard, you may have noticed that when you fat-finger a couple of keys, you can get some of those extra characters. For my reference as much as yours, here's a short list:
| keys |
character |
unicode value |
name |
| [Fn]+z |
|
0x005A(?) |
undo |
| [Fn]+[Shift]+c |
€ |
0x20AC |
euro symbol |
| [Fn]+[Shift]+[Backspace] |
[ |
0x005B |
left square bracket |
| [Fn]+[Shift]+, |
] |
0x005D |
right square bracket |
| [Fn]+[Shift]+. |
{ |
0x007B |
left curly brace |
| [Fn]+[Shift]+[Enter] |
} |
0x007D |
right curly brace |
| [Fn]+[Shift]+' |
^ |
0x005E |
caret/circumflex |
| [Fn]+[Shift]+[Space] |
` |
0x0060 |
tick/backquote |
| [Shift]+[Space] |
| |
0x007C |
pipe |
| [Shift]+[Tab] |
\ |
0x005C |
backslash (note that this is listed incorrectly in the sharp doc) |
In the table above, "[Fn]" means the purple "function" key, "[Shift]" means the arrow-up "shift" key, "[Backspace] means the white back-arrow/delete key, "[Enter]" means the purple "return" key, "[Space]" means the space bar, "[Tab]" means the purple tab key, and a "+" means hit these keys in combination, typically by holding down the "meta" keys first.
Also notice that the "Cancel" button works like "Escape", which makes VI usable without resorting to the on-screen (virtual) keyboard.
There's a full keycode mapping table available on Sharp's site.