Where did lcdui go, in JME SDK 3.0+? - java-me

I want to write a tiny "hello world" J2ME MIDlet. In a sample like this one, classes in javax.microedition.lcdui.* are used for display output. When I try to compile it in Eclipse, I get the error,
The import javax.microedition.lcdui cannot be resolved
I've installed JME SDK 3.4, and I'm able to run MIDlets that don't import javax.microedition.lcdui.*. I read somewhere that lcdui can be obtained from the wireless toolkit; and Oracle says that the wireless toolkit has been integrated into JME SDK as of 3.0+.
So why can't Eclipse find it?

OK, I think I know the answer now.
I got back to the JME SDK 3.4 documentation page on Using Sample projects, and created and ran an instance of UIDemo. It uses lcdui classes, but it runs flawlessly - no errors about inability to resolve javax.microedition.lcdui.*.
The difference appears to be that the working sample uses different libraries than the one I tried at first. The first one uses org.elipse.mtj.JavaMEContainer/Oracle Java(TM) Platform Micro Edition SDK 3.4/IMPNGDevice1,
while the one that works uses org.elipse.mtj.JavaMEContainer/Oracle Java(TM) Platform Micro Edition SDK 3.4/JavaMEPhone1. They contain different sets of jars, e.g. the working one contains midp_2.1.jar, while the earlier one has impng_1.0.jar.
A follow-up question might be, why doesn't IMP-NG have lcdui in it? Well, those who pay attention to what they're doing will have read that
This JSR [for IMP-NG] will define a J2ME profile targeting embedded networked devices that wish to support a Java runtime environment similar to the Mobile Information Device Profile (MIDP) version 2.0, but that do not provide the graphical display capabilities required by MIDP 2.0.
The Information Module Profile - Next Generation (IMP-NG) will be a strict subset of MIDP 2.0, where at least the APIs relating to GUI functionality (the LCDUI) are removed. Functionality not already present in MIDP 2.0 is not anticipated or desired. "
The next question might be, why did I end up selecting IMP-NG when I was going through the tutorial... when I really do want a MIDlet that does something graphically? But I'm not sure I care, now that it's working.

The new me sdk 8.2, as I understood after browsing all class and in packages, does not provides any class to develop user interface. not like sdk 3.4, that have many graphical components.

Related

Generating netbeans project with Lwuit

I am trying to generate a netbeans project with Lwuit editor. But gets this error message that some library are missing and that WTK 2.5.2 CLDCC Cannot be found. any idea on how to fix this
http://www.oracle.com/technetwork/java/javame/javamobile/download/lwuit/index.html
Is the location of the library that you must download.
Additionally you may need the wireless toolkit though I am not sure why.
http://www.oracle.com/technetwork/java/download-135801.html
If you are writing for mobile devices I strongly recommend that you check out Codename One which is the open source product developed by the original designers at Sun of lwuit. http://www.codenameone.com/

How do I retrieve the OEM version of a Windows CE device in .NET Compact Framework 3.5?

I am developing applications for handheld terminals running Windows CE 6.0, using .NET Compact Framework 3.5.
Is there a universal way to retrieve the OEM version (i.e. the "OEM Version" string seen in the "System Info" control panel applet), using the .NET CF Class Library or Smart Device Framework, regardless of the device vendor?
There's no "universal" way, as there's nothing that says an OEM has to provide a version at all, or if they do, there's nothing that says how they must do it. There are some provided interfaces, which an OEM would be encouraged to use (SystemParametersInfo with SPI_GETOEMINFO (which is what luskan's suggestion returns) or SPI_GETPLATFORMVERSION (which is probably in the SDF somewhere too) would be where I'd start to investigate, but be forewarned that just because it works on one device, doesn't mean it'll work on another. Do loads of validation and fallbacks in your code.

JBlend with LWUIT

I have made some applications on J2ME using LWUIT, CLDC 1.1, MIDP 2.0 and they are working great on Nokia handsets.
But when I tried to install these applications on Huawei G7206 (JBlend) some of the applications gives error (NOT SUPPORTED) and some crashes without displaying anything.
I have tested an application without LWUIT and it worked.
My question is,
what is the issue?
Either JBlend does not support LWUIT? or I have to downgrade my applications (I mean to remove some features)?
Does anyone know the limitations to work with JBlend?
Have you tested your applications on other devices?
Confirm that your jad doesn't include any other hidden requirements, jblend generally works with LWUIT but some VM's don't handle the full LWUIT properly and require an obfuscated application or similar hacks.
Whenever we use LWUIT in application the size of the application increase because of the jar file which we add in it. By obfuscation we can reduce the size of .jar file. And can become able to run in device.
Please try of obfuscate the application. You might get the solution of your problem

"Invalid Application. Delete?" only when compiled with a Nokia SDK

I'm developing a piece of software for my University and am currently attempting to implement NFC functionality which requires me to move from my standard Sun wireless tool-kit platform (implemented through NetBeans) to a Nokia platform (also implemented through NetBeans).
The problem is, whenever I compile the code with the Nokia platform implementation and run the program, on the Nokia phone I have or in the emulator, the phone displays a box stating "Invalid Application. Delete?" with a yes/no answer. This stops the installation of the application. The strange part is that if I compile the exact same code with the Sun platform implementation it runs without any issues on the Nokia phone. I have tried this with two different Nokia SDKs (the Series 40 Nokia 6212 NFC SDK and the Series 40 5th Edition SDK) with the same results.
What is the Nokia SDK doing differently?
There seems to be some kind of discrepancy between a project created using a Sun platform and a project created in a Nokia platform.
Although the original program, initially created with the Sun platform, compiled with the Nokia platform caused the application to be invalid, when I created a new project from scratch using the Nokia platform and just copied the source of the original program over the program worked. There is no discernible difference in the JAD/manifest files between the two.
If you've copied source code, you may have not copied the "manifest.midlets", i.e. tells the OS which "forms" to create. You'll usually find this in the project properties.
(e.g. in NetBeans IDE - Application Descriptor, "Midlets" tab - it shouldn't be empty).
Make sure that the following attributes (key:value pairs) are in the JAD file and also the manifest file in the JAR file:
MIDlet-Name
MIDlet-Version
MIDlet-Vendor
MIDlet-Jar-URL
MIDlet-Jar-Size

Can A Midlet invoke another Midlet?

I been looking around and at sources like this one they say that a Midlet can invoke another if they are in the same suite, or if they are in the same namespace and in the same jar file.
I do not understand what a Midlet-Suite is?
Also after searching through the web I did not find any documentation or code examples for One Midlet invoking another Midlet.
A MIDlet suite is basically the JAR file. There are many J2ME applications that contain several MIDlet classes in the jar, see some of Sun's examples that come with WTK.
Edit: There's an example called MMAPIDemos that comes with sun's WTK that uses 3 MIDlets in one suite.
The other replies are pretty much taking care of your questions about MIDlet Suites but I would suggest reading the MIDP specification to get the information first-hand:
http://www.jcp.org/en/jsr/detail?id=118
On recent phones (Series60 5th edition from Nokia Sony-Ericsson and Samsung, other Sony-ericsson phones), the Content Handling API (CHAPI) is supported for MIDlet-to-MIdlet invocation.
That's JSR-211. You can read the specification for that here:
http://www.jcp.org/en/jsr/detail?id=211
The latest version of the Nokia Java Developers Library will contain more explanation:
http://www.forum.nokia.com/Tools_Docs_and_Code/Documentation/Java/
The latest JavaME SDK will contain CHAPI code examples:
http://java.sun.com/javame/downloads/sdk30.jsp
Edit: CHAPI is also available on non-Symbian Nokia phones from Series 40 5th Edition, Feature Pack 1 onward, according to the Nokia Java Developers Library. You can find which nokia phone is running which version of Series40 at:
http://www.forum.nokia.com/devices/matrix_all_1.html
You can try PushRegistry as a more generic way. You should be able to launch MIDlets from other suites as well. Try this link for more information.

Resources