Friday Dec 16, 2011

How To Integrate Java ME SDK with Eclipse?

Many asked how they can use Java ME SDK on their favorite IDE, Eclipse. Well, it is not most recommended because you lost the advanced features provided by NetBeans, there certainly is a way to use Java ME SDK with Eclipse. Please see below.

Requirements

  • JDK 6 Update 27
  • Java ME SDK 3.0.5
  • Eclipse Classic 3.7.1

Instruction

Mobile Tools for Java (MTJ) Plugin Installation 

First, you need to install MTJ Plugin.

1. Start Eclipse and go to the “Help” -> “Install New Software...”

2. Insert link to MTJ (http://download.eclipse.org/mtj/updates/1.1.2/stable) into the “Work with” text field

3. Press “Enter” key

4. Check “Mobile Tools for Java”, and press "Next Button".


5. Press the "Next" button again.

6. Accept the terms of the license agreement, and press the "Finish" button.

Java ME SDK Emulator Integration

Once you have installed MTJ Plugin, then follow the process below to integrate Java ME SDK.

1. Start Eclipse and go to the “Window” -> “Preferences” -> “Java ME” -> “Device Management”.

2. Press the “Manual install...” button

3. Insert path to Java ME SDK into the “Specify search directory” text field

4. Press “Enter” key

5. Devices will appear in the “Devices” table

6. Press the “Finish” button. Then press "OK" button.

Running and debugging Java ME project

1. Right click on a project in the Package Explorer

2. To run a project, select “Run as” -> “Emulated Java ME JAD”

3. To debug a project, select “Debug as” -> “Emulated Java ME JAD”

Friday Nov 18, 2011

Java ME SDK 3.0.5 is released!

Java ME SDK 3.0.5 went live! For many months, we have been working hard to fix bugs from previous version, and add a lot of new features demanded by Java ME community.

You can download the new version from this link. Please see below for more information.

NetBeans Integration
All Java ME tools are implemented as NetBeans plugins.

Device Manager
Java ME SDK now supports multiple device managers. You can switch between different versions of device managers.

LWUIT 1.5 Support
The Resource Editor is available from the Java ME menu to help you design and organize resources for LWUIT applications. For a description of LWUIT 1.5 features, visit the LWUIT download page

Network Monitor
Integrated with NetBeans profiling tools, the Network Monitor now supports WMA, SIP, Bluetooth and OBEX, SATSA APDU and JCRMI, and server sockets.

CPU Profiler
Now uses standard NetBeans profiling facilities to view snapshots. Profiling of VM classes can also be toggled on or off.

WURFL Device Database
The database has been updated with more than 1000 new devices.

  • Tracing - New tracing functionality now includes CLDC VM events, and monitors events such as exceptions, class loading, garbage collection, and methods invocation.
  • New or updated JSR support - Includes support for JSR 234 (Advanced Multimedia Supplements), JSR 253 (Mobile Telephony API), JSR 257 (Contactless Communication API), JSR 258 (Mobile User Interface Customization API), and JSR 293 (XML API for Java ME).

Friday Aug 12, 2011

NetBeans vs. Eclipse?

NetBeans vs. Eclipse. Which IDE are you using when you develop a Java ME application?

You know that Java ME SDK has been officially supporting only Eclipse platform. We wondered how many Java ME developers were using NetBeans versus Eclipse. So we did a quick poll. Here is the result.

120 people participated. 52% use NetBeans, while 34.5% use Eclipse as primary IDE. "Other" included IntelliJ. 34.5% is a significant number, so we are considering to add support for Eclipse in the future.

Do you agree with the result? What do you think?

Wednesday Jul 06, 2011

Java ME SDK team is back!

Hi,

We are still here! There have been some changes in team members and structures, but we are still here. We have been busy working on improvements and fixing bugs. New version will be released soon. Stay tuned.

- Java ME SDK Team 

Monday Feb 15, 2010

First aid when emulator doesn't start

We have got few bug reports about not starting emulator. After some research we would like to summarize possible causes.

1. Freshly installed windows doesn't have msvcrtXX.dlls

Got to folder runtimes\\cdc-hi\\bin and copy Microsoft.VC80.CRT into runtimes\\cldc-hi-javafx\\bin. This problem will be fixed over autoupdate soon.

2. Problem with localhost

Please edit <javamesdk_installdir>\\toolkit-lib\\modules\\bootstrap\\conf\\system.properties and change
device-manager.object-registry.host=localhost  to:  device-manager.object-registry.host=127.0.0.1

3.  Port 1299 might be taken

Please edit <javamesdk_installdir>\\toolkit-lib\\modules\\bootstrap\\conf\\system.properties and change
device-manager.object-registry.port=1299  to:  device-manager.object-registry.port=1999

4. XP 64-bit

Please use 32-bit version of JDK.

5. Firewall

Make sure that firewall is not blocking communication on ports given in 3. Default port numbers are 1299 for windows and 1999 for Mac.

Sunday Jan 24, 2010

Where are my logs .. ?

It is nice and polite when application writes log. Especially when something went wrong it can help to track down the source of problem.  JMESDK has several components which produce their own log files. Here they are:

Device-manager

  • This is core component for the product. It starts automatically and registers all devices and emulators. Since all communication goes through device-manager this log contains always the most important information.
  • Log file is placed into /user's home/javame-sdk/3.0/log/device-manager.log (windows) or /Users/username/Library/Application Support/javame-sdk/3.0/log/device-manager.log (MacOSX)

Emulator

  • Emulator loads its skin and starts cldc or cdc virtual machine (VM). Emulator and VM write log under the emulator instance working directory /user's home/javame-sdk/3.0/work/(instance ID)/device.log. How to get the instance ID? When emulator starts, ID is displayed in window caption after the name of device.

mini IDE

  • JMESDK contains simple IDE which is built on top of Netbeans platform and thus uses platform logging mechanism. It writes log into /user's home/javame-sdk/toolbar/3.0/var/log/messages.log

Friday Jan 15, 2010

How to create a custom device

I've got a question how to create custom emulator skins several times. It can't be answered in a few words, a short tutorial with an example will be the best way of explanation. Skin800x480The zip bundle here contains an example of standard CLDC/MIDP device with a display of 800 x 480 pixels and a few buttons. Due to lack of creativity I call the device "Skin800x480" and I have to admit it looks quite ugly.  I will use it as a reference throughout this tutorial. You can use it as a base for your further customization. Before we get to a details I need to say a few words about the installation of the device.

Installation

It is fairly simple. You just need to unzip Skin800x480.zip bundle into JMESDK 3.0 installation directory. (C:\\Program Files\\Java ME SDK 3.0 on windows or /Applications/Java_ME_SDK_3.0.app/Contents/Resources on MacOS) Restart of the device-manager is required.

Device definition and device instances

Files which you've just unzipped into JMESDK is a definition of a device. JMESDK installation directory contains only device definitions. Device definitions are during launch of the device-manager used to create device instances. After you have restarted the device-manager you can check that an instance of "Skin800x480" device has been really initialized. Have a look into your user home Library/Application Support/javame-sdk/3.0/work (MacOS) or Application Data/javame-sdk/3.0/work (windows). Device instances are identified by numbers from 1 to 6 (MacOS) or 1 to 11 (Windows). One more instance No. 7 or No.12 has been initialized by the device-manager after the "Skin800x480" installation. It's more less obvious what all files inside instance directories mean. I will let it up to you inspecting them and finding it out.

Test it

 Let's check that the installation has been successful now. Open command line and and call emulator to list properties of the new device. Usually you don't have to use -Xdevice switch but because the default device is "DefaultCldcPhone1" and not our "Skin800x480" you will have to specify always device name for every emulator command. Write:

emulator -Xquery -Xdevice:Skin800x480

Command will list profile and configuration of the device along with other properties like bootclasspath, screen width and height etc. It's time to start the device now, this time star it without an application. Write:

emulator -Xjam -Xdevice:Skin800x480

or with an application

emulator -Xdescriptor:../apps/Demos/dist/Demos.jad -Xdevice:Skin800x480

Use the device and you will see how buttons behave when pressed or when mouse goes over the button.

The device

JMESDK is highly customizable and lets you define new devices without touching a code. Flexibility is necessary since there is a big number of handsets out on the marked and they differ in many aspects. A display size or a color depth, controls, number and type of keyboards (midp, qwerty, sliding keyboard), number of displays (2 displays in case of clamshell phones),  hardware modules (GPS, battery level sensor, motion sensor), external memory card just to name a few of them. JMESDK can literally assemble a device from particular components to match as close as possible desired handset. Here is what we can use as a building blocks of our device:

  1. skin (a picture of the handset)
  2. display (number of displays, size, color depth)
  3. device states (open, closed)
  4. keyboards (keyboard layout and key codes mapping)
  5. JVM (runtime associated with a device)
  6. device properties (fonts, default locale, BT address, phone number, heap size, security domain and many more)
  7. hardware modules (GPS, accelerometer, sensors, memory card etc.) 

Making a device

Look into a zip file into devices/Skin800x480/conf. You need 3 skins (png bitmaps) of the device. 1st one displays device in "normal" state, 2nd in "highlighted" (how the button should look like when mouse goes over it) and 3rd one in "pressed" state (how button should change when it is pressed). In our case we have 4 buttons A,B,C,D and "joystick" in the middle with buttons Left, Right, Up, Down and Select.  Important part is the display. You have to ensure that the size of display fits perfectly 800x480 pixels. You will need to write down boundaries of each button and of the display as well.  We will use them later on in mapping of buttons and in dislpay setup.

Besides of 3 skin bitmaps mentioned above the folder contains a few other files:

  1. index.html, bg.jpg, skin-test-small.png - these files compose a device information page which appear in our small IDE when you double click a device in device selector.
  2. networkIndicatorOn.png - you need this if the device has a small light (network indicator) which blinks when there is a network traffic.
  3. modules file - devices are sharing some functionality across them. This file describes what support should be loaded for this device. Each row is a path to particular module. For example modules/emulator-cldc is generic cldc-hi runtime, skin/single-state-shared is a module common to all devices which have only single state, emulator/generic/ui/touch-screen-support is a module which enables touch screen support etc.
Display setup

We have bitmaps with a space for display ready. What we have to do now is just to place a screen buffer properly on the bitmap and set screen buffer size. We will do this in .bean files. These files are being read when device and its runtime starts. Each .bean file represents an object with given setters.

  • ScreenGraphics.bean::dimension is a setter for a width and height of a screen buffer. Proper value for our device is 800, 480
  • Screen.bean::position sets x,y location of screen buffer on a skin bitmap. In our case 21,21
  • NetworkIndicator.bean::bounds location and width of network inicator
  • NetworkIndicator.bean::image a name of network indicator png bitmap
Button mapping

Our simplified device has four-way joystick, select button in the middle and four soft buttons A, B, C, D. ButtonsMapping file is called default-state.xml. It defines one single state of the device. For example Clamshell phone has 2 states opened and closed and need 2 mapping files.

Here are parts of the file:

<device-state name="Default" defaultSkin="skin-test-normal.png" 
pressedSkin="skin-test-pressed.png" 
highlightedSkin="skin-test-highlighted.png" 
networkIndicator="NetworkIndicator">

device-state references 3 skin bitmaps -- normal, highlighted, pressed and a network indicator object. You need to put correct bitmap names here.

<button activators="VK_F1" vmKeyCode="-6" 
x="259" y="509" width="88" height="22"/> 

Each button is defined by its bounds (x, y, width, height) a vmKeyCode (integer sent to the runtime when button was pressed) and activator (keyboard activator for this button are VK_\* constants, as defined in java KeyEvent class)

vmKeyCodes are defined as follows:

    UP           = -1,
    DOWN         = -2,
    LEFT         = -3,
    RIGHT        = -4,
    SELECT       = -5,
    SOFT1        = -6,
    SOFT2        = -7,
    CLEAR        = -8,
    SEND         = -10
    END          = -11
    POWER        = -12
    KEY_0 .. KEY_9, #, \*, etc = ASCII code of the character. 
                               (vmKeyCode for printable character
                                is its ASCII code)

We don't have a button with printable character on our device but here is an example for number '1'.

 <button activators="VK_1 VK_NUMPAD1" 
vmKeyCode="0x31" keyChar="1" 
x="36" y="493" width="76" height="31"/>

Device adapter

Here I will talk about files related to the device manager. Device manager recognizes any device when its corresponding device adapter is installed. For every device adapter, there is a corresponding .bean file in process/device-manager/device-adapter.  Among other things adapter references runtime which should be used with this device. In our case it is cldc-hi-fx runtime (cldc/midp runtime with built-in JavaFX extension).  Since there is no other option for a runtime, I won't go deeper into settings of runtime in the adapter. You will better leave adapter files untouched. Just copy all files to use them for your own device, do the search through all files and replace Skin800x480 with a name of your own device. Although one thing has left to be mentioned here. You can add as many device instances as you wish. We have 1instance for Skin800x480. Instance .bean file is in process/device-manager/device-adapter/Skin800x480/1.bean. But can be copied to 2.bean, just change the setter deviceName to for example Skin800x480_1.

The end

I think we are done with simple customization. Definitely there's much more options to setup like device states etc. I've mentioned them all above. We can get back to them later if somebody needs them. I hope this entry will help to everyone who wants to create his own skin. Don't forget to share with us any skin you would create ...

Saturday Dec 26, 2009

Use Mac AirPort to work with WinMobile handsets

As you probably know we ship Java ME SDK with cldc java runtime for Windows Mobile. You can deploy MIDlets onto Windows Mobile handset as easy as it was an emulator. Connecting a WinMobile handset from Java ME SDK is very straightforward using activesync on windows. It's really just a matter of plugging device and runing jvm on it.

Situation is different on Mac since there's no free activesync support. Fortunately most of WinMobile handsets come equipped with Wi-Fi and we can take advantage of Mac's AirPort networking. What we need is to create computer-to-computer network and let WinMobile handsets connect to the network. Only trick is to find out IP address of the handset. When you have the IP and you have started jvm let Java ME SDK look up the handset. Since it's recognized you can deploy MIDlet on it an also debug your applications right on the handset using Netbeans Mobility Pack. 

Before you start with this tutorial copy .cab file from Java ME SDK installation folder named "on-device" to your WinMobile handset and install it.

Create computer-to-computer network and give a name to it (in our example "MyNetwork").

On handset look into Settings->Conections->Wi-Fi and search for computer-to-computer networks and connect to network. After your handset is successfully connected to "MyNetwork" look at details of Wi-Fi adapter where you find assigned IP address. Just to be sure open terminal and try to ping the handset

ping 169.254.205.222

if your handset is reachable you can continue in Java ME SDK. Launch JMESDK and look at Device Selector window where 2 new buttons have been added in version 3.0 for Mac. Look at the image below where the buttons are highlighted

The first one  opens a wizard which helps you to connect to handset. All you need is to specify IP address. When the jvm on handset responds to look up from JMESDK it is added under the device node "Other" as you can see on the image above. Second button  refreshes connection to handset. My htc diamond falls asleep after some time and when it is awake I need to refresh connection. Device registration can be made also from command line

device-address add ip 169.254.205.222

or on device-manager. Click on device manager icon  in status bar and choose manage device addresses.

Now with the handset connected you can deploy MIDlet on it. Just open one of the sample projects right click on CldcWinceEmu1 node and choose "Run Project".

Of course all of this you can do also without Mac AirPort simply over the Wi-Fi router if you have one available. About debugging on-device using Netbeans Mobility Pack I will write soon. I suppose after you're successfull with this setup you will figure out how to make it work for Netbeans MP as well.


Monday Dec 21, 2009

A Christmas present to all Mac users

Merry Christmas to everyone and especially to all Mac users. There's still few days remaining to Christmas but we are giving presents already. Thanks to great effort of software and quality engineering during last weeks we have managed to wrap up our Mac release before end of this year and make it public today. You can download Java ME SDK 3.0 for Mac OS and try out Java ME cldc/midp mobile development on Mac OS for the first time.

Java ME SDK 3.0 for Mac OS contains these key features:

CLDC/MIDP emulator supporting multitasking built upon CLDC 1.1 and MIDP 2.1.
  • Contains complete Mobile Service Architecture (MSA 1.1) stack except JSR234 - Advanced Multimedia Supplements
  • Mobile Sensor API (JSR 256)
  • XML API for Java ME (JSR 280)
  • Payment API (JSR 229)

On device deployment and debugging support

  • SDK comes with one-click solution for easy testing your apps right on the device.
  • Windows Mobile JVM is included in SDK

Integrated Lightweight UI Toolkit

  • LWUIT version 1.2 library and resources manager integrated into SDK makes development of rich UI easy

CPU profiling support

  • A built-in profiler lets you easily profile CLDC/MIDP applications. The profiler is based on the successful Netbeans profiler used in VisualVM, which is bundled with Java SE 6

New development environment based on Netbeans 6.7 platform

  • SDK leverages the successful Netbeans platform. A shared project system allows easy transition of your project to the rich, full-featured CLDC/MIDP development tool Netbeans Mobility Pack

JDK 1.5 and JDK 1.6 support

  • Both JDK are now supported although upgrade to 1.6 is recommended

Device search database

  • Technical specifications of thousands of mobile devices are now available through the database search tool.

Java FX Mobile emulator

  • The SDK includes the JavaFX Runtime version 1.2.1 and two default phone skins for JavaFX Mobile.
An important note for users of Early Access how to uninstall:
  1. stop all emulators and Java ME SDK IDE
  2. stop device-manager. If running on jdk 1.6 click on the icon   in status bar and chose Exit. If running on jdk 1.5 use ps aux | grep device-manager.app and kill the process
  3. remove Early Access rm -rf /Applications/Java_ME_SDK_3.0.app
  4. remove working directory rm -rf /Users/<username>/Library/Application Support/javame-sdk

Merry Christmas and happy New Year

- Your Java ME SDK Team

Screencast: Device Selector

Some time ago I asked you how are you familiar with Device Selector. I'd like to thank everybody who answered the question. We have got lots of interesting information. More than half of participants answered "I don't know what Device Selector is." I didn't expect so high percentage of votes for this option so this is a good chance to say a few words about Device Selector functionality.

Device Selector is a small window in the bottom left corner of Java ME SDK development environment. In general you can use it to set emulator properties or simply run project on different emulators. This screencast shows you Device Selector in action.

Saturday Dec 12, 2009

Mobile 3D Graphics API for J2ME

We got some complains that early access version for MacOSX lacks 3D Graphics support. I know that 184 is very popular JSR and I'm really happy that the situation has changed for upcoming final release. Thanks to cooperation with HI CORP we were able to integrate their MascotCapsule V4 rendering engine into MacOSX emulator. Stay tuned final release is coming soon ...

Wednesday Oct 28, 2009

Mobile Application Conference India

SiliconIndia, India’s professional networking portal, is organizing Mobile Application Conference India in Bangalore on this Saturday. Sun is a technology partner of the conference and it is an opportunity for you to see Sun's mobile technologies in action. I was told that there will be also a demonstration of Java ME SDK 3.0. Sun India team is looking forward to meeting you there if you have a chance to come.

Mobile Application Conference India

Monday Oct 26, 2009

Preverify: VERIFIER ERROR

If you are running Java ME SDK 3.0 Early Access for Mac OS X you might experience preverify problem and got VERIFIER ERROR message. To fix it run following command in /Applications/Java_ME_SDK_3.0.app/Contents/Resources/bin path:

lipo preverify -output preverify -extract i386

It leaves only 32-bit version in the preverify file and takes out the 64-bit version.

Wednesday Oct 21, 2009

Early Access for Mac OS X is ready

Mac developers have often asked when Java ME SDK 3.0 will be available for their operating system. We always answered that we were working on it. Today is the day when it happened, we have released Java ME SDK 3.0 Early Access for Mac OS X. You can download it from http://java.sun.com/javame/downloads/sdk30.jsp.

Highlights of  Java ME SDK 3.0 Early Access, Mac OS X:

  • Bringing functionality of the famous Wireless Toolkit to Mac developers
  • Unique architecture enabling work with the real device from ME SDK 3.0 now running on Mac OS. Communication with the devices, application deployment and even On-Device debugging over the Wi-Fi.
  • Support for the latest CLDC Hot Spot VM and Java Micro Edition APIs
  • High End Tools for optimizations: Profiler, Network Monitor, Support for Debugging, Wireless Messaging Console and many more
  • Introducing JavaFX 1.2.1 Mobile emulator running on Mac OS
  • Integrated Device Search Database for easy reference
  • Powerful Autoupdate for additional plug-ins and product updates
  • Development Environment based on NetBeans Platform 

Tuesday Oct 13, 2009

Device manager autostart

There is a new component device-manager in Java ME SDK 3.0 which is a cornerstone of the SDK. It runs in background and only a small icon in notification are on taskbar shows that it is up and running. It keeps running even if you're not working with Java ME SDK and it's launched along with start of the system. Not very nice ... You can easily get rid of autostart just open regedit and remove entry "Java(TM) ME Platform SDK 3.0" under
HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run
About

Java ME Platform SDK is a toolbox for developing mobile applications. Java ME SDK Download

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today