How can I use an user interface (GUI) in Java ME? I followed some tutorials and all them point to the javax.microedition.lcdui package, but it just doesn't exist in Java ME 8 SDK.
Since I can't find that package, and SDK 3.4 gives me errors in Netbeans (I activate it and add it as platform, but it doesn't appear when I have to choose a simulation platform when creating a project.
You can see here how I don't have the LCDUI package:
I need some help in order to use GUIs in this Java version.
Thank you.
As far as I know JavaME 8 is targeted at the embedded space and isn't supported on phones etc. It should have a profile without any UI elements and might have JavaFX embedded.
I am unaware of any device in the field that supports JavaME 8 but might be missing something.
Related
I am working with code that involves using the JavaFX platform and I encountered the following error from Eclipse while trying to import the Application class from the javafx.application package:
Access restriction: The type 'Application' is not API (restriction on
required library rt.jar)
I encountered the above error when trying to import classes from the javafx.application, javafx.scene, and javafx.stage packages.
Thanks to this answer, I know so far that the problem arises from access restrictions placed by Eclipse by default to prevent the accidental use of classes which it thinks are not part of the public API. Is this the case for JavaFX? Also, I'm also not sure I'm completely clear on what it means for a package or class to be in the public API.
Thank to responses from #Slaw and #Benjamin to #Florian's answer, I think I can now provide an answer to my question:
JavaFX 2.2 and later releases are fully integrated with the Java SE 7 Runtime Environment (JRE) and the Java Development Kit (JDK). However, JavaFX is no longer a part of the standard JDK, as of Java SE 11. This is probably why Eclipse is worried and requires explicit access rules for the library.
Also, the comments have helped to clarify that this does not mean that the stability and future reliability of JavaFX is completely uncertain. JavaFX, as of now, is stable and is being developed as OpenJFX which is part of the OpenJDK project (a free, open-source implementation of the Java SE). The latest release is JavaFX 13.
In summary, JavaFX has a "public" API such as the javafx.* packages and a "private" API such as the com.sun.javafx.* packages. However, the implication of the current state of JavaFX is that as a library, it will have to be pulled in like any other external dependency since it is not bundled with the standard JDK/JRE.
To make it short, JavaFX is not in the "public" Java API.
The Java API contains the most common tools a developer needs, for example collections, network, different parsers, etc...
Therefor JavaFX is not in the public Java API.
If you want to see which tools are included you can check out this link https://docs.oracle.com/javase/7/docs/api/ .
I've taken some java classes to learn programming, but I haven't actually built a fully functional java application. I want to build a fairly simple form-based application for my own uses on a single pc with a MySQL back end (using Eclipse as the IDE). So, I went to create the new project and I'm a little stumped on which JRE to choose. And a quick Google search just confused me more. There are 3 choices:
1. Use an execution environment JRE (with a list of options that seems to default to OSGi/Minimum-1.2
2. Use a project specific JRE (has a dropdown with a single option: 'jre1.8.0_31')
3. Use default JRE (currently 'jre1.8.0_31')
Does it matter which JRE I choose? I don't want to go through the process of building a whole application then discover I can't run it as a stand alone application because I chose the wrong thing here.
Sorry about my noob question, but I'm just trying to get up and running and then hopefully I will be good to go.
If you are willing to develop your own applications, consider using JDK instead. It will as well provide you support for running applications.
I am currently using build "1.8.0_144"; however, you can get the latest release at Oracle's web page
i have a stupid question. Its possible to export JavaFX2 to Android. I have some Object in my JavaFX2 world and i would like to use this for a simple Android Application. I already exported some classes into the Android e.g. SimpleStringProperty, but with some i getting always an exception org.slf4j.LoggerFactory.getLogger (Ljava/lang/Class;)Lorg/slf4j/Logger;
I will be very happy for every ideas... big thanks!!
Update: is the amount of classes limited ???
slf4j is a logging wrapper which is unrelated to JavaFX.
Consult the slf4j documentation and the documentation for whatever logging framework you are wrapping in slf4j to help resolve your problem. If you include in your question the full stack trace for the error you receive you might be able to get more assistance.
There is currently (as of JavaFX 2.0) no public port of JavaFX to Android and Android is not a supported platform for JavaFX. For the majority of the JavaFX functionality, I'd advise waiting until when (and if) Oracle release an Android build for JavaFX before trying to use it on Android.
There is a reasonable chance that the property and binding framework from JavaFX (javafx.beans.* packages) would work on Android as that code was designed to work independently of the rest of JavaFX. The property and binding part of JavaFX is currently not open source, though a lot of the rest of the JavaFX source code is. The framework was developed to run on top of JavaSE and not Android, so some Android specific source code changes may be required to allow the JavaFX property and binding framework to run on Android. Also, before doing something like that I would advise checking the JavaFX license (which is the same as the Java SE license).
I am just learning about android app development and have created my first app which is a relatively simple app with a link to a gallery of images and some text pages. I created this using the 1.5 platform as it seemed sensible to make it backwards compatible. I've been testing it on 3.0 and it comes up tiny on the screen and I have since learnt I need to use supports-screens and other related commands to allow variable screen support which from what i read is only available in 1.6 and above. As a result I need to change the app platform to 1.6 or above and my questions are as follows:
1) Am I able to just go to project properties and change the platform version tickbox to a newer one (in this case 1.6)? As I tried this with the project but the supports-screens tag still gives an error (which it doesn't when I create a brand new project)?
2) What version should I be creating it in these days for ideal backwards compatibility but able to use most desirable features? I understand 1.6 includes a lot of the newer functionality but according to http://developer.android.com/resources/dashboard/platform-versions.html only about 4% of people are using less than 2.1 so is it better to just code using 2.1 (assuming I want to target mobiles and tablets)?
Thanks so much for your help as ever,
Dave
Take a look at this. It explains how you can go about changing your AndroidManifest.xml to specify which version of the SDK to use. You may also need to update default.properties to point the target to the proper api value.
This really depends on what you want to do. If you require something from 2.1 or 3.0, then I think you need to go with that. But if you can get by using just 1.6 and still have all the functionality that you need/want, then I would definitely recommend using 1.6.
I am trying to write a Java application showcasing Bluetooth features. On general search, I found JSR82 has been defined for the same.
I am not able to figure out exactly how to use it. I am using standard java 1.6 and I believe for JSR82 implementation I would need J2ME running.
I need help to understand how to use the 2 java editions together. I have never worked with the Micro Edition before. Would appreciate any inputs.
Thanks & Regards,
Keya
You can simple try using a JSR82 implementation on your mobile device - it should work.
This site has some good information about it.
Here are two JSR82 implementations I know of:
Bluecove
Avetana
Go to http://java.sun.com.
Install the jdk and the latest full version of Netbeans for your linux computer.
Use Netbeans to create a HelloWorld mobile application
Run it in the Wireless ToolKit emulator packaged into Netbeans.
That should work right out of the box.
You then need to read the JSR-118 specification to understand how a MIDlet works.
Then read the emulator documentation to figure out how to provide bluetooth data to your MIDlet.