2

OK so I finally decided to post my hard time here for help after two days of Googling and frustrating myself. I am trying to build a simple android app. I am using latest version of Eclipse Kepler and running Mac OS X (Mavericks). I have the latest JRE 8 (updated 05). I have downloaded and installed the ADT Plugin. I have set the location to the Android SDK in Eclipse. The SDK Manager and AVD Manager are all set and OK. On creating a new Android project, at the point where there's the Blank Activity screen, I click finish and the Blank Activity Screen won't vanish (I don't know why :( ). I close it then and copy all my java classes into the src of the project but get dozens of errors that go like The import javax.microedition.lcdui cannot be resolved.

I have done the process several times trying different options and checking if this thread would help: import android packages cannot be resolved but it didn't. At this point I am stuck and out of ideas and would appreciate some help here. This is how my IDE looks like currently: enter image description here

Community
  • 1
  • 1
emi
  • 2,830
  • 5
  • 31
  • 53

3 Answers3

4

javax.microedition.lcdui is not part of the Android SDK

Blackbelt
  • 156,034
  • 29
  • 297
  • 305
  • Indeed. And you can't even easily add your own implementation, as the SDK compiler will refuse to let you put things in the javax namespace. To build a wrapper you either have to change the package name where you use it and implement it in that custom package, or monkey around with the build system. But hopefully this is not a case of a highly invested codebase which needs to be ported, but rather a simple one of mistakenly choosing inapplicable starting material to learn from. – Chris Stratton Apr 23 '14 at 14:29
1

You are using Java MicroEdition (Java ME) API instead of Android, while it is not valid. J2ME and Android have totally different SDK. Please, follow the description from the Android Developer main page: http://developer.android.com/sdk/index.html

If you really want to use J2ME MIDP jars on Android (it is not recommended, but it's your will), please, see this thread:

Running J2me apps on Android phones

Community
  • 1
  • 1
Benjamin
  • 3,217
  • 2
  • 27
  • 42
0

Package javax.microedition.lcdui is part of Java ME.

josliber
  • 43,891
  • 12
  • 98
  • 133
Vivek Vermani
  • 1,934
  • 18
  • 45