Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Demonstrates a simple Codename One app with a Todo list, adding tasks, and displaying them using native UI components.
import com.codename1.ui.*;
import com.codename1.ui.layouts.BoxLayout;
public class TodoApp extends Form {
private DefaultListModel<String> todos = new DefaultListModel<>();
private List todoList;
private TextField newTodo;
public TodoApp() {
setTitle("Todo App");
setLayout(new BoxLayout(BoxLayout.Y_AXIS));
newTodo = new TextField("", "New Todo");
Button addButton = new Button("Add");
todoList = new List(todos);
addButton.addActionListener(e -> {
if(!newTodo.getText().trim().isEmpty()){
todos.addItem(newTodo.getText().trim());
newTodo.clear();
}
});
addAll(newTodo, addButton, todoList);
}
public void start() {
show();
}
}Codename One is a cross-platform mobile development framework that allows developers to build native mobile apps for iOS, Android, Windows, macOS, and web using Java or Kotlin. It provides a single codebase with a rich set of UI components and native device access.
Origin & Creator
Created by Shai Almog and the Codename One team in 2012, Codename One was designed to simplify mobile app development across platforms using Java.
Industrial Note
Best suited for teams with strong Java expertise who want to write once and deploy anywhere without managing multiple platform-specific projects.