Running J2me apps on Android phones - java-me

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

Related

Does Android Things Developer Preview 6.1 support Google Cast

Does NXP i.MX7D support Google Cast via Android Things?
Android Things Version: Developer Preview 6.1 which has 11.6.0 Play Services.
We need to show the UI on external displays like TV with Android Things, but the Google Cast feature does not seem to work with Chrome Cast.
To Test the code we manipulated our source code, so that it can run on Android Device; which runs perfectly fine. But when we try it on Things, it does not discover any devices to cast.
We also tried similar procedure with the Google Sample - CastRemoteDisplay-android
The above sample works on Android Devices but the same does not work on Android Things 6.1 developer preview; after making required changes to run on Things
We also tried different Play Services versions from 10.x and 11.x
We also tried to change the API level from 23 to 27
But all results the same
NOTE: I am not including any code or stack trace as I feel it is not required. But if any one demands will post the required logs
After lots of trial and research, I found out that the version of Play Services installed on Things Developer Preview 6.1 does not support it. It lacks GMS Core, because of which currently not possible.
In the mean time I'll try to search and side load OpenGapps with GMS Core, but I am not sure if it will work

Can Chromecast run Native C libraries?

As I understand it, Chromecast runs a modified version of ChromeOS.
Hackers examining the device have "concluded that it’s more Android than Chrome OS," adding, "to be specific, it’s actually a modified Google TV release, but with all of the Bionic / Dalvik stripped out and replaced with a single binary for Chromecast."
With this in mind can one conclude that Chromecast can only run HTML/JS code and that it can't run any Native C code?
What if I have a Native C library which already runs on Android and iOS, what will be the best approach to port it so that it could be run on Chromecast?
No, there is no provision for supporting a native application.

How do I generate .dSYM for MonoTouch app in Simulator?

I want to profile a MonoTouch application in Instruments without an iPad. I am able to profile an app compiled for Simulator but it's no fun without the symbols:
There is no option to generate IPA with dSYM in project build settings—looks like they're only available when compiling for the device.
All I want is a MonoTouch-aware dSYM for Simulator.
Is this possible?
This is unfortunately not possible, because in the simulator we JIT managed code. This means that it is not possible to know before executing the process where methods will be in memory, and Instruments doesn't support the required mechanisms for MonoTouch to inform about JIT'ed methods at runtime [1].
[1] See last comment on the response here: Is it possible to notify DTrace on Mac OS X of dynamically generated code?
Take a look at this - miguel wrote a blog post recently to compile aot for profiling on mac - I think this will give you what you're looking for:
Using Instruments to profile Mac apps built with Mono

Android: is there any tool for profiling native code?

I have only found one profiling tool - http://code.google.com/p/android-ndk-profiler/. Wasn't able to get it working so far, so I wonder if there are other tools available.
I need to profile on a physical device, as my application doesn't even work on emulator.
It is not easy to make the Android-NDK profiler work. You need to follow the steps here thoroughly.
Here are some tips that led me to success:
Make sure your android.mk is correct and that you export the NDK_MODULE_PATH.
Use correctly the following functions
monstartup("your_lib.so");
moncleanup();
If the gmon.out is generated now you need to pull it from the device, but not to anywhere in your PC. For me it only works if I go to the application's folder (where jni, obj, res and other folders are) and I do:
console$ adb pull sdcard/gmon.out
Then run gprof. Try will all the versions in your NDK toolchains. For me only one worked, this one:
console$ ~/Libraries/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gprof obj/local/armeabi-v7a/libxxxx.so > profile.txt
The Shiny profiler is platform independent, it runs anywhere and it does not have any dependencies besides a standard C++ compiler. In its more simple usage, all you need to do is add a macro at the beginning of all functions and methods (or at least those that you want to profile).
Intel VTune Amplifier. This profiler allows you to collect hotspots with stacks on Android devices without root or any OS modification.
Here is simple guide:
http://software.intel.com/en-us/articles/using-intel-vtune-amplifier-on-non-rooted-android-devices
In the NDK r13b there is a new tool called simpleperf

"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