Search code examples
javacodenameonemobile-devices

Does Codename One have the same capabilites than the default languages of mobile platforms?


So I recently discovered Codename One and was intrigued by the fact that it uses Java for developing cross-platform mobile apps.

I was thinking if it is better or worse than the default languages that mobile platforms use.

Does it have more or less or the same capabilities as the default languages have? Can it do everything that can be done on the default Android Java? What's its difference from the defaults as well as its pros and cons?


Solution

  • A large number of features common to most devices can be implemented through CN1's API, so you just write the code one time and then build it for whatever device. You can do the same thing for the GUI, or you can customize it for each platform.

    There are still a number of features not directly exposed in the CN1 API. You can create a native interface for those that becomes a connecting path from your main device-agnostic CN1 program to platform-specific classes that you write in the native platform code. It works like any Java interface so you just write native code for each method you need for each language (Objective C, C#, Dalvik, etc).

    In addition, you can create a CN1LIB that is basically a native interface and the native classes that get compiled together into a JAR that CN1 will use as if it were an included API, so you get the auto code completion and other nice IDE features.