SkillAgentSearch skills...

CodenameOne

Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.

Install / Use

/learn @codenameone/CodenameOne

README

<h1 align=center> <img align=center width="100%" src="https://www.codenameone.com/github/CN1-Banner-Dark-Blue.jpg" /> </h1>

GitHub repo size GitHub top language GitHub last commit GitHub license Hacktoberfest GitHub Stars

Codename One - Cross Platform Native Apps with Java or Kotlin

Codename One is a mobile first cross platform environment for Java and Kotlin developers. It can compile Java bytecode to native OS executables (iOS, Android, UWP etc.). It's a complete mobile platform featuring virtual machines, simulator, design tools (visual theme/builder/css), IDE integrations, ports to multiple OS's and much more. It provides full access to the underlying native OS code (e.g. Objective-C, C#, Dalvik/ART) through a portable abstraction which enables 100% code reuse.

<!-- [![Build Status](https://travis-ci.org/codenameone/CodenameOne.svg?branch=master)](https://travis-ci.org/codenameone/CodenameOne) ![GitHub language count](https://img.shields.io/github/languages/codenameone/CodenameOne?style=plastic) <p> <a href="https://twitter.com/CodenameOne"><img src="https://img.shields.io/badge/twitter-%231DA1F2.svg?&style=for-the-badge&logo=twitter&logoColor=white" height=25></a> <a href="https://medium.com/CodenameOne"><img src="https://img.shields.io/badge/medium-%2312100E.svg?&style=for-the-badge&logo=medium&logoColor=white" height=25></a> <a href="https://dev.to/codenameone"><img src="https://img.shields.io/badge/DEV.TO-%230A0A0A.svg?&style=for-the-badge&logo=dev-dot-to&logoColor=white" height=25></a> -->

🌟   Codename One is the only platform that..

  • Has Write Once Run Anywhere support with no special hardware requirements and 100% code reuse
  • Compiles Java or Kotlin into native code for iOS, UWP (Universal Windows Platform), Android and even JavaScript (with seamless PWA and Thread support)
  • Is Open Source and Free with an enterprise grade commercial offering
  • Is Easy to use with 100% portable Drag and Drop GUI builder
  • Has Full access to underlying native OS capabilities using the native OS programming language (e.g. Objective-C) without compromising portability
  • Has full control over every pixel on the screen! Just override paint and draw or use a glass pane to draw anywhere...
  • Lets you use native widgets (views) and mix them with Codename One components within the same hierarchy (heavyweight/lightweight mixing)
  • Supports seamless Continuous Integration out of the box
<br>

✨   Here are some concrete benefits you can get with Codename One:

<br> <img align="right" src="https://www.codenameone.com/github/runs-instantly.png" height="200">

Codename One's Simulator Runs Instantly

Unlike emulators which you can see in Android etc. Codename One uses a simulator. This means it starts up fast even when debugging. You can enjoy IDE features such as live code reload to modify code in runtime etc.

This means faster debugging cycle and faster development process!

<br> <img align="left" src="https://www.codenameone.com/github/large-selection-skins.png" height="200">

Large Selection of Device Skins

Choose from a large selection of device "skins" to see how your app will look on particular devices. The skin takes into account factors such as resolution and device density to provide a pixel-perfect presentation of your app, as it would appear on the real device. Switching between device skins is nearly instant.

You can edit and contribute skins in their own open source project here.

<br> <img align="right" src="https://www.codenameone.com/github/interactive-console.png" height="200">

Interactive Console

Interact with your application’s APIs at runtime using the interactive Groovy Console. Inspect the application state or experiment with changes all while the app is running.

This lets you investigate issues and experiment without even the small overhead of recompiling.

<br> <img align="left" src="https://www.codenameone.com/github/live-reload.png" height="200">

Live Reload

The Simulator let’s you take advantage of the "Reload Changed Classes" feature in IntelliJ (named "Apply Code Changes" in NetBeans) so that changes you make in your Java source code will be applied immediately to your already-running app in the simulator.

Note that this is often superior to the interactive console but there are limitations such as the ability to add methods/change structure of the code. These limits don't apply to the interactive console!

<br> <img align="right" src="https://www.codenameone.com/github/css-live-update.png" height="200">

CSS Live Update

When you make changes to your app’s CSS stylesheet, the changes are reflected instantly in the simulator. This includes changing your theme, images, fonts etc. All changes are instantly refreshed on save, no need to reload/refresh or anything of the sort!

This makes the process of styling an application remarkably easy and fast.

<br> <img align="left" src="https://www.codenameone.com/github/component-inspector.png" height="200">

Component Inspector

Use the powerful component inspector to browse the UI component hierarchy in your app. This tool makes it easy to find out where that extra padding is coming from or why something just isn’t lining up the way you’d like. You can also change the UIID (selector) of a component in runtime to see how it impacts the UI and see which component in the hierarchy maps to an element in the component tree (DOM equivalent).

<br> <img align="right" src="https://www.codenameone.com/github/network-monitor.png" height="200">

Network Monitor

See all of the network connections that your app makes using the Network Monitor. This valuable tool comes in handy when you’re trying to figure out why an HTTP request isn’t working for you. Check the headers and bodies of both the request and the response. You can even throttle the network to simulate a slow network connection.

<br> <img align="left" src="https://www.codenameone.com/github/record-ui-unit-tests.png" height="200">

Record UI Unit Tests

Use the Test Recorder tool to record unit tests for your app. Once you start recording, it will save your interactions into a unit test that can be played back later to verify that behaviour remains correct.

You can then connect the recorded tests to your CI process including automated on device testing.

<br>

How Does it Work?

Codename One is a mature open source project with roots dating back to Sun Microsystems (2006) where one of its core underlying components was developed and open sourced. You can learn about its history and how it works in this video.

Codename One apps perform like native apps, because they are real native apps.

They are statically compiled into native binaries using the target platform’s official build tools.

On platforms that do not support Java natively, such as iOS, the app’s JVM bytecode is first transpiled into a form that the native build tools will accept. On iOS, the app’s JVM bytecode is transformed into C source code, in a real xcode project. On Android, since Java is supported natively, no such transformation is necessary. The app jar is bundled directly into an Android studio gradle project, which can be built directly using the Android SDK build tools.

The figure below shows the build process for each supported platform:

<a href="https://www.codenameone.com/img/github/codename-one-architecture.jpg" target="_blank"><img width="70%" src="https://www.codenameone.com/github/codename-one-architecture.jpg"></a>

You can click the image to enlarge or view a PDF version here.

Quick Start

TIP: We are currently transitioning to Maven, and have created a new, simpler method for creating projects. Check out https://start.codenameone.com to get started now.

There is a lot to know about Codename One, this 3 minute video gives a very concise high level view. Notice there are similar videos for Eclipse, IntelliJ/IDEA and Netbeans here:

<div> <a href="https://www.youtube.com/watch?v=rl6z7DD2-vg "><img src="https://i.imgur.com/gXfNhFR.png" target="_blank" alt="Hello Codename One" img width="80%"> </a> </div>

Extensible

Codename One can be extended easily using 3rd party libraries that can include native OS code. There is an extensive list of these libraries (cn1libs) here. The libraries list is generated automatically based on this github project.

You can learn more about Codename One and its capabilities at the main site and you can see an extensive list of documentation and tutorials here.

Important Links & Docs

You can get started with the binary and the birds eye view in the download section. Additional important links are:

  • [JavaDoc](https://
View on GitHub
GitHub Stars1.8k
CategoryDevelopment
Updated1d ago
Forks436

Languages

Java

Security Score

85/100

Audited on Mar 20, 2026

No findings