Open Source & Free

LAYOUT BASICS

Layouts are the reason a Codename One UI can survive different screen sizes, orientations, pixel densities, and languages. Components do not live at fixed coordinates. They live inside Container objects, and those containers use layout managers to decide how much space each child gets and where it should appear. ...

Codename One

LOCALIZE/TRANSLATE MY APPLICATION? APPLY I18N/L10N (INTERNATIONALIZATION/LOCALIZATION) TO MY APP?

Internationalization and localization are broader than translation. Internationalization means structuring the app so it can adapt to different locales. Localization is the work of adapting the app to a specific locale. Language is part of that, but so are dates, numbers, currency, right-to-left behavior, phrasing, and the cultural meaning of visual choices. ...

Codename One

TAKE A PICTURE WITH THE CAMERA

Taking a picture in Codename One is conceptually simple: ask the platform to capture an image, get back a file, load the image you actually want to display, and then update the UI. The details matter because camera images can be much larger than the UI really needs. ...

Codename One

USE CLOUD CONNECT

Cloud Connect was designed to solve a very specific problem: seeing UI changes on real devices immediately while working in the GUI builder. It synchronized the builder’s saved UI state to connected devices so that you could feel the screen on hardware instead of relying only on the desktop preview. ...

Codename One

USE HTTP, SOCKETS, WEBSERVICES AND WEBSOCKETS

Networking on mobile is not the same as networking on the desktop or server. Connections disappear, latency changes abruptly, background execution is limited, and platform security rules can reject traffic that would look perfectly normal elsewhere. If you start with that assumption, the rest of the networking choices in Codename One make much more sense. ...

Codename One

USE PROPERTIES TO SPEED DEVELOPMENT

Codename One properties are useful when you want one model class to do more than simply hold data. A plain old Java object can represent state just fine, but it does not automatically know how to bind to UI, serialize itself, parse structured input, or describe its own fields at runtime. The properties API exists to make those jobs easier. ...

Codename One

USE STORAGE, FILE SYSTEM AND SQL

Persistent data in Codename One usually starts with a choice between three levels of storage: Preferences for very small settings, Storage for simple app-private persisted objects or blobs, and SQL for data that needs real querying, sorting, or filtering. The file system sits beside those as a lower-level tool rather than the default answer to every persistence question. ...

Codename One

WORK WITH MULTI IMAGES AND DEVICE DENSITIES

Image handling on mobile starts with density, not just resolution. Two devices can have very different physical sizes and very different pixel densities, which means the same raster image can feel too small, too large, or too soft depending on where it is shown. That is why Codename One introduced multi-images and why density still matters even in a modern CSS-first project. ...

Codename One