Can A Midlet invoke another Midlet? - java-me

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.

Related

Where did lcdui go, in JME SDK 3.0+?

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.

Running J2me apps on Android phones

Is it possible to run J2ME apps on Android phones? If so, what is the installation procedure?
Otherwise, is it possible to convert .jad files to .apk? In this case, what is the procedure.
(I have already tested the procedure offered by netmite but it doesn't seem to work.)
Using this site http://www.netmite.com/android/srv/2.0/getapk.php you can convert your J2ME application in to Android Application. You need to just supply your .Jad & .Jar file in it and it will generate Android's executable file .apk for you.
However in it doesn't able to convert all the feature of Java ME to Android, but basics can be easily converted.
You can try phoneME, netmite j2me app runner, jblend, jbed like jeme emulators in android. For now, phoneME is the best. you can get various version of phoneME here http://davy.preuveneers.be/phoneme
You also need OI file manager to select files in phoneME.
A complete guide can be found here http://w3epic.com/run-java-apps-j2me-on-android-devices-guide/ for rest of other emulators (if you want to try).
#dennis
I got it, thanks.
MicroEmu open source project hasn't been mentioned yet, and here it goes: https://code.google.com/p/microemu/
I searched for a good JavaME emulator for Android for a long time, and finally found one. This here is what you need:
http://davy.preuveneers.be/phoneme/
No doubt the best there is for Android.
Added 15th January 2016:
Reply from the author of phoneME, Davy Preuveneers, in regards to the Android 5.0+ issue commented by Álvaro Gutiérrez:
Hi,
I am testing on a Samsung Galaxy S4 running Android 5.0.1, and the
"phoneME Advanced - Foundation Profile + MIDP FullHD Resolution" build
seems to run just fine on this device.
Also, following this thread
Position Independent Executables and Android Lollipop,
I ran:
$ readelf -l libcvm.so | grep -i "file type"
and it reports:
Elf file type is DYN (Shared object file)
So according to the website this is OK.
However, for the CDC and Foundation profiles (console like
applications), there is indeed an issue where you get this error:
"Error: only position independent executables (PIE) are supported"
However, for those 2 profile I call a native executables and redirect
the native stdout/stderr streams to Android, whereas for the MIDP dual
stack I load a library and create a complicated wrapper to get things going.
I can recompile with -fPIE and -pie options but will then end up with
binaries that are no longer backwards compatible with devices running
Android 4.0 and below. That is why I added some additional builds to my
website for Android 5+ devices:
http://davy.preuveneers.be/phoneme/?q=node/10
Best regards,
Davy

can we build for Symbian^3 same code done in s60 3rd edition using lwuit

I have made application in j2me using lwuit and successfully built on S60 3d edition FP2, now to make wide compatibility i want to make build for Symbian^3, so is it possible?
Yeah its possible. Because LWUIT supports both touch and non touch mobiles and no need to change the code for this. AFAIK you have to check following steps,
Resolution: Because resolution of symbian s60 3rd edition not more than 240x320 or 320x240. But symbian^3 smartphone having 640x360 or 360x640.
MenuBar: Look on this blog
Drag and Drop: You can enable drag and drop the components If you needs.
Just test the LWUITDemo application from repository on symbian s60 3rd editon and symbian^3 mobiles. Then you can find the what are all the changes have to do. Also look on this wiki information about Symbian.
You should be able to use the same jar file on the Symbian^3 devices, unless some of the APIs have changed. At least this was true for S60 5th edition, I've never used j2me on Symbian^3 myself.

Save Call on Java Mobile / Phone to mp3 or any Audio format / file

I want to Save Call on Java Mobile / Phone to mp3 or any Audio format / file .
How should I go ahead with.
I am quite well versed with Core Java.
I found apps supporting above mentioned functionality in symbian Phones only but NOT in Java phones whose MIDP version is 2.1 and above.
Thanks for your Idea ( obviously practical one's ! )
or
sharing some links relevant to this
or some sort of pseudo-code in java for this.
I want solution for Java Phones with MIDP 2.1 & above.Please don't recommend symbian or other such things.
If you are willing to record incoming call using j2me , than unfortunately it is not possible.
with Java ME API's in the currently available Nokia phones its not possible, But you can try with Symbian C++.
j2me security will not allow to do this
you can do it with symbian.
I think nobody developed a call recorder in Java platform. All that you can do to record is to call divert to a land line which is connected to computer which can record calls.
Something for your reference (these can't provide you with Java phone call recording but can guide you , why it can't be with Java & S60 would be better(&only) option. )
Java Voice Recorder ported from E398
Need to develop a call recorder
and if change your mind from Java to Symbain then here's a code which you can have a look at.
Try Symbian!

"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

Resources