Debugging in JavaMe (Midlet or JAD) - java

I can debug my application as "Emulated Java Me Midlet" or as "Emulated Java Me Jad". What is the difference between those types? Right now my app is only working in debug as emulated java me jad.
When I run it as midlet I get the following error:
Cannot create PortForwarder with
necessary parameters: Failed to get
device id for "null"! Syntax:
emulator [arguments]
In order to get commands supported by
given device run: emulator.exe
-Xdevice: -Xquery
Does someone know how to solve this?

The "null" device ID suggests that there probably is a configuration issue at play here. I'd suggest checking Debug Configurations->Emulation tab and checking that all's well there.
It's also possible that this you've encountered this known issue: https://blogs.oracle.com/javamesdk/entry/eclipse_java_me_sdk_issue:
If you have had issues with running your MIDlet in Eclipse + MTJ (Eclipse ME), then this article is relevant to you.
We found out that "Run as emulated MIDlet" option is not supported by Java ME SDK 3.0.5. "Run as emulated MIDlet" means that you are executing a specific MIDlet in the jar file, where jar file contains more than one MIDlet.
Please use "Run as emulated Java ME JAD" option instead...

JAD = Java Application Descriptor. JADs are used for over-the-air (OTA) deployment. A JAD specifies one or more MIDlets to install on a device.
You've probably not configured the MIDlet deployment option correctly for the emulator. Read through the docs here.

Related

Cannot launch AVD in emulator. ?android studio

my emulator is not runnnig and gives the error in image below
error image
and test at run window
C:\Users\Wahlah\AppData\Local\Android\sdk\tools\emulator.exe
-netdelay gprs -netspeed full -avd Nexus_4_API_21
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid
and second error exist is this image
ERROR 2
I got the same problem with the same logged warnings and errors (and the alert as well).
Although from the first logged line (C:\...emulator.exe) it looked like the tools did find the emulator - my problem was resolved only after I followed this answer, and changed the ANDROID_SDK_ROOT environment variable (which pointed to a folder above the sdk instead to the sdk's folder itself).
So I changed it from
C:\Users\<username>\AppData\Local\Android
to
C:\Users\<username>\AppData\Local\Android\sdk
and... voila! The emulator is running properly.
I should note that I'm working on Windows and from the question it looks like AIR TRAVELS was as well.
I had the same problem and fixed it by selecting Cold Boot from the Tools > Android > AVD Manager > Edit > Show Advanced > Boot option from Quick Boot to Cold Boot.
Hope this helps.
You can fix this error, need configure the device again. Download all the necessary libraries through the SDK manager.

Unit tests terminated in Debug mode

I'm using IntelliJ IDEA 15.0.2 (Community Edition) under Windows 7 and Windows 10 Pro, Gradle 2.9, JDK 1.7.0_65. Operating systems installed as guests under VMware Workstation 11.1.3
I have created Android Gradle application with single empty activity and wanted to check how unit test support works. There is a single unit test module ApplicationTest.java created by IDE, it contains only constructor. Right-clicking on [java] folder I created 'All in Module' JUnit3 test configuration.
Tests complete successfully when I Run them, however fail if I Debug the configuration. Failure reason says 'Terminated' (screenshot, IDEA log) which explained in the documentation as 'Test terminated. This status is assigned to tests that were cancelled by clicking the Stop button'. Just want to confirm that I didn't click the Stop button.
Logcat logs don't report any failures, IDE log reports 2 tests passed too. However problem remains as IntelliJ still reports a termination.
Sometimes I also getting 'Test framework quit unexpectedly' error and no tests succeed.
I've done some research and found similar questions, no real solutions mentioned. Have strong suspicion that this is a configuration issue.
What do I do wrong?
Gabor's suggestion seemed to fix this issue for me. On a Mac (and I presume on a Windows machine, but with a different route to get there) go to Preferences:
From the menu bar at the top Android Studio → Preferences
or
Hit ⌘ and , to jump straight to it.
Then in the menu search box type "instant". Uncheck the box that says "Enable instant run..", which looks like the image below.
That fixed it for me; didn't even need to restart/kill ADB.
It seems to be enabled by default, and I use it often to hot-swap changes during development, so I didn't think to turn it off when running Espresso tests.
In my situation, the problem is solved by setting in the test's run configuration:
Shorten command line -> JAR manifest.
To get rid of unit test problems in debug mode, I deleted all test folders in android studio explorer, then I commented three test implementation lines in build.gradle(module) file. Then I changed the combobox in android studio menu (top of the IDE) from "all in app" to "app".
https://i.stack.imgur.com/alPrS.png
In our case the fix (that may not be required in newer Android-versions) was to:
Open Edit Configuration... for All tests (or what ever you renamed it into).
Switch to Debugger tab.
And finally, in Debug mode combo-box, select the Java option, because:
Although we have lots of Native codes,
Android-studio 3.2.1 (which we were using) does not seem to support debugging both (but Java only mode works fine).

Error while creating a Java ME mobile application

Im new to java ME and netbeans and Im trying to create a new mobile application, I have installed Oracle ME 8.0 SDK and activated it. I've added the platform but when I try to create a new Mobile application in the step 4 I have both Emulator plataform and Device in blank and I cant chose any other option.
Though I can still keep going with the project when I finish it I get a bunch of weird errors in my project, first one is :
-Fatal error: unable to find package java.lang in classpath or bootclasspath
-Cannot find symbol, symbol: class MIDlet
Without more details is hard to tell but it might be related to the use of classes not available on JavaME.
Check the documentation to see which classes are available and which are not here.

Bndtools: Problems preparing runtime environment

I installed Bndtools in Eclipse and tried out their quick tutorial: http://bndtools.org/tutorial.html
But as soon as I want to start a very simple component via the "Run OSGi" button, I receive a Launch Error prompt:
Status ERROR: bndtools.core code=0 At least one of the required parameters could not be detected; specify an override. Detected: osgi.native;osgi.native.osname:List<String>="null";osgi.native.osversion:Version=null;osgi.native.processor:List<String>="x86-64,amd64,em64t,x86_64", for cmd: native_capability, arguments; [native_capability] null
Status WARNING: bndtools.core code=0 No translation found for macro: native_capability, in org.example.impls null
The Apache Felix Gogo Shell starts at some configuration with the OSGi Framework Run setting, but the errors persist. I tried it with Eclipse Kepler and Lunar, as well as JDK 7 and 8.
I have no idea what to make of the error and warning. Something seems to be missing somewhere. Does anyone know how to solve this issue?
Thanks in advance!
For completeness sake; this error is caused by a bug in bnd (reported here: https://github.com/bndtools/bnd/issues/573). The operating system name/version reported by Java is not recognised, as this version of bnd was released before Windows 8.1.
Aside from the error in the output there should be very little effect. You may encounter problems running bundles that contain native code, but the majority of bundles containing pure Java will work fine.
I have not seen this error before. Did you select an OSGi framework and Execution Env. in the run configuration?
Please see if your bnd file contains launch descriptions. Usually, the launch descriptions are defined in a different file called .bndrun file. (A bnd.bnd file can actually also act as a .bndrun file.) The bndrun file inherits properties from the workspace, not the profile.
In such scenarios - you will have to click the run button from the .bndrun file

Running Jspresso Human Resources sample application

I have downloaded Jspresso Human Resource sample appplication from here:
http://www.jspresso.org/page/jspresso-download-area
I don't know about Jspresso framework. I just want to run this downloaded Human Resource Sample application and see how it works. But from the downloaded content I don't know how to make it run. It would be nice if I can run it from command prompt because later I want to profile the application with Java profiler (the profiler I use is command line tool). I already have JDK and Tomcat installed.
Does somebody know how to run this Human Resource sample application from Jspresso?
I found how to install and make it run here:
http://www.jspresso.org/page/jspresso-10-minutes

Categories

Resources