<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shai Almog</title>
    <description>The latest articles on DEV Community by Shai Almog (@codenameone).</description>
    <link>https://dev.to/codenameone</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F417973%2Fa7b22dd9-5565-48f5-bfab-7e5035b3888f.png</url>
      <title>DEV Community: Shai Almog</title>
      <link>https://dev.to/codenameone</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codenameone"/>
    <language>en</language>
    <item>
      <title>Open Photoshop, Sketch and Figma Files in Your App, and Play Rive Animations</title>
      <dc:creator>Shai Almog</dc:creator>
      <pubDate>Sun, 06 Dec 2026 14:01:01 +0000</pubDate>
      <link>https://dev.to/codenameone/open-photoshop-sketch-and-figma-files-in-your-app-and-play-rive-animations-dbn</link>
      <guid>https://dev.to/codenameone/open-photoshop-sketch-and-figma-files-in-your-app-and-play-rive-animations-dbn</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5uoqfehusenxof6kgyma.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5uoqfehusenxof6kgyma.jpg" alt="Photoshop, Sketch, Figma and Rive in your app" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Designers hand developers files. Photoshop files, Sketch files, Figma links, SVGs, Rive animations. Until now the developer's job was to flatten all of that into PNGs and hope nobody asked for a change. If your app itself works with design files, a print shop, a sticker maker, a template editor, a brand portal, you needed a native SDK per platform and a server to fill the gaps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Codename One?&lt;/strong&gt; Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at &lt;a href="https://www.codenameone.com/" rel="noopener noreferrer"&gt;codenameone.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This week those files open inside your app, keep their layers, and render the same pixels on iOS, Android, the desktop and the web.&lt;/p&gt;

&lt;h2&gt;
  
  
  One document tree for every format
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;com.codename1.art&lt;/code&gt; reads every format into the same &lt;code&gt;ArtDocument&lt;/code&gt; tree of groups, shapes, text, raster layers and adjustments.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Format&lt;/th&gt;
&lt;th&gt;Read&lt;/th&gt;
&lt;th&gt;Write&lt;/th&gt;
&lt;th&gt;What's kept&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SVG&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;Shapes, paths, &lt;code&gt;use&lt;/code&gt;, gradients, patterns, clip paths, masks, text, images, CSS, filters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PSD and PSB&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;Layers, groups, masks, vector masks, clipping, layer styles, adjustment layers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sketch 43 and later&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Pages, artboards, symbols with overrides, shared styles&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Figma&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Files fetched through the Figma REST API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.cn1gfx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;Everything, losslessly&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;ArtFormats.read&lt;/code&gt; detects the format from the bytes, not the file name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;ArtDocument&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ArtFormats&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;      &lt;span class="c1"&gt;// SVG, PSD, Sketch, Figma or .cn1gfx&lt;/span&gt;
&lt;span class="nc"&gt;Image&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ArtRenderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// two pixels per document unit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg3p6v8uh25j7bhd7u365.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg3p6v8uh25j7bhd7u365.png" alt="A PSD, a Sketch file and an SVG rendered side by side" width="409" height="919"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBQU0RbUFNEIC8gUFNCXSAtLT4gVAogICAgU0tbU2tldGNoXSAtLT4gVAogICAgRkdbRmlnbWEgUkVTVF0gLS0-IFQKICAgIFNWR1tTVkddIC0tPiBUCiAgICBUW0FydERvY3VtZW50IHRyZWVdIC0tPiBSW0FydFJlbmRlcmVyXQogICAgVCAtLT4gRVtBcnRFZGl0b3JdCiAgICBSIC0tPiBQWFtTYW1lIHBpeGVscyBvbjxici8-aU9TLCBBbmRyb2lkLCBkZXNrdG9wLCB3ZWJdCiAgICBFIC0tPiBPVVRbU1ZHLCBQU0QsIFBORywgLmNuMWdmeF0%3D%3Ftype%3Dpng%26bgColor%3Dffffff" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBQU0RbUFNEIC8gUFNCXSAtLT4gVAogICAgU0tbU2tldGNoXSAtLT4gVAogICAgRkdbRmlnbWEgUkVTVF0gLS0-IFQKICAgIFNWR1tTVkddIC0tPiBUCiAgICBUW0FydERvY3VtZW50IHRyZWVdIC0tPiBSW0FydFJlbmRlcmVyXQogICAgVCAtLT4gRVtBcnRFZGl0b3JdCiAgICBSIC0tPiBQWFtTYW1lIHBpeGVscyBvbjxici8-aU9TLCBBbmRyb2lkLCBkZXNrdG9wLCB3ZWJdCiAgICBFIC0tPiBPVVRbU1ZHLCBQU0QsIFBORywgLmNuMWdmeF0%3D%3Ftype%3Dpng%26bgColor%3Dffffff" alt="Diagram" width="764" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Live SVG, not transcoded SVG
&lt;/h2&gt;

&lt;p&gt;We've had an SVG transcoder for a long time. It turns SVG into Java at build time, which is ideal for icons you ship. It's useless for an SVG your user uploads at runtime. Now &lt;code&gt;Image.createSVG&lt;/code&gt; falls back to &lt;code&gt;ArtRenderer&lt;/code&gt; on any platform with no native SVG support, so a runtime SVG with filters, masks and CSS draws the same everywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Every Photoshop effect
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;ArtRenderer&lt;/code&gt; is a software renderer, which is why the pixels match across platforms. &lt;code&gt;com.codename1.art.effects&lt;/code&gt; implements drop and inner shadows, outer and inner glows, Gaussian, motion, zoom and background blur, strokes, color, gradient and pattern overlays, bevel and emboss, satin, Photoshop adjustment layers like levels, curves and hue and saturation, and the whole SVG filter primitive set.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F50vel4l767x2w4o8bdfu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F50vel4l767x2w4o8bdfu.png" alt="Layer styles and blend modes rendered by ArtRenderer" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Figma, straight from the API
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;FigmaClient&lt;/span&gt; &lt;span class="n"&gt;figma&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FigmaClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// the token is never stored&lt;/span&gt;
&lt;span class="nc"&gt;ArtDocument&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;figma&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"FILE_KEY"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;    &lt;span class="c1"&gt;// blocks: call it off the EDT&lt;/span&gt;
&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BorderLayout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;CENTER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ArtView&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ArtModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The client fetches images over HTTPS only and never sends your token along with them. If you already downloaded the JSON yourself, &lt;code&gt;FigmaReader.read&lt;/code&gt; takes it as is.&lt;/p&gt;

&lt;h2&gt;
  
  
  A drawing editor you can drop in
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;ArtEditor&lt;/code&gt; is a ready-made editor with a toolbar, a layers panel and an inspector. It selects, moves and resizes, pans, draws rectangles, ellipses, lines, Bezier curves and freehand strokes, paints and erases pixels, sets text, picks colors and fills. &lt;code&gt;ArtModel&lt;/code&gt; records an undo history, and &lt;code&gt;beginGroup()&lt;/code&gt; and &lt;code&gt;endGroup()&lt;/code&gt; turn a series of changes into one undo step. When the user is done, &lt;code&gt;exportSvg&lt;/code&gt;, &lt;code&gt;exportPsd&lt;/code&gt;, &lt;code&gt;exportPng&lt;/code&gt; or &lt;code&gt;exportNative&lt;/code&gt; hands you the result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4lnv5q0bvyzb79kbp7lp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4lnv5q0bvyzb79kbp7lp.png" alt="The drawing editor with toolbar, layers and inspector" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Files from strangers are a classic attack surface, so every reader caps dimensions, layer counts, decompressed size, ZIP entries and nesting depth. An oversized file throws an &lt;code&gt;IOException&lt;/code&gt;; it never takes your app's memory down with it. Anything a reader can't represent is listed in &lt;code&gt;ArtDocument.getNotes()&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rive, as an image
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://rive.app/" rel="noopener noreferrer"&gt;Rive&lt;/a&gt; makes interactive vector animations driven by state machines: a button that squishes, a mascot that reacts to the user, a loader with personality. Now a &lt;code&gt;.riv&lt;/code&gt; file is just an image, like an SVG or a Lottie file. Drop it next to your &lt;code&gt;theme.css&lt;/code&gt; and use it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;JuiceStyle&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;url&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;juice&lt;/span&gt;&lt;span class="nc"&gt;.riv&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;cn1-background-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cn1-image-scaled-fit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or from code, with the state machine inputs Rive designers wire up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Image&lt;/span&gt; &lt;span class="n"&gt;lightSwitch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Resources&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getGlobalResources&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"switch.riv"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BorderLayout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;CENTER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ScaleImageLabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lightSwitch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;lightSwitch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setAnimationInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"isOn"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;lightSwitch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fireAnimationTrigger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"bump"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The runtime is pure Java, translated from the open source Rive runtime. The build turns each &lt;code&gt;.riv&lt;/code&gt; into a Java class that builds the objects directly, so nothing is parsed on the device, there's no reflection, and an app with no Rive files carries none of the runtime. It plays shapes, gradients, clipping, timeline animations, state machines with layers, blends and listeners, bones, skins and IK, meshes, nested artboards, trim paths, embedded fonts, flex layouts and data binding with view models. Audio events play through the media API. Show it in a &lt;code&gt;RiveView&lt;/code&gt; and touch goes to the animation too.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you can build with it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A print or merchandise app that opens the customer's PSD and shows the real layers.&lt;/li&gt;
&lt;li&gt;A brand portal that pulls the latest screens straight from Figma.&lt;/li&gt;
&lt;li&gt;A template editor where users change text and colors in a designer's file and export it.&lt;/li&gt;
&lt;li&gt;A UI with the animations your designer actually made, instead of a GIF of them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;a href="https://www.codenameone.com/developer-guide/#graphics-documents" rel="noopener noreferrer"&gt;Graphics documents chapter&lt;/a&gt; has the full API. Tomorrow: &lt;a href="https://www.codenameone.com/blog/sixteen-components-and-charts-you-can-touch/" rel="noopener noreferrer"&gt;sixteen new components and charts you can touch&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mobile</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Open, Edit, Spell Check and Present Word and PowerPoint Files Inside Your App</title>
      <dc:creator>Shai Almog</dc:creator>
      <pubDate>Sat, 05 Dec 2026 14:01:03 +0000</pubDate>
      <link>https://dev.to/codenameone/open-edit-spell-check-and-present-word-and-powerpoint-files-inside-your-app-1c0o</link>
      <guid>https://dev.to/codenameone/open-edit-spell-check-and-present-word-and-powerpoint-files-inside-your-app-1c0o</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy99mrtyfdk6qrh3649cx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy99mrtyfdk6qrh3649cx.jpg" alt="Word documents and presentations in your app" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last week we put &lt;a href="https://www.codenameone.com/blog/a-million-rows-and-live-excel-formulas/" rel="noopener noreferrer"&gt;spreadsheets with live formulas&lt;/a&gt; in core. This week the other two office formats joined them. Your app can now open a Word document, let the user edit it with spell checking, and save it back as DOCX or PDF. It can open a PowerPoint or Keynote deck, edit a slide, and present it with a clock and speaker notes. On iOS, Android, the desktop and the web, from the same code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Codename One?&lt;/strong&gt; Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at &lt;a href="https://www.codenameone.com/" rel="noopener noreferrer"&gt;codenameone.com&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a mobile framework needs an office suite
&lt;/h2&gt;

&lt;p&gt;Users don't think in apps. They think in jobs. The inspector fills a report and needs it as a Word file for the client. The salesperson walks into a meeting with a deck and a tablet. The teacher grades an essay on a phone. Today each of those means bouncing the user out to another app, losing the context, and hoping the file comes back intact.&lt;/p&gt;

&lt;p&gt;That's the theme of this whole release: convergence. An app that does one small thing is a feature somebody else will ship inside a bigger app. The bigger app needs documents, decks and spreadsheets, so they belong in the framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  Word processing
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;com.codename1.wordprocessing&lt;/code&gt; models a document as an immutable list of blocks (paragraphs, tables and pictures) on a page spec. Every edit makes a new document that shares the unchanged blocks, so undo costs almost nothing.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Format&lt;/th&gt;
&lt;th&gt;Read&lt;/th&gt;
&lt;th&gt;Write&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DOCX&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ODT&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RTF&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTML&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Markdown, with GitHub tables&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Plain text&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DOC (Word 97 to 2003)&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PDF&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;DOCX and ODT keep styles, lists, tables with merged cells, inline and floating pictures with text wrap, footnotes, comments, tracked changes, sections with columns, headers and footers, and tab stops. Converting is two lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Document&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Format&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;DOCX&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;out&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Format&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PDF&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;DocumentView&lt;/code&gt; shows a document as pages and edits it the way &lt;code&gt;DataGrid&lt;/code&gt; edits a sheet. Tap places the caret, drag selects, typing edits through the model with undo, and pinch zooms. Page breaks match the PDF export exactly, because both are measured the same way. &lt;code&gt;DocumentEditor&lt;/code&gt; goes one step further and embeds live Codename One components inside the document, so a form field or a chart can sit in the middle of a page.&lt;/p&gt;

&lt;h3&gt;
  
  
  Spell and grammar checking
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;com.codename1.spellcheck&lt;/code&gt; uses Hunspell dictionaries, the same format LibreOffice and Firefox use, or the platform's own checker. It skips numbers, acronyms, URLs and email addresses, and keeps a user dictionary and an ignore list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;SpellChecker&lt;/span&gt; &lt;span class="n"&gt;spell&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SpellChecker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forLanguage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"en_US"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ProofIssue&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;spell&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;fixes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;spell&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;suggest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;substring&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;GrammarChecker.english()&lt;/code&gt; adds rules for repeated words, the choice between "a" and "an", sentence capitals and spacing, and you can add your own. &lt;code&gt;Proofreader&lt;/code&gt; combines both for an editor. English dictionaries for the US, Canada and Australia ship in the box; the &lt;code&gt;spellcheck.languages&lt;/code&gt; build hint picks which, and any Hunspell dictionary loads with &lt;code&gt;SpellChecker.create&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Presentations
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;com.codename1.presentation&lt;/code&gt; reads PPTX, ODP, PPT and Keynote, and writes PPTX, ODP and PDF with one page per slide.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Presentation&lt;/span&gt; &lt;span class="n"&gt;deck&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Presentation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Presentation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Format&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forFileName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;deck&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getWarnings&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;p&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"While reading: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BorderLayout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;CENTER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SlideShow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deck&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anything a reader can't convert, like an embedded video, shows up in &lt;code&gt;getWarnings()&lt;/code&gt; and the rest of the slide still loads. Nothing silently disappears.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fslides-shapes.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fslides-shapes.png" alt="A slide with preset shapes and gradient fills" width="409" height="281"&gt;&lt;/a&gt;Shapes, gradients and dashed outlines.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fslides-charts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fslides-charts.png" alt="A slide with live charts" width="409" height="281"&gt;&lt;/a&gt;Charts that animate in.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fslides-diagrams.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fslides-diagrams.png" alt="A slide with process and hierarchy diagrams" width="409" height="281"&gt;&lt;/a&gt;Process, hierarchy, cycle and radial diagrams.&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Charts on slides aren't pictures. They're live charts from the new chart package, so they animate in when the slide appears. Diagrams are laid out by the same graph engine as last week's flowcharts, and slide text is edited by the same &lt;code&gt;DocumentView&lt;/code&gt; as a Word document. That reuse is why this fit in a week.&lt;/p&gt;

&lt;h3&gt;
  
  
  Running the show
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;SlideShow&lt;/code&gt; plays the deck. Tap or swipe to move forward, and each slide plays its builds one click at a time (appear, fade, fly in, zoom, wipe, pulse), then its transition (fade, push, cover, uncover, wipe, zoom, from any side). Hidden slides are skipped. Presenter mode puts the current slide, the next slide, your notes and a clock on the screen you're looking at.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnat8w1201ewexj9ar063.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnat8w1201ewexj9ar063.png" alt="Presenter mode with the next slide, notes and a clock" width="409" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Editing slides
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;SlideView&lt;/code&gt; is an editor with thumbnails, the slide and a notes pane. Drag to move, pull a handle to resize, rotate with snapping to 15 degrees, and double tap a shape to type into it. Every drag and every text edit is one undo step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhnwjo7nq9kppn8zqnebb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhnwjo7nq9kppn8zqnebb.png" alt="The slide editor with thumbnails and notes" width="409" height="919"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBGW1BQVFgsIE9EUCwgUFBULCBLZXlub3RlXSAtLT4gUFtQcmVzZW50YXRpb24gbW9kZWxdCiAgICBQIC0tPiBTW1NsaWRlU2hvdzogcHJlc2VudF0KICAgIFAgLS0-IEVbU2xpZGVWaWV3OiBlZGl0XQogICAgUCAtLT4gSVtTbGlkZVJlbmRlcmVyOiBpbWFnZV0KICAgIFAgLS0-IFdbUFBUWCwgT0RQLCBQREZd%3Ftype%3Dpng%26bgColor%3Dffffff" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBGW1BQVFgsIE9EUCwgUFBULCBLZXlub3RlXSAtLT4gUFtQcmVzZW50YXRpb24gbW9kZWxdCiAgICBQIC0tPiBTW1NsaWRlU2hvdzogcHJlc2VudF0KICAgIFAgLS0-IEVbU2xpZGVWaWV3OiBlZGl0XQogICAgUCAtLT4gSVtTbGlkZVJlbmRlcmVyOiBpbWFnZV0KICAgIFAgLS0-IFdbUFBUWCwgT0RQLCBQREZd%3Ftype%3Dpng%26bgColor%3Dffffff" alt="Diagram" width="572" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The screen, the PDF export and &lt;code&gt;SlideRenderer.toImage&lt;/code&gt; all paint with the same code, so a thumbnail, a printout and the projector agree.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you can build with it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A field report app that fills a DOCX template and emails it as PDF.&lt;/li&gt;
&lt;li&gt;A sales app that opens the latest deck from the CRM and presents it offline on a tablet.&lt;/li&gt;
&lt;li&gt;A classroom app where students write essays with spell checking and teachers mark them up with comments and tracked changes.&lt;/li&gt;
&lt;li&gt;A note-keeping app that imports Markdown and exports Word for the people who still want Word.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of those used to be a commercial SDK per platform. Now it's a dependency you already have. The &lt;a href="https://www.codenameone.com/developer-guide/#presentations" rel="noopener noreferrer"&gt;Presentations chapter&lt;/a&gt; of the developer guide has the full API. Tomorrow: &lt;a href="https://www.codenameone.com/blog/photoshop-sketch-figma-and-rive-in-your-app/" rel="noopener noreferrer"&gt;Photoshop, Sketch, Figma and Rive&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mobile</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>We Built a Full Shopify Clone in Three Days</title>
      <dc:creator>Shai Almog</dc:creator>
      <pubDate>Fri, 04 Dec 2026 14:01:00 +0000</pubDate>
      <link>https://dev.to/codenameone/we-built-a-full-shopify-clone-in-three-days-2j48</link>
      <guid>https://dev.to/codenameone/we-built-a-full-shopify-clone-in-three-days-2j48</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxihbgs10us3l1jb5tkgr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxihbgs10us3l1jb5tkgr.jpg" alt="A full Shopify clone in three days" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Two weeks ago I wrote that &lt;a href="https://www.codenameone.com/blog/shopify-was-wrong-and-right-to-dump-react-native/" rel="noopener noreferrer"&gt;Shopify was wrong to dump React Native for two native codebases&lt;/a&gt;. Plenty of people told me it's easy to criticize a company that ships. Fair. So I put my money where my mouth is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Codename One?&lt;/strong&gt; Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at &lt;a href="https://www.codenameone.com/" rel="noopener noreferrer"&gt;codenameone.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We built Shopify. Not the mobile app. All of it.&lt;/p&gt;

&lt;p&gt;A shopper app. A merchant back office on phone, tablet, desktop, and web. A point of sale that keeps selling when the network dies. A marketplace admin. A server-rendered web store that search engines index. A blog. An app platform with OAuth installs, webhooks, UI extensions and checkout functions. Inventory across locations, invoicing, B2B price lists, subscriptions, loyalty, marketing journeys and an AI assistant. One Java codebase and one Java backend, running on SQLite, PostgreSQL, MySQL, or MariaDB.&lt;/p&gt;

&lt;p&gt;It took three days of work. The first commit landed on Friday, November 20, every phase of the plan passed its tests on SQLite, PostgreSQL and MySQL the next day, and the rest went into matching Shopify's feature list row by row. It's called &lt;a href="https://www.codenameone.com/bazaar/" rel="noopener noreferrer"&gt;Bazaar&lt;/a&gt;, the source is free under MIT-0, and it went in as &lt;a href="https://github.com/codenameone/CodenameOne/pull/6329" rel="noopener noreferrer"&gt;PR #6329&lt;/a&gt; while we shipped everything else in this post.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bazaar covers more than a store needs.&lt;/strong&gt; Our comparison table lists 267 Shopify features. Bazaar fully supports about 250 of them, including 28 that Shopify leaves to its app store.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It has things Shopify doesn't.&lt;/strong&gt; A sales pipeline board where dragging a card does the real work, and a purchase intent score on every cart.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The web store is HTML, on purpose.&lt;/strong&gt; Server-rendered pages, a sprinkle of htmx, no framework. HTML is the best tool for a web page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1,877 files is small.&lt;/strong&gt; For a mobile app, back office, register, website, extension platform, docs, tests and demo data, it's tiny.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shopify went backwards.&lt;/strong&gt; Every decade of computing raised the abstraction. Agents are a reason to climb higher, not to climb down.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What your customers want has nothing to do with your toolchain.&lt;/strong&gt; Stability, fast fixes, speed, reach and a great look. All of them come easier from a high level platform.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Coming This Week
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Saturday, November 28:&lt;/strong&gt; &lt;a href="https://www.codenameone.com/blog/word-documents-and-presentations-in-your-app/" rel="noopener noreferrer"&gt;Open, Edit, Spell Check and Present Word and PowerPoint Files Inside Your App&lt;/a&gt;. DOCX, ODT, RTF, PPTX, ODP, PPT and Keynote.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sunday, November 29:&lt;/strong&gt; &lt;a href="https://www.codenameone.com/blog/photoshop-sketch-figma-and-rive-in-your-app/" rel="noopener noreferrer"&gt;Open Photoshop, Sketch and Figma Files in Your App, and Play Rive Animations&lt;/a&gt;. Plus live SVG and a drawing editor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monday, November 30:&lt;/strong&gt; &lt;a href="https://www.codenameone.com/blog/sixteen-components-and-charts-you-can-touch/" rel="noopener noreferrer"&gt;Sixteen New Components, and Charts You Can Touch&lt;/a&gt;. Carousels, coach marks, chips, color pickers and 19 chart types that animate and zoom.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tuesday, December 1:&lt;/strong&gt; &lt;a href="https://www.codenameone.com/blog/stop-debuggers-hooks-and-keyloggers/" rel="noopener noreferrer"&gt;Stop Debuggers, Hooking Tools and Keyloggers Before They Reach Your Users' Money&lt;/a&gt;. The defenses a bank app needs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wednesday, December 2:&lt;/strong&gt; &lt;a href="https://www.codenameone.com/blog/oracle-sql-server-and-your-own-map-server/" rel="noopener noreferrer"&gt;Oracle, SQL Server and Your Own Map Server, From One Java Backend&lt;/a&gt;. Plus &lt;code&gt;io_uring&lt;/code&gt; under virtual threads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thursday, December 3:&lt;/strong&gt; &lt;a href="https://www.codenameone.com/blog/agents-that-freeze-time-and-on-device-ai/" rel="noopener noreferrer"&gt;Let Your Agent Freeze Time in the Simulator, and Run the Phone's Own AI Model&lt;/a&gt;. Gemini Nano and Apple Foundation Models from Java.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://www.codenameone.com/blog/word-documents-and-presentations-in-your-app/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fslides-presenter.png" alt="Presenter mode with the next slide, notes and a clock" width="409" height="334"&gt;&lt;/a&gt;Presenter mode.&lt;br&gt;
&lt;a href="https://www.codenameone.com/blog/photoshop-sketch-figma-and-rive-in-your-app/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fart-editor.png" alt="The drawing editor with layers and an inspector" width="800" height="356"&gt;&lt;/a&gt;Layers and effects.&lt;br&gt;
&lt;a href="https://www.codenameone.com/blog/sixteen-components-and-charts-you-can-touch/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fchart-sankey.png" alt="A Sankey chart" width="409" height="919"&gt;&lt;/a&gt;Sankey and 18 more.&lt;br&gt;
&lt;a href="https://www.codenameone.com/blog/sixteen-components-and-charts-you-can-touch/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fcomponents-coach-marks.png" alt="A coach mark tour highlighting a button" width="409" height="919"&gt;&lt;/a&gt;Coach marks.&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What three days bought
&lt;/h2&gt;

&lt;p&gt;Bazaar is four apps and a website over one backend. Shoppers browse many independent stores and check out on a phone or in a browser. Staff run the business from a back office. A cashier sells at a register. An administrator runs the marketplace.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBzdWJncmFwaCBPbmUgSmF2YSBjb2RlYmFzZQogICAgICAgIFNob3BbU2hvcHBlciBhcHA8YnIvPmlPUywgQW5kcm9pZF0KICAgICAgICBPZmZpY2VbQmFjayBvZmZpY2U8YnIvPnRhYmxldCwgZGVza3RvcCwgd2ViXQogICAgICAgIFBPU1tSZWdpc3Rlcjxici8-cGhvbmUsIHRhYmxldCwgZGVza3RvcF0KICAgICAgICBBZG1pbltNYXJrZXRwbGFjZSBhZG1pbl0KICAgIGVuZAogICAgV2ViW1dlYiBzdG9yZTxici8-c2VydmVyLXJlbmRlcmVkIEhUTUwgKyBodG14XQogICAgU2hvcCAtLT4gQVBJCiAgICBPZmZpY2UgLS0-IEFQSQogICAgUE9TIC0tIG9mZmxpbmUgcXVldWUgLS0-IEFQSQogICAgQWRtaW4gLS0-IEFQSQogICAgV2ViIC0tPiBBUEkKICAgIEFQSVtKYXZhIGJhY2tlbmQ8YnIvPlJFU1QsIEdyYXBoUUwsIFdlYlNvY2tldF0KICAgIEFQSSAtLT4gREJbKFNRTGl0ZSwgUG9zdGdyZVNRTCw8YnIvPk15U1FMIG9yIE1hcmlhREIpXQogICAgQVBJIC0tIHNpZ25lZCB3ZWJob29rcyAtLT4gQXBwc1tUaGlyZC1wYXJ0eSBhcHBzPGJyLz5hbnkgbGFuZ3VhZ2VdCiAgICBBcHBzIC0tIE9BdXRoIHRva2VucyAtLT4gQVBJ%3Ftype%3Dpng%26bgColor%3Dffffff" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBzdWJncmFwaCBPbmUgSmF2YSBjb2RlYmFzZQogICAgICAgIFNob3BbU2hvcHBlciBhcHA8YnIvPmlPUywgQW5kcm9pZF0KICAgICAgICBPZmZpY2VbQmFjayBvZmZpY2U8YnIvPnRhYmxldCwgZGVza3RvcCwgd2ViXQogICAgICAgIFBPU1tSZWdpc3Rlcjxici8-cGhvbmUsIHRhYmxldCwgZGVza3RvcF0KICAgICAgICBBZG1pbltNYXJrZXRwbGFjZSBhZG1pbl0KICAgIGVuZAogICAgV2ViW1dlYiBzdG9yZTxici8-c2VydmVyLXJlbmRlcmVkIEhUTUwgKyBodG14XQogICAgU2hvcCAtLT4gQVBJCiAgICBPZmZpY2UgLS0-IEFQSQogICAgUE9TIC0tIG9mZmxpbmUgcXVldWUgLS0-IEFQSQogICAgQWRtaW4gLS0-IEFQSQogICAgV2ViIC0tPiBBUEkKICAgIEFQSVtKYXZhIGJhY2tlbmQ8YnIvPlJFU1QsIEdyYXBoUUwsIFdlYlNvY2tldF0KICAgIEFQSSAtLT4gREJbKFNRTGl0ZSwgUG9zdGdyZVNRTCw8YnIvPk15U1FMIG9yIE1hcmlhREIpXQogICAgQVBJIC0tIHNpZ25lZCB3ZWJob29rcyAtLT4gQXBwc1tUaGlyZC1wYXJ0eSBhcHBzPGJyLz5hbnkgbGFuZ3VhZ2VdCiAgICBBcHBzIC0tIE9BdXRoIHRva2VucyAtLT4gQVBJ%3Ftype%3Dpng%26bgColor%3Dffffff" alt="Diagram" width="1026" height="577"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We keep a &lt;a href="https://www.codenameone.com/developer-guide/bazaar-feature-comparison/" rel="noopener noreferrer"&gt;feature comparison&lt;/a&gt; in the developer guide that walks Shopify, WooCommerce, BigCommerce and Square row by row. Here is the short version.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Area&lt;/th&gt;
&lt;th&gt;What's in Bazaar&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Catalog&lt;/td&gt;
&lt;td&gt;Variants, video and 3D models, bundles, digital downloads, combined listings, metafields and metaobjects, Google's product taxonomy, unit pricing, translations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inventory&lt;/td&gt;
&lt;td&gt;Multiple locations, transfers, purchase orders, suppliers, stocktakes, committed and incoming stock, serial numbers and lots with expiry, barcode label sheets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Checkout&lt;/td&gt;
&lt;td&gt;One-page checkout, Apple Pay and Google Pay, Klarna and Afterpay, iDEAL and SEPA, saved cards, gift cards, store credit, tipping, post-purchase upsell, fraud rules&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Orders&lt;/td&gt;
&lt;td&gt;Edits after placement, draft orders with pay links, authorize then capture on ship, PDF invoices, bulk actions, returns and exchanges with return labels&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shipping&lt;/td&gt;
&lt;td&gt;Zones, carrier-calculated rates, label buying, local delivery and pickup, routing rules across locations, CN 22 and CN 23 customs forms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Point of sale&lt;/td&gt;
&lt;td&gt;PIN sign-in, shifts and Z reports, split tender, card readers, ESC/POS printers and cash drawers, layaways, parked carts, offline mode with sync&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Marketing&lt;/td&gt;
&lt;td&gt;Discounts of every shape, flash sales with countdowns, email and SMS campaigns, journeys drawn as flowcharts, points, VIP tiers, referrals, paid clubs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B2B and markets&lt;/td&gt;
&lt;td&gt;Company accounts, price lists, net terms, quotes, multi-currency, EU VAT with VIES checks, OSS reports, duties estimates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Web&lt;/td&gt;
&lt;td&gt;Themes, a blog with RSS and Atom, menus, redirects, JSON-LD, sitemaps, predictive search with synonyms, custom domains, a cookie banner&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extensibility&lt;/td&gt;
&lt;td&gt;OAuth apps, scoped API keys, REST and GraphQL, webhooks with retries, UI extensions, checkout functions, an app directory with billing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Operations&lt;/td&gt;
&lt;td&gt;Analytics with a report builder and cohorts, live chat and calls, TOTP, OpenID Connect sign-in, audit log, multi-store organizations&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The demo seeds three stores with 90 days of history, and a demo pipeline keeps moving orders through to delivery so every screen has something happening on it. Here's the shopper app:&lt;/p&gt;

&lt;a href="https://www.codenameone.com/bazaar/bazaar-shopper-phone.mp4" rel="noopener noreferrer"&gt;Download the shopper video&lt;/a&gt;.

&lt;p&gt;And the back office the merchant runs it from:&lt;/p&gt;

&lt;a href="https://www.codenameone.com/bazaar/bazaar-merchant-desktop.mp4" rel="noopener noreferrer"&gt;Download the back office video&lt;/a&gt;.

&lt;h3&gt;
  
  
  The paid add-ons are built in
&lt;/h3&gt;

&lt;p&gt;This is the table I'd show a merchant. Each row is a feature Shopify leaves to its app store, which usually means another monthly subscription and another vendor with access to your customers. In Bazaar they ship in the box:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Usually a paid Shopify app&lt;/th&gt;
&lt;th&gt;In Bazaar&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Product reviews and review requests after delivery&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wishlists and back-in-stock alerts&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bundles and digital downloads&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Subscriptions, pre-orders, try before you buy&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Points, VIP tiers, referrals, paid memberships&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tiered and volume discounts, flash sales&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browse abandonment and push to shoppers&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Serial and lot tracking, barcode label printing&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Staff commissions at the register&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B2B quotes&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Amazon, eBay and Walmart marketplace sync&lt;/td&gt;
&lt;td&gt;Built in, behind a connector interface&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A Kanban fulfilment board with bins and pick lists&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Things Shopify doesn't have
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;sales pipeline&lt;/strong&gt; puts every open cart next to every open order on one board: browsing, at checkout, reminded, paid, fulfilling, shipped, delivered, return requested. Dragging a card does the real thing. Drag a cart to "reminded" and the recovery mail goes out. Drag an order to "shipped" and it ships. The server refuses any move that doesn't make sense. Shopify keeps abandoned checkouts and orders on separate pages.&lt;/p&gt;

&lt;p&gt;Every cart on that board carries a &lt;strong&gt;purchase intent score&lt;/strong&gt;, built from product views, return visits, time on product pages, cart value and past orders, with the reasons written in words on the card. A merchant knows which cart to chase before lunch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffk73ry5plj0nr6968j1t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffk73ry5plj0nr6968j1t.png" alt="The Bazaar sales pipeline on the desktop" width="800" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;assistant&lt;/strong&gt; answers from the store's own numbers, through a fixed set of queries the model calls as tools. The owner picks the provider (OpenAI, Anthropic, Gemini or any compatible server) and the key never leaves the server. With no provider at all, the same screens answer by rules.&lt;/p&gt;

&lt;p&gt;And the &lt;strong&gt;whole thing is yours&lt;/strong&gt;. Self-hosted, with the source, under a license that lets you copy it, change it and sell it.&lt;/p&gt;

&lt;h3&gt;
  
  
  A register that doesn't care about Wi-Fi
&lt;/h3&gt;

&lt;p&gt;Retail floors have dead spots, and payment terminals go offline at the worst possible time. Bazaar's register keeps every sale on the device and uploads when it reconnects. The trick that makes it safe is boring and correct: each sale carries an id the register made, and the server stores it as unique.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;clientId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;clientId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;storeId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sale&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clientId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;StoreOrder&lt;/span&gt; &lt;span class="n"&gt;again&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;existing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;clientId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;again&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// The answer was lost and the register retried: record it once.&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;duplicate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sale&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;again&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Send a batch twice and every sale lands once, and stock moves once. A sale is never refused for lack of stock, because the goods already left with the customer. It's marked oversold and audited instead.&lt;/p&gt;

&lt;a href="https://www.codenameone.com/bazaar/bazaar-pos-desktop.mp4" rel="noopener noreferrer"&gt;Download the register video&lt;/a&gt;.

&lt;h3&gt;
  
  
  Apps that can't take the store down
&lt;/h3&gt;

&lt;p&gt;The backend compiles ahead of time to a native server with no class loader, so a plugin can't be loaded into it. That's a feature. A plugin that shares your memory, threads and database connections is one slow plugin away from slowing every store on the platform.&lt;/p&gt;

&lt;p&gt;So a Bazaar app is a separate web service, in any language. It installs with OAuth and PKCE, reads and writes through scoped tokens, and hears about events through signed webhooks. Its UI extensions are JSON trees over a fixed set of blocks that the merchant app draws with its own components, so there is no script in a block. Checkout logic is a tiny language that Bazaar compiles, verifies and runs with a fixed instruction budget. Here's a pair deal and a bulk discount:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for line in lines {
  if line.quantity &amp;gt;= 2 { emit line_discount(line.index, line.total / 4, "Pair deal"); }
}
if cart.quantity &amp;gt;= 3 { emit discount(100, "Three and up"); }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every loop walks a list, so every loop ends. Overflow stops the function. An app that doesn't answer in time is left out, not waited for. The &lt;a href="https://www.codenameone.com/developer-guide/#extending-bazaar" rel="noopener noreferrer"&gt;Extending Bazaar&lt;/a&gt; chapter walks through a complete sample app, Restock Alerts, from install to its checkout field.&lt;/p&gt;

&lt;h2&gt;
  
  
  The web store is HTML, on purpose
&lt;/h2&gt;

&lt;p&gt;We could have shipped the storefront as the same Java app compiled to JavaScript. We do that for the back office in the browser, where it's the right call: it's an app, staff use it all day, and it's the same code as the tablet.&lt;/p&gt;

&lt;p&gt;A storefront is a different animal. It's a web page. It has to paint before a shopper loses interest, work without JavaScript, open from a link in an email, and rank on Google. For that, HTML is the best tool ever made. Better than React, better than any framework that ships a runtime to render the text that was already in the response.&lt;/p&gt;

&lt;p&gt;So product, collection, cart, checkout and account pages are server-rendered templates with titles, canonical links, JSON-LD and a sitemap. Small interactions use &lt;a href="https://htmx.org/" rel="noopener noreferrer"&gt;htmx&lt;/a&gt;, and every one of them falls back to a plain form post. Changing the postal code at checkout refreshes the delivery rates and nothing else:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"postal"&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"postal"&lt;/span&gt; &lt;span class="na"&gt;autocomplete&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"postal-code"&lt;/span&gt;
       &lt;span class="na"&gt;hx-post&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"/checkout"&lt;/span&gt; &lt;span class="na"&gt;hx-trigger&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"change"&lt;/span&gt;
       &lt;span class="na"&gt;hx-target&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"#summary"&lt;/span&gt; &lt;span class="na"&gt;hx-select&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"#summary"&lt;/span&gt; &lt;span class="na"&gt;hx-swap&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"outerHTML"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each page sends a Content Security Policy built from script hashes and a per-request nonce. Third-party widgets run in sandboxed frames, and scripts in an optional category load only after the visitor accepts that category in the cookie banner.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbazaar-web-store.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbazaar-web-store.png" alt="A Bazaar store's home page in the browser" width="800" height="450"&gt;&lt;/a&gt;A store's home page.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbazaar-web-product.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbazaar-web-product.png" alt="A product page with variants and reviews" width="800" height="450"&gt;&lt;/a&gt;Product pages.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbazaar-web-checkout.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbazaar-web-checkout.png" alt="The one-page web checkout" width="800" height="450"&gt;&lt;/a&gt;One-page checkout.&lt;p&gt;&lt;/p&gt;

&lt;a href="https://www.codenameone.com/bazaar/bazaar-web-storefront.mp4" rel="noopener noreferrer"&gt;Download the web store video&lt;/a&gt;.

&lt;p&gt;Picking the right tool per surface is the whole point. Java on every device, HTML for web pages, and one backend enforcing every rule once, so the web checkout and the app checkout can't disagree about a discount.&lt;/p&gt;

&lt;h2&gt;
  
  
  1,877 files is small
&lt;/h2&gt;

&lt;p&gt;That sounds like a lot until you look at what's in it.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Files&lt;/th&gt;
&lt;th&gt;Lines&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Backend, 60 packages from catalog to taxes&lt;/td&gt;
&lt;td&gt;692&lt;/td&gt;
&lt;td&gt;124,659&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shared request and response types&lt;/td&gt;
&lt;td&gt;431&lt;/td&gt;
&lt;td&gt;19,622&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The app: shopper, back office, register, admin&lt;/td&gt;
&lt;td&gt;231&lt;/td&gt;
&lt;td&gt;50,567&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tests (781 of them)&lt;/td&gt;
&lt;td&gt;151&lt;/td&gt;
&lt;td&gt;34,827&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQL migrations for three database dialects&lt;/td&gt;
&lt;td&gt;104&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Web templates, styles and scripts&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Demo media, screenshots and walkthrough videos&lt;/td&gt;
&lt;td&gt;139&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Guides for users, implementors and app developers&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;3,061&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The 431 shared files average 45 lines each: they are the request and response records the app and the server both compile. The client is 50,000 lines for four apps on six platforms. A native team would write each of those screens twice before it reached a desktop, and a third time for the web.&lt;/p&gt;

&lt;p&gt;I don't know how big Shopify's code is, but I know they have a large mobile team. I'd bet their code runs to millions of lines. To be fair, it covers more than Bazaar does, but I doubt that closes an order of magnitude.&lt;/p&gt;

&lt;p&gt;Yes, I could have pointed an agent at any stack and eventually gotten something that demos well. Not in three days, though: on many stacks the compile and test cycle alone eats that. Agents generate code in every language. The question is what happens on day four. Who tests it on every device? Who keeps the iOS and Android copies of the register in sync when a tax rule changes? Who reviews 260,000 lines spread over three languages and two UI toolkits?&lt;/p&gt;

&lt;p&gt;Here, the answer is the framework. Bazaar's tests run on the JVM, its screens are captured headless in a container, and its backend tests run against SQLite, PostgreSQL and MySQL in CI. It barely moved our token or CI budget. And because the client and the server share one language and one set of request types, a change to a tax rule is one change, reviewed once, tested once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agents should raise the abstraction, not lower it
&lt;/h2&gt;

&lt;p&gt;We don't want to compete with Shopify. I hope they take this code and build their next platform on it. That's what MIT-0 is for.&lt;/p&gt;

&lt;p&gt;I'm picking on Shopify because they're telling everyone else to make the same move. Their argument is that agents make the second copy of every feature cheap, so why share code at all. That's the lazy answer. It's doing what they always did, with a lower level of abstraction, and it gives their users nothing they can measure.&lt;/p&gt;

&lt;p&gt;Every decade of computing raised the abstraction. Machine code to assembly. Assembly to C. C to managed languages. Hand-rolled UIs to toolkits, toolkits to frameworks. Each step let the same team build something bigger. If agents make writing code cheap enough to justify climbing down a level, why stop at Swift and Kotlin? Have the agent write machine code. It doesn't get bored.&lt;/p&gt;

&lt;p&gt;Nobody does that, because the cost of software was never typing it. It's testing it, understanding it, and changing it without breaking it. Lower abstractions make all three harder, and agents make them harder still, because they write faster than anyone can review.&lt;/p&gt;

&lt;p&gt;Developers should expand to fill what their tools make possible. If you won't, your competitor will. Agents feel like an unlimited resource, but they aren't, and a lot of that resource is going into rebuilding solved problems one platform at a time. Sometimes that's right: plenty of web apps should never have been web apps. More often it's a regression wearing a new jacket.&lt;/p&gt;

&lt;p&gt;Put agents on a high level platform and the result is jet fuel. You get three days to a commerce platform, instead of three days to a second copy of the cart screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Native isn't what your customers want
&lt;/h2&gt;

&lt;p&gt;Ten years ago an early Codename One customer argued with me about this. "If I had unlimited resources," he said, "I'd pick native, because that's the best I can offer my customers. Right?"&lt;/p&gt;

&lt;p&gt;Wrong, for two reasons. No resource is unlimited, and agents didn't change that. But more important, what's best for his customers had nothing to do with which toolchain he used. Here's what customers want, and why every one of them is easier from a high level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A stable app.&lt;/strong&gt; One codebase has one set of bugs. Two codebases have two sets that drift apart, plus the bugs in the space between them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast fixes.&lt;/strong&gt; A fix written once ships everywhere the same day.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An app the next OS update won't break.&lt;/strong&gt; Codename One's UI is compiled into your app, and platform churn is our job. When Apple made UIScene mandatory and broke apps that hooked the app delegate, &lt;a href="https://www.codenameone.com/blog/uiscene-on-by-default-ios-performance/" rel="noopener noreferrer"&gt;our users didn't notice&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed.&lt;/strong&gt; Native code isn't faster by default. Performance comes from caching, batching and doing less work, and those are much easier to get right once, in one place. Our Base64 encoder is &lt;a href="https://www.codenameone.com/blog/ios-density-scroll-and-accessibility/" rel="noopener noreferrer"&gt;nearly three times faster than Apple's&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Features.&lt;/strong&gt; A Gantt chart, a spreadsheet or a sales pipeline written once is a feature on every platform. Written natively, it's a project per platform.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Everywhere.&lt;/strong&gt; On my phone, my desktop, my watch and my friend's GrapheneOS phone. One codebase reaches them all.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A great look.&lt;/strong&gt; People got it into their heads that native apps look better. That was true of older frameworks, and of older or lazily built Codename One apps. Look and feel isn't a function of the toolchain. It's a function of the developer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No, Bazaar isn't ready to replace your production store tomorrow morning. But the ground it covers in three days is staggering, it stands up to platforms with thousands of engineers, and parts of it are ahead of them. That's what a modern framework does with an agent behind it.&lt;/p&gt;

&lt;h2&gt;
  
  
  More This Week
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Word documents and presentations, in your app
&lt;/h3&gt;

&lt;p&gt;Last week we added &lt;a href="https://www.codenameone.com/blog/a-million-rows-and-live-excel-formulas/" rel="noopener noreferrer"&gt;spreadsheets with live formulas&lt;/a&gt;. This week the rest of the office arrived. &lt;code&gt;com.codename1.wordprocessing&lt;/code&gt; reads and writes DOCX, ODT, RTF, HTML and Markdown, reads old Word files and exports PDF. &lt;code&gt;DocumentView&lt;/code&gt; shows pages and edits them with undo, and &lt;code&gt;SpellChecker&lt;/code&gt; and &lt;code&gt;GrammarChecker&lt;/code&gt; proof them as you type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Document&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Format&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;DOCX&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;out&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Format&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PDF&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;com.codename1.presentation&lt;/code&gt; opens PPTX, ODP, PPT and Keynote files, edits them in &lt;code&gt;SlideView&lt;/code&gt;, and plays them in &lt;code&gt;SlideShow&lt;/code&gt; with builds, transitions and a presenter mode. Why put presentations in a mobile framework? Convergence. Apps can't be islands that do one small thing anymore. The field service app needs the inspection report. The sales app needs the deck. Saturday's &lt;a href="https://www.codenameone.com/blog/word-documents-and-presentations-in-your-app/" rel="noopener noreferrer"&gt;article&lt;/a&gt; has the details.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fblog%2Fdocument-review.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fblog%2Fdocument-review.png" alt="A document with spelling and grammar marks, tracked changes, a highlight and a table" width="800" height="597"&gt;&lt;/a&gt;Proofing and tracked changes.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fblog%2Fdocument-pages.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fblog%2Fdocument-pages.png" alt="A page with a table of contents, a floating chart, a hanging indent and balanced columns" width="800" height="638"&gt;&lt;/a&gt;Floats, columns and a table of contents.&lt;p&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Photoshop, Sketch, Figma and live SVG
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;com.codename1.art&lt;/code&gt; opens PSD and PSB with layers, masks and layer styles, Sketch files, Figma files through the REST API, and SVG at runtime with filters, masks, and CSS. They all become one document tree that renders the same pixels on every platform, and &lt;code&gt;ArtEditor&lt;/code&gt; is a drawing editor you can drop into your app. Rive files now play as ordinary images, translated to Java at build time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;ArtDocument&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ArtFormats&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;        &lt;span class="c1"&gt;// SVG, PSD, Sketch, Figma or .cn1gfx&lt;/span&gt;
&lt;span class="nc"&gt;Image&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ArtRenderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// two pixels per document unit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4lnv5q0bvyzb79kbp7lp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4lnv5q0bvyzb79kbp7lp.png" alt="The drawing editor with toolbar, layers and inspector" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sunday's &lt;a href="https://www.codenameone.com/blog/photoshop-sketch-figma-and-rive-in-your-app/" rel="noopener noreferrer"&gt;article&lt;/a&gt; shows both.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sixteen components and a new chart package
&lt;/h3&gt;

&lt;p&gt;Skeleton loaders, carousels with page dots, coach marks, empty states, range sliders, chips, a color picker, circular progress, audio waveforms, expandable text, activity timelines, an emoji picker, a mention field and a masonry layout are all in core now. The new &lt;code&gt;com.codename1.ui.chart&lt;/code&gt; package draws 19 series types, from bars to Sankey, treemaps and candlesticks, with animation, pan, zoom, tooltips and screen reader support. You can see it in every Bazaar dashboard. Monday's &lt;a href="https://www.codenameone.com/blog/sixteen-components-and-charts-you-can-touch/" rel="noopener noreferrer"&gt;article&lt;/a&gt; has the gallery.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frrvm40jdz180zh3ihvee.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frrvm40jdz180zh3ihvee.png" alt="The new chart package showing revenue against a target" width="409" height="919"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Defenses for banking apps
&lt;/h3&gt;

&lt;p&gt;Banking and payments apps live under a threat model most apps never see. &lt;code&gt;android.debugGuard=true&lt;/code&gt; now refuses to run with a debugger attached, and can also refuse to run with Developer Options or USB debugging on. Root detection catches Magisk, KernelSU and APatch, and hook detection catches Frida and the Xposed family. For the keyboard, &lt;code&gt;TextArea.SENSITIVE&lt;/code&gt; keeps card and account numbers out of learned words, &lt;code&gt;isThirdPartyKeyboardActive&lt;/code&gt; tells you when an unknown keyboard is reading every key, and &lt;code&gt;SecureKeyboard&lt;/code&gt; draws your own, scrambled if you like, on every platform including iOS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;TextField&lt;/span&gt; &lt;span class="n"&gt;pin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TextField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"PIN"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;TextArea&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;NUMERIC&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nc"&gt;TextArea&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PASSWORD&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DeviceIntegrity&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isThirdPartyKeyboardActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;DeviceIntegrity&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;wellKnownKeyboards&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;SecureKeyboard&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;install&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pin&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setScrambled&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frrmm742ozgzo81zpv2i2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frrmm742ozgzo81zpv2i2.png" alt="The secure keyboard with scrambled keys" width="409" height="919"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tuesday's &lt;a href="https://www.codenameone.com/blog/stop-debuggers-hooks-and-keyloggers/" rel="noopener noreferrer"&gt;security article&lt;/a&gt; covers every signal.&lt;/p&gt;

&lt;h3&gt;
  
  
  Oracle, SQL Server, maps and &lt;code&gt;io_uring&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The backend now speaks to SQL Server 2017 and newer, Azure SQL, and Oracle 19c and newer, next to PostgreSQL, MySQL, MariaDB, and SQLite. It speaks each wire protocol directly, with no driver. And the same &lt;code&gt;Database&lt;/code&gt; API now reaches all of them from the client too, so a desktop database admin tool or a reporting app is plain Codename One code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Database&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OracleDatabase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"db.example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1521&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"ORCLPDB1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"app"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;Cursor&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;executeQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"SELECT id, name FROM item WHERE price &amp;lt; ?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;10.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The backend can also serve your own OpenStreetMap tiles, routes and geocoding, OSRM and Nominatim compatible, so your maps stop depending on someone else's rate limit. Under the virtual threads, blocking file and SQLite I/O moves off the host threads, through &lt;code&gt;io_uring&lt;/code&gt; on Linux, so one slow query no longer stalls unrelated requests. Wednesday's &lt;a href="https://www.codenameone.com/blog/oracle-sql-server-and-your-own-map-server/" rel="noopener noreferrer"&gt;backend article&lt;/a&gt; has the rest.&lt;/p&gt;

&lt;h3&gt;
  
  
  Agents that freeze time, and the phone's own model
&lt;/h3&gt;

&lt;p&gt;Animations are the hardest thing for an agent to check, because the screenshot it takes is always mid-flight. Now it can stop the clock. &lt;code&gt;ui_clock_freeze&lt;/code&gt; holds every animation, &lt;code&gt;ui_clock_advance&lt;/code&gt; steps it frame by frame, and &lt;code&gt;ui_clock_settle&lt;/code&gt; runs it to the end, so the agent inspects exactly the frame it means to. &lt;code&gt;mvn cn1:verify&lt;/code&gt; checks your first form in light, dark, landscape and the largest text size for unlabeled controls, truncated text and poor contrast, and fails the build on an error.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;LlmClient.system()&lt;/code&gt; reaches the language model the operating system already ships: Apple Foundation Models on iOS and macOS, and Gemini Nano on Android devices with AICore. No download, no API key, and the prompt never leaves the device. Thursday's &lt;a href="https://www.codenameone.com/blog/agents-that-freeze-time-and-on-device-ai/" rel="noopener noreferrer"&gt;article&lt;/a&gt; shows both.&lt;/p&gt;

&lt;h3&gt;
  
  
  A currency API that should have been there years ago
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;java.util.Currency&lt;/code&gt; now exists on every platform, with the same ISO 4217 data everywhere: codes, numeric codes, fraction digits and the currency of every country. &lt;code&gt;L10NManager.formatCurrency&lt;/code&gt; formats in the user's locale with the currency's own digits, two for euros, none for yen, three for Bahraini dinars.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Currency&lt;/span&gt; &lt;span class="n"&gt;yen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Currency&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getInstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"JPY"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;digits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;yen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getDefaultFractionDigits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;              &lt;span class="c1"&gt;// 0: no sen in prices&lt;/span&gt;
&lt;span class="nc"&gt;Currency&lt;/span&gt; &lt;span class="n"&gt;euro&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Currency&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getInstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Locale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"de"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"DE"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;NumberFormat&lt;/span&gt; &lt;span class="n"&gt;format&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;NumberFormat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getCurrencyInstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setCurrency&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;euro&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;19.99&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One change to know about: on iOS, &lt;code&gt;getCurrencySymbol()&lt;/code&gt; now returns the symbol, &lt;code&gt;$&lt;/code&gt;, where it used to return the code &lt;code&gt;USD&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Papercut, a paper shooter for your lunch break
&lt;/h3&gt;

&lt;p&gt;Papercut is a twin-stick arena shooter drawn in cut paper and ink on a notebook page. You fly a paper quill, your right thumb aims the pencil, and cranes split into cranelets when you hit them. Ink stains stay on the page, which ripples like a grid of springs. It has three modes, including a daily shared seed, leaderboards with scores the server verifies, a coin shop and achievements. Like every one of our samples, it's a template in the &lt;a href="https://start.codenameone.com/" rel="noopener noreferrer"&gt;Initializr&lt;/a&gt; and free MIT-0 source.&lt;/p&gt;

&lt;a href="https://www.codenameone.com/papercut/papercut-desktop.mp4" rel="noopener noreferrer"&gt;Download the Papercut video&lt;/a&gt;.

&lt;h3&gt;
  
  
  Xcode 27.1 and Gradle 9 are now the defaults
&lt;/h3&gt;

&lt;p&gt;Builds without a version hint now use Xcode 27 on the build cloud, and Android builds use Gradle 9.8.0 with AGP 9.4.1. We do this every year, for the same reason: Apple and Google set the floor for store submissions, and the toolchain is where the new APIs, the new privacy rules and the security fixes live. Moving early, on our schedule, means your app never gets stuck when a store deadline lands on a Friday.&lt;/p&gt;

&lt;p&gt;Gradle 9 turns on only when we know your project works with it. If you add your own Gradle plugins, apply &lt;code&gt;kotlin-android&lt;/code&gt;, pin google-services below 4.4 or use Huawei push, the build stays on Gradle 8 and the log says why. If something does break, two build hints put you back where you were while you sort it out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="na"&gt;codename1.arg.ios.xcode_version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;26&lt;/span&gt;
&lt;span class="na"&gt;codename1.arg.android.gradleVersion&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Please tell us when you need them. A hint you rely on is a bug we want to fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  Go build the next great thing
&lt;/h2&gt;

&lt;p&gt;We're entering an era of new possibilities. A complex app, a commerce platform with a register, a back office and a web store, can now be taken apart and remixed in days. The code is no longer the limit. Your vision is.&lt;/p&gt;

&lt;p&gt;Generate Bazaar from the &lt;a href="https://start.codenameone.com/" rel="noopener noreferrer"&gt;Initializr&lt;/a&gt;, point your agent at our &lt;a href="https://www.codenameone.com/llms.txt" rel="noopener noreferrer"&gt;llms.txt&lt;/a&gt;, and make it yours. Take this and go build the next great thing. Tomorrow: &lt;a href="https://www.codenameone.com/blog/word-documents-and-presentations-in-your-app/" rel="noopener noreferrer"&gt;Word and PowerPoint inside your app&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mobile</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Brickyard: Launch Your Own Game Platform, With the Studio Inside the App</title>
      <dc:creator>Shai Almog</dc:creator>
      <pubDate>Thu, 03 Dec 2026 14:41:09 +0000</pubDate>
      <link>https://dev.to/codenameone/brickyard-launch-your-own-game-platform-with-the-studio-inside-the-app-1ak5</link>
      <guid>https://dev.to/codenameone/brickyard-launch-your-own-game-platform-with-the-studio-inside-the-app-1ak5</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F18n7fes9053bw7afyrwi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F18n7fes9053bw7afyrwi.jpg" alt="Brickyard game platform" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The biggest game platforms of the last decade aren't games. They're places where players build games for each other. The insight is that the studio and the game are the same product: the kid playing an obstacle course today is the one building the next one tomorrow, on the same device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Codename One?&lt;/strong&gt; Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at &lt;a href="https://www.codenameone.com/" rel="noopener noreferrer"&gt;codenameone.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Brickyard is that platform as a Codename One template. One app to browse experiences, play them in 3D with friends, chat, and build them in a full studio, on a phone, a tablet or a desktop. Publish, earn, and run it on your own authoritative multiplayer server. It uses nearly everything we've built: the code editor, the AI tooling, the &lt;a href="https://www.codenameone.com/blog/build-a-multiplayer-strategy-game-in-java/" rel="noopener noreferrer"&gt;gaming API&lt;/a&gt;, and two new pieces from this week, portable shaders and 3D audio.&lt;/p&gt;

&lt;a href="https://www.codenameone.com/brickyard/brickyard-desktop.mp4" rel="noopener noreferrer"&gt;Download the Brickyard video&lt;/a&gt;.

&lt;h2&gt;
  
  
  Scripted in Luau, the language millions of young creators already write
&lt;/h2&gt;

&lt;p&gt;Brickyard runs &lt;a href="https://luau.org/" rel="noopener noreferrer"&gt;Luau&lt;/a&gt;, the typed Lua dialect, on a pure-Java interpreter with full Luau syntax and the standard libraries. A kill brick in an obstacle course looks exactly like it does everywhere else Luau creators work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;brick&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;ipairs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;CollectionService&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nc"&gt;GetTagged&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"KillBrick"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="n"&gt;brick&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Touched&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nc"&gt;Connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;local&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Parent&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;hit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Parent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nc"&gt;FindFirstChildOfClass&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Humanoid"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Health&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Coroutines are interpreter frames, not threads, so a thousand scripts waiting on events cost almost nothing. Every resume runs under an instruction budget. A creator's infinite loop becomes an error in the output panel, never a frozen game, which matters a lot when your creators are twelve.&lt;/p&gt;

&lt;p&gt;That makes Brickyard compatible with the games creators already have. It reads and writes Roblox place files, both &lt;code&gt;.rbxlx&lt;/code&gt; and the binary &lt;code&gt;.rbxl&lt;/code&gt;, and exports &lt;code&gt;.rbxlx&lt;/code&gt;. Import a place and you get a compatibility report listing the API its scripts use that the engine doesn't have yet, and which assets were replaced with placeholders. The engine is a clean room implementation, and nothing is fetched from Roblox.&lt;/p&gt;

&lt;h2&gt;
  
  
  A real game studio, in the app
&lt;/h2&gt;

&lt;p&gt;Explorer, properties, a Luau editor with syntax checks and completion, lighting presets, undo, play test and publish. On a phone, on a tablet, on a desktop. The same studio, the same files.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-desktop-studio.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-desktop-studio.png" alt="The Brickyard studio on the desktop with explorer, viewport and script" width="800" height="441"&gt;&lt;/a&gt;The studio on the desktop.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-studio-tablet.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-studio-tablet.png" alt="The Brickyard studio on a tablet" width="800" height="600"&gt;&lt;/a&gt;The same studio on a tablet.&lt;p&gt;&lt;/p&gt;

&lt;p&gt;It ships with templates for the genres that fill these platforms: obby, survival, role-play town, tycoon, simulator, racing and a fighting arena. The economy is there too, a currency, a Plus subscription and a season pass, plus an admin console to run it all.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-script-editor.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-script-editor.png" alt="The Luau script editor on a phone" width="607" height="1080"&gt;&lt;/a&gt;The Luau editor on a phone.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-lighting.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-lighting.png" alt="Lighting presets in the studio" width="800" height="600"&gt;&lt;/a&gt;Lighting.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-playtest.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-playtest.png" alt="A multiplayer play test" width="607" height="1080"&gt;&lt;/a&gt;Play test with several players.&lt;p&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  An AI agent that builds and play tests
&lt;/h3&gt;

&lt;p&gt;Choose AI agent mode and the studio registers its tools with the app's built-in MCP server under the &lt;code&gt;brickyard_&lt;/code&gt; prefix. Claude, Codex or any MCP client can then build the experience: edit the instance tree, write scripts and get the syntax errors back, apply templates, add effects and lighting, take screenshots and publish.&lt;/p&gt;

&lt;p&gt;The tool that matters most is &lt;code&gt;playtest&lt;/code&gt;. It plays a saved copy with a number of players for a number of seconds and answers with the output, the errors, the leaderboard stats and any unsupported API. The agent doesn't guess whether its obby works. It plays it, reads what broke, and fixes it. Every button in the studio goes through the same tools, so the edits show up live in the explorer while you watch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBBW0NsYXVkZSBvciBDb2RleF0gLS0-fE1DUDogYnJpY2t5YXJkXyp8IFNbU3R1ZGlvIHRvb2xzXQogICAgUyAtLT4gVFtJbnN0YW5jZSB0cmVlPGJyLz5zY3JpcHRzLCBsaWdodGluZ10KICAgIFMgLS0-IFBbcGxheXRlc3Q8YnIvPk4gcGxheWVycywgTiBzZWNvbmRzXQogICAgUCAtLT58b3V0cHV0LCBlcnJvcnMsPGJyLz5sZWFkZXJzdGF0c3wgQQogICAgUyAtLT4gUFVCW1B1Ymxpc2hd%3Ftype%3Dpng%26bgColor%3Dffffff" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBBW0NsYXVkZSBvciBDb2RleF0gLS0-fE1DUDogYnJpY2t5YXJkXyp8IFNbU3R1ZGlvIHRvb2xzXQogICAgUyAtLT4gVFtJbnN0YW5jZSB0cmVlPGJyLz5zY3JpcHRzLCBsaWdodGluZ10KICAgIFMgLS0-IFBbcGxheXRlc3Q8YnIvPk4gcGxheWVycywgTiBzZWNvbmRzXQogICAgUCAtLT58b3V0cHV0LCBlcnJvcnMsPGJyLz5sZWFkZXJzdGF0c3wgQQogICAgUyAtLT4gUFVCW1B1Ymxpc2hd%3Ftype%3Dpng%26bgColor%3Dffffff" alt="Diagram" width="716" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Shaders you write once, in Java
&lt;/h2&gt;

&lt;p&gt;Brickyard draws with the &lt;code&gt;gpu&lt;/code&gt; package, which runs on Metal on iOS and macOS, Direct3D 11 on Windows, OpenGL ES on Android and WebGL in the browser. This week it got portable shader nodes: you build a shader as a typed expression graph in Java, and every port prints it as GLSL, Metal, or HLSL. No shader written three times, no platform you forgot to test.&lt;/p&gt;

&lt;p&gt;It comes with a library you'd normally buy in an asset store. Ocean, lake and river water. Terrain and foliage. Painted metal, rust, wood, concrete, glass, ice and car paint. Cartoon shading. Lava and caustics. Skies for day, dusk, night, and overcast. And effects: dissolve, hologram, force field, beam, fire, smoke, portal and x-ray.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;ScenePresets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Preset&lt;/span&gt; &lt;span class="n"&gt;look&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ScenePresets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;harbourDusk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;look&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;apply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;device&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;Material&lt;/span&gt; &lt;span class="n"&gt;sea&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Material&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Material&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PBR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setShader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Water&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ocean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setUniform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Water&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;WAVE_HEIGHT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.6f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;Material&lt;/span&gt; &lt;span class="n"&gt;quay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Material&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Material&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PBR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setShader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Surface&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concrete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;PostProcess&lt;/span&gt; &lt;span class="n"&gt;post&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;look&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getPost&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setGodRays&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.5f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setFxaa&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4otez2oekvaoisar7cpx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4otez2oekvaoisar7cpx.png" alt="A gallery of portable shaders: rust, wood, ice, fabric, hologram and fire" width="530" height="900"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The post-processing stack has bloom, color grading, vignette, film grain, FXAA, chromatic aberration, god rays, ambient occlusion, depth of field, outlines and color lookup tables, plus your own full-screen passes built from the same nodes. Image-based lighting bakes from the sky on the CPU into an ordinary texture, so reflections work even on old OpenGL ES and WebGL devices that lack cube maps. GPU skinning animates characters, instancing draws a forest in one call, and glTF 2.0 models load directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sound that comes from somewhere
&lt;/h2&gt;

&lt;p&gt;The new &lt;code&gt;com.codename1.media.audio&lt;/code&gt; package is an audio graph modeled on the W3C Web Audio API. Sources, filters, delay, compression, convolution reverb, analyzers, and custom processors that run per block on the audio thread. The graph is rendered by portable code, so it sounds the same on every platform.&lt;/p&gt;

&lt;p&gt;For games, the important node is &lt;code&gt;PannerNode&lt;/code&gt;. It places a sound in 3D around the listener, with distance models and sound cones, and HRTF rendering for headphones, so footsteps can come from behind you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;AudioContext&lt;/span&gt; &lt;span class="n"&gt;audio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AudioContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;PannerNode&lt;/span&gt; &lt;span class="n"&gt;panner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createPanner&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;panner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setPanningModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PanningModel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;HRTF&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;panner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getPositionX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;panner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getPositionZ&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;OscillatorNode&lt;/span&gt; &lt;span class="n"&gt;tone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createOscillator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;tone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;panner&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getDestination&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;tone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An &lt;code&gt;OfflineAudioContext&lt;/code&gt; renders the same graph to memory, so your unit test hears exactly what the device plays.&lt;/p&gt;

&lt;h2&gt;
  
  
  Remix it
&lt;/h2&gt;

&lt;p&gt;Brickyard is a template. Turn it into a coding school where students build games in Luau, a branded platform for a toy company, a training simulator, or a creator economy for one specific genre. The parts are all there, and the hard ones are tested on every commit.&lt;/p&gt;

&lt;p&gt;That wraps up this week's series. Start from the beginning with &lt;a href="https://www.codenameone.com/blog/why-my-kids-are-learning-to-program/" rel="noopener noreferrer"&gt;why my kids are learning to program&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mobile</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Flowcharts, Node Editors and Kanban Boards Are Now Standard Components</title>
      <dc:creator>Shai Almog</dc:creator>
      <pubDate>Wed, 02 Dec 2026 11:46:55 +0000</pubDate>
      <link>https://dev.to/codenameone/flowcharts-node-editors-and-kanban-boards-are-now-standard-components-46g5</link>
      <guid>https://dev.to/codenameone/flowcharts-node-editors-and-kanban-boards-are-now-standard-components-46g5</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7irwlud6i87682msl2vu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7irwlud6i87682msl2vu.jpg" alt="Flowcharts and Kanban boards in Java" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Show a business user their process as a flowchart and they understand it in ten seconds. Show them the same process as a table of states and they ask for a meeting. That's why every serious business app ends up needing a diagram: an approval flow, an org chart, a network map, a pipeline of deals. And in almost every framework, that diagram is a third party extension, a commercial license, or a web view running a JavaScript library inside your native app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Codename One?&lt;/strong&gt; Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at &lt;a href="https://www.codenameone.com/" rel="noopener noreferrer"&gt;codenameone.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That's backwards. The baseline for a business app moved, and a framework that stops at buttons and lists stops short of what your users expect. So this week Codename One ships two new core components: &lt;code&gt;NodeGraph&lt;/code&gt; for diagrams and node editors, and &lt;code&gt;KanbanBoard&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  A diagram in six lines
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;DefaultGraphModel&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DefaultGraphModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GraphNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"web"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Web app"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GraphNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"api"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"API gateway"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEdge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"web"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"api"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;NodeGraph&lt;/span&gt; &lt;span class="n"&gt;graph&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;NodeGraph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;graph&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arrange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;LayeredArrangement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't place anything. The graph lays itself out. &lt;code&gt;LayeredArrangement&lt;/code&gt; is for flows, &lt;code&gt;TreeArrangement&lt;/code&gt; for hierarchies, &lt;code&gt;RadialArrangement&lt;/code&gt; for something at the center, and &lt;code&gt;ForceArrangement&lt;/code&gt; for networks, and it can run live while the user drags. Pin a node and the layout flows around it.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-services.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-services.png" alt="A service architecture laid out automatically" width="800" height="356"&gt;&lt;/a&gt;Layered layout.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-tree.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-tree.png" alt="A tree laid out automatically" width="800" height="356"&gt;&lt;/a&gt;Tree layout.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-radial.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-radial.png" alt="A radial layout" width="800" height="356"&gt;&lt;/a&gt;Radial layout.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-force.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-force.png" alt="A force directed network layout" width="800" height="356"&gt;&lt;/a&gt;Force layout.&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Like our &lt;a href="https://www.codenameone.com/blog/a-million-rows-and-live-excel-formulas/" rel="noopener noreferrer"&gt;DataGrid&lt;/a&gt; and Gantt chart, &lt;code&gt;NodeGraph&lt;/code&gt; paints its nodes instead of making a component for each one, so thousands of nodes pan and zoom smoothly on a phone. Zoom far out and nodes become plain cards, the way a map drops street names.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flowcharts with swim lanes
&lt;/h2&gt;

&lt;p&gt;Flowchart shapes, swim lanes, edge labels and line styles are built in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addGroup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;GraphGroup&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lane&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"shop"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Shop"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;620&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;GraphNode&lt;/span&gt; &lt;span class="n"&gt;paid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GraphNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"paid"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Paid?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;220&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;110&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;70&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setShape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;GraphShapes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;DECISION&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;paid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setGroupId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"shop"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;paid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEdge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"paid"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"cancel"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setLabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"no"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEdge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"paid"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"pick"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setLabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"yes"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nc"&gt;NodeGraph&lt;/span&gt; &lt;span class="n"&gt;graph&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;NodeGraph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;graph&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setEdgeStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;NodeGraph&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;EDGE_ORTHOGONAL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;graph&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setEditingEnabled&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmeqsbl626765345odw8h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmeqsbl626765345odw8h.png" alt="A flowchart with swim lanes for the shop and the warehouse" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Turn editing on and the user can draw their own: a palette of shapes to drag in, resize handles, a minimap, undo and redo, and copy and paste. &lt;code&gt;GraphJson&lt;/code&gt; saves the diagram and loads it back, so the flowchart a manager drew on an iPad goes to your server and opens on a colleague's desktop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Node editors, like the ones in game engines
&lt;/h2&gt;

&lt;p&gt;The second mode is the one you know from shader editors and automation tools. Nodes have typed ports, and the user wires outputs to inputs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GraphNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"noise"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Noise"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;160&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addOutput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"out"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Value"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"float"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GraphNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"color"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Color ramp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;240&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;160&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"in"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Factor"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"float"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addOutput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"out"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Color"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"color"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;NodeGraph&lt;/span&gt; &lt;span class="n"&gt;graph&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;NodeGraph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;graph&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setEditingEnabled&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;graph&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setEdgeStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;NodeGraph&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;EDGE_CURVED&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;code&gt;ConnectionValidator&lt;/code&gt; refuses a wire from a color into a number, &lt;code&gt;setMaxConnections&lt;/code&gt; caps a port, and &lt;code&gt;setAllowCycles(false)&lt;/code&gt; keeps the graph acyclic. Nodes can hold real components, a slider or a text field inside a node that scales with the zoom. That's the building block for a workflow builder, an IoT rule engine, a visual query designer or a no-code tool inside your product.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-editor.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-editor.png" alt="A port based node editor with typed connections" width="800" height="356"&gt;&lt;/a&gt;A node editor with typed ports.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-components.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-components.png" alt="Nodes containing live components" width="800" height="356"&gt;&lt;/a&gt;Real components inside nodes.&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Kanban, with the rules teams actually use
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;DefaultKanbanModel&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DefaultKanbanModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;KanbanColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"todo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"To do"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;KanbanColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"doing"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Doing"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setWipLimit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;KanbanColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"done"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Done"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setCollapsed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setEnforceWipLimits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addLane&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;KanbanLane&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"app"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"App"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addCard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"todo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;KanbanCard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"c1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Dark mode"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setLaneId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"app"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addTag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ui"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;KanbanBoard&lt;/span&gt; &lt;span class="n"&gt;board&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;KanbanBoard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cards carry tags, badges, and descriptions. Swim lanes split the board by team or customer. A WIP limit is either a warning or a hard rule. Cards and whole columns drag, a long press lifts a card on a touch screen, and on a phone &lt;code&gt;setColumnSnap(true)&lt;/code&gt; makes the board page one column at a time instead of shrinking into something unreadable. Undo and redo come built in.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fkanban-board.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fkanban-board.png" alt="A Kanban board with tagged cards" width="800" height="356"&gt;&lt;/a&gt;The board.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fkanban-lanes.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fkanban-lanes.png" alt="A Kanban board with swim lanes and a WIP limit" width="800" height="356"&gt;&lt;/a&gt;Swim lanes and WIP limits.&lt;p&gt;&lt;/p&gt;

&lt;p&gt;A Kanban board isn't only for software teams. It's a sales pipeline, a hiring funnel, a repair shop's queue of devices, a content calendar. Any process where things move through stages is a board, and now it's one constructor away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Remix them
&lt;/h2&gt;

&lt;p&gt;Put a Kanban board of service tickets next to &lt;a href="https://www.codenameone.com/blog/field-service-scheduling-template/" rel="noopener noreferrer"&gt;Fieldline's&lt;/a&gt; dispatch map. Let an operations manager draw the approval flow as a diagram, save it with &lt;code&gt;GraphJson&lt;/code&gt;, and have your &lt;a href="https://www.codenameone.com/blog/multi-tenant-saas-backend-in-java/" rel="noopener noreferrer"&gt;backend&lt;/a&gt; execute it. Attach the &lt;a href="https://www.codenameone.com/blog/a-million-rows-and-live-excel-formulas/" rel="noopener noreferrer"&gt;spreadsheet&lt;/a&gt; each stage produces and the &lt;a href="https://www.codenameone.com/blog/generate-and-view-pdfs-in-java/" rel="noopener noreferrer"&gt;PDF&lt;/a&gt; it ends in. Every one of these exists somewhere. Getting all of them in one framework, tested together on every platform, is the hard part.&lt;/p&gt;

&lt;p&gt;Tomorrow: &lt;a href="https://www.codenameone.com/blog/build-a-game-platform-with-luau-scripting/" rel="noopener noreferrer"&gt;Brickyard, a game platform with its own studio&lt;/a&gt;, plus portable shaders and 3D audio.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mobile</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Fieldline: Launch Your Own Field Service App, With a Scheduler That Plans the Week</title>
      <dc:creator>Shai Almog</dc:creator>
      <pubDate>Tue, 01 Dec 2026 04:11:34 +0000</pubDate>
      <link>https://dev.to/codenameone/fieldline-launch-your-own-field-service-app-with-a-scheduler-that-plans-the-week-1faj</link>
      <guid>https://dev.to/codenameone/fieldline-launch-your-own-field-service-app-with-a-scheduler-that-plans-the-week-1faj</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F870sodg6s84vuydxzcjn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F870sodg6s84vuydxzcjn.jpg" alt="Fieldline field service app" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of my first jobs was at a scheduling company. I wrote heuristic algorithms that assigned work to people under constraints, and drew the result as Gantt charts that planners stared at all day. It's a brutal field. Every customer has a rule nobody told you about, a technician who can't work Tuesdays, a site that only opens at nine, a van that can't carry two jobs' worth of parts. The optimizer that handles all of it is the product, and building one used to take a team several years.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Codename One?&lt;/strong&gt; Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at &lt;a href="https://www.codenameone.com/" rel="noopener noreferrer"&gt;codenameone.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Fieldline is that product as a template. Open the Initializr, pick the field service template, and you get a working app for technicians, dispatchers and administrators, the server behind it, and a scheduling engine that plans their week. The source is MIT-0. Change it, sell it, keep your changes private.&lt;/p&gt;

&lt;h2&gt;
  
  
  The technician's day
&lt;/h2&gt;

&lt;p&gt;A technician opens the app on today: the jobs as a numbered route on a map, with the travel time between stops. They drive, check in on site, work through a checklist that saves as they go, and photograph what they find. The assistant looks at the photo and suggests a diagnosis. At the end, the app drafts the report and the customer signs on the screen. The signature is sealed with a hash of the signature, the time and the place, so nobody argues later about whether the job was done.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-today-route.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-today-route.png" alt="Fieldline showing today's jobs as a route on a map" width="800" height="1422"&gt;&lt;/a&gt;Today, as a route.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-checklist.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-checklist.png" alt="A job checklist in Fieldline" width="800" height="1422"&gt;&lt;/a&gt;The checklist saves as you go.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-assistant.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-assistant.png" alt="The Fieldline assistant diagnosing a photo" width="800" height="1422"&gt;&lt;/a&gt;An expert on call, in the app.&lt;p&gt;&lt;/p&gt;

&lt;a href="https://www.codenameone.com/fieldline/fieldline-technician-tablet.mp4" rel="noopener noreferrer"&gt;Download the technician video&lt;/a&gt;.

&lt;h2&gt;
  
  
  The dispatcher's board
&lt;/h2&gt;

&lt;p&gt;A dispatcher sees the whole crew three ways: a timeline, a Gantt chart against the last plan, and a map. Drag a job to another technician and every constraint is checked before the move is applied. A new job is placed automatically. Someone calls in sick and their absence is covered in one tap. Every optimizer run lists what it changed and why, because a planner who can't see the reasoning will never trust the machine.&lt;/p&gt;

&lt;p&gt;And they can just ask. "Dana is out Thursday, cover her jobs" re-plans Thursday. The assistant runs behind the server's own API key, so the key never ships inside the app.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-gantt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-gantt.png" alt="Fieldline's Gantt chart against the last plan" width="800" height="480"&gt;&lt;/a&gt;The Gantt chart against the last plan.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-optimize.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-optimize.png" alt="An optimizer run listing what it changed" width="800" height="480"&gt;&lt;/a&gt;Every change, explained.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-dispatch-assistant.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-dispatch-assistant.png" alt="The dispatch assistant re-planning from a plain sentence" width="800" height="480"&gt;&lt;/a&gt;Re-planning in plain words.&lt;p&gt;&lt;/p&gt;

&lt;a href="https://www.codenameone.com/fieldline/fieldline-backoffice-desktop.mp4" rel="noopener noreferrer"&gt;Download the back office video&lt;/a&gt;.

&lt;h2&gt;
  
  
  The optimizer is plain Java you own
&lt;/h2&gt;

&lt;p&gt;The scheduling engine lives in the &lt;code&gt;shared&lt;/code&gt; module, with no dependencies and no I/O. It models technicians, jobs and shifts, with hard constraints that can never break (skills, working hours, time windows, time off, maximum driving) and soft ones you weigh against each other (travel, overtime, keeping work where it was).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Problem&lt;/span&gt; &lt;span class="n"&gt;problem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Instances&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;city&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;Plan&lt;/span&gt; &lt;span class="n"&gt;plan&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Solver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;iterations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;solve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toPlan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;broken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PlanChecker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;violations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// always empty&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;Solver&lt;/code&gt; starts with regret insertion, then improves the plan with adaptive large neighborhood search. It's seeded, so the same seed gives the same plan, which makes it testable. The test suite runs 25 random cities with random crews and asserts that not one hard constraint is ever violated. The &lt;code&gt;Reoptimizer&lt;/code&gt; handles the part that kills most scheduling software: the day changes at 10:40, and the new plan has to fix the problem without reshuffling every technician who's already on the road.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBKW0pvYnMsIHNraWxscywgaG91cnMsPGJyLz50aW1lIG9mZiwgdHJhdmVsXSAtLT4gU1tTb2x2ZXI8YnIvPnJlZ3JldCBpbnNlcnRpb24gKyBBTE5TXQogICAgUyAtLT4gUFtQbGFuXQogICAgUCAtLT4gVFtUZWNobmljaWFuIGFwcDxici8-cm91dGUgb24gYSBtYXBdCiAgICBQIC0tPiBEW0Rpc3BhdGNoZXI8YnIvPkdhbnR0IGFuZCBtYXBdCiAgICBFWzEwOjQwOiBEYW5hIGlzIHNpY2tdIC0tPiBSW1Jlb3B0aW1pemVyPGJyLz5rZWVwIHdvcmsgaW4gcGxhY2VdCiAgICBQIC0tPiBSCiAgICBSIC0tPiBQ%3Ftype%3Dpng%26bgColor%3Dffffff" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBKW0pvYnMsIHNraWxscywgaG91cnMsPGJyLz50aW1lIG9mZiwgdHJhdmVsXSAtLT4gU1tTb2x2ZXI8YnIvPnJlZ3JldCBpbnNlcnRpb24gKyBBTE5TXQogICAgUyAtLT4gUFtQbGFuXQogICAgUCAtLT4gVFtUZWNobmljaWFuIGFwcDxici8-cm91dGUgb24gYSBtYXBdCiAgICBQIC0tPiBEW0Rpc3BhdGNoZXI8YnIvPkdhbnR0IGFuZCBtYXBdCiAgICBFWzEwOjQwOiBEYW5hIGlzIHNpY2tdIC0tPiBSW1Jlb3B0aW1pemVyPGJyLz5rZWVwIHdvcmsgaW4gcGxhY2VdCiAgICBQIC0tPiBSCiAgICBSIC0tPiBQ%3Ftype%3Dpng%26bgColor%3Dffffff" alt="Diagram" width="764" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It runs on the server, and because it's written in the Java subset Codename One compiles, it builds for the client too. Planning a technician's own day on the device, with no signal, is a few lines away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Five languages, four databases, real maps
&lt;/h2&gt;

&lt;p&gt;Fieldline runs on iOS, Android, the desktop and the web, in English, Spanish, French, German, and Hebrew. The maps are real OpenStreetMap vector tiles and need no key. The server pushes changes over a WebSocket as they happen, sends push notifications, and runs on SQLite, PostgreSQL, MySQL, or MariaDB. The app and the server share one contract module, so a field one side renamed is a compile error on the other.&lt;/p&gt;

&lt;p&gt;The demo accounts are on the &lt;a href="https://www.codenameone.com/fieldline/" rel="noopener noreferrer"&gt;Fieldline page&lt;/a&gt;, and the &lt;a href="https://www.codenameone.com/developer-guide/fieldline-users-guide/" rel="noopener noreferrer"&gt;user's guide&lt;/a&gt; walks through every screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scheduling problems are everywhere
&lt;/h2&gt;

&lt;p&gt;Remember the scheduling company I mentioned at the start. Scheduling workers was only one of its projects.&lt;/p&gt;

&lt;p&gt;I worked on a system that placed children moving from grade school into middle school: the right school, with the right class following them, under a pile of constraints about distance, siblings, class sizes and who must or must not end up together. I also worked on scheduling chips through the manufacturing pipeline of a major fab. It turns out the order in which chips are produced is crucial for the throughput of the whole line, and it's very hard to calculate.&lt;/p&gt;

&lt;p&gt;This is a deep field, and once you start looking you see scheduling problems everywhere. Nurses and shifts. Trucks and loading docks. Exams and rooms. Machines and maintenance windows. Every one of them is the same shape as Fieldline's: resources, jobs, hard rules that can never break and soft goals to weigh against each other.&lt;/p&gt;

&lt;p&gt;They used to need a specialist team and years of work. Now you can start from a solver that's already tested, model your own constraints in plain Java, and get to a working answer in days. The rules only your customers have, the integration with their ERP, the spreadsheet the operations manager won't give up (import it, &lt;a href="https://www.codenameone.com/blog/a-million-rows-and-live-excel-formulas/" rel="noopener noreferrer"&gt;it's a spreadsheet now&lt;/a&gt;): that's where your work starts.&lt;/p&gt;

&lt;p&gt;Tomorrow: &lt;a href="https://www.codenameone.com/blog/diagrams-flowcharts-and-kanban-boards/" rel="noopener noreferrer"&gt;diagrams, flowcharts and Kanban boards&lt;/a&gt; as standard components.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mobile</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Invoices, Tickets and Reports: Generate, View and Print PDFs From One Java Codebase</title>
      <dc:creator>Shai Almog</dc:creator>
      <pubDate>Mon, 30 Nov 2026 14:06:37 +0000</pubDate>
      <link>https://dev.to/codenameone/invoices-tickets-and-reports-generate-view-and-print-pdfs-from-one-java-codebase-3p75</link>
      <guid>https://dev.to/codenameone/invoices-tickets-and-reports-generate-view-and-print-pdfs-from-one-java-codebase-3p75</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpbdagibm3td9d7ja53vo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpbdagibm3td9d7ja53vo.jpg" alt="Generating and viewing PDFs in Java" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every business app ends at a PDF. The invoice, the boarding pass, the signed work order, the monthly statement, the report the regional manager prints and brings to a meeting. And every team I know solved it the same painful way: a server-side library for generating, a different viewer per platform, a web view on Android that renders differently from the one on iOS, and a print button that works on one of them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Codename One?&lt;/strong&gt; Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at &lt;a href="https://www.codenameone.com/" rel="noopener noreferrer"&gt;codenameone.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now one package does all of it, on the phone, the desktop, the web and the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing a PDF
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;com.codename1.pdf&lt;/code&gt; has two ways in. The canvas is for things with a fixed design, like a ticket:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;PdfDocument&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfDocument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setTitle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Ticket"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;PdfPage&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PdfPageSize&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;A5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;PdfCanvas&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getCanvas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setFillColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x1565c0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fillRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getWidth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setFillColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0xffffff&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setFont&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PdfFont&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;HELVETICA_BOLD&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Boarding pass"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;38&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setFillColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x212121&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setFont&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PdfFont&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;HELVETICA&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Gate B12, seat 14C"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;pdf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toByteArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paths, curves, clipping, transforms, alpha, embedded TrueType fonts, JPEG and PNG images, links and bookmarks are all there. Anything you draw on a mutable &lt;code&gt;Image&lt;/code&gt; can go into a document as pixels.&lt;/p&gt;

&lt;p&gt;The layout is for things that flow, like an invoice with sixty lines. You add paragraphs and tables, and it breaks pages, repeats table headers and runs a decorator on each page for the footer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;PdfLayout&lt;/span&gt; &lt;span class="n"&gt;layout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfLayout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;PdfPageSize&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;A4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfParagraph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Invoice 1042"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;PdfFont&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;HELVETICA_BOLD&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setSpaceAfter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfParagraph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Payment is due within "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"30 days"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;PdfFont&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;HELVETICA_BOLD&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendLink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;". Contact us"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mailto:billing@example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x1565c0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;PdfTable&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfTable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.5f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setHeaderRows&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setFont&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addCell&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Item"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addCell&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Qty"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addCell&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Price"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hebrew and Arabic work too, with right-to-left layout and Arabic letter shaping. Plenty of PDF libraries still print Hebrew backwards.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same code on the server
&lt;/h2&gt;

&lt;p&gt;Nothing in the package touches the UI, so your &lt;a href="https://www.codenameone.com/blog/multi-tenant-saas-backend-in-java/" rel="noopener noreferrer"&gt;Codename One backend&lt;/a&gt; generates documents with the same classes. Return &lt;code&gt;doc.toByteArray()&lt;/code&gt; as &lt;code&gt;application/pdf&lt;/code&gt; from an endpoint, or mail statements from a scheduled job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBMW0ludm9pY2VMYXlvdXQuamF2YTxici8-c2hhcmVkIG1vZHVsZV0gLS0-IEFbQXBwPGJyLz5vZmZsaW5lIHJlY2VpcHQgb24gdGhlIHBob25lXQogICAgTCAtLT4gQltCYWNrZW5kPGJyLz5tb250aGx5IHN0YXRlbWVudHMgYnkgbWFpbF0KICAgIEEgLS0-IFZbUGRmVmlld2VyXQogICAgQiAtLT4gVgogICAgViAtLT4gUFtQcmludGVyLnByaW50UERGXQ%3D%3D%3Ftype%3Dpng%26bgColor%3Dffffff" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBMW0ludm9pY2VMYXlvdXQuamF2YTxici8-c2hhcmVkIG1vZHVsZV0gLS0-IEFbQXBwPGJyLz5vZmZsaW5lIHJlY2VpcHQgb24gdGhlIHBob25lXQogICAgTCAtLT4gQltCYWNrZW5kPGJyLz5tb250aGx5IHN0YXRlbWVudHMgYnkgbWFpbF0KICAgIEEgLS0-IFZbUGRmVmlld2VyXQogICAgQiAtLT4gVgogICAgViAtLT4gUFtQcmludGVyLnByaW50UERGXQ%3D%3D%3Ftype%3Dpng%26bgColor%3Dffffff" alt="Diagram" width="757" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's where the money is. The class that lays out an invoice is written once and shared. The technician's tablet makes the PDF on site with no signal, and the server makes the identical PDF for the accounting archive. Nobody keeps two templates in sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Viewing a PDF, the same way everywhere
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;PdfViewer&lt;/code&gt; renders PDFs in pure Java:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;PdfViewer&lt;/span&gt; &lt;span class="n"&gt;viewer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PdfViewer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;Form&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Invoice"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BorderLayout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BorderLayout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;CENTER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;viewer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;show&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;viewer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setPage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8fh9cd13fv5s59jldd2u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8fh9cd13fv5s59jldd2u.png" alt="The PDF viewer showing a generated invoice" width="800" height="780"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It doesn't hand the file to the platform, so it doesn't inherit the platform's quirks. The same file draws the same pixels on iOS, Android, the desktop and the web, and our CI holds it to a screenshot on every one of them. It handles what real-world files throw at you: JPEG 2000, JBIG2 and CCITT scans, shadings, soft masks, TrueType, CFF, Type 1 and Type 3 fonts, form fields and annotations. &lt;code&gt;renderPage(index, scale)&lt;/code&gt; gives you any page as an &lt;code&gt;Image&lt;/code&gt; for thumbnails.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;PdfReader&lt;/code&gt; extracts text and metadata, rebuilds files with broken cross-reference tables, and opens encrypted documents:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;PdfReader&lt;/span&gt; &lt;span class="n"&gt;reader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PdfReader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// RC4, AES-128 and AES-256&lt;/span&gt;
&lt;span class="nc"&gt;Log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;p&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTitle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;": "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getPageCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;" pages"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;firstPage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;extractText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Either the user or the owner password opens it. That matters for the bank statements, payslips and insurance documents your users actually receive, which are almost always password protected.&lt;/p&gt;

&lt;h2&gt;
  
  
  And printing
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Printer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isPrintingSupported&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Printer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;printPDF&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Generate, show, print, with no per-platform branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Everything connects
&lt;/h2&gt;

&lt;p&gt;PDF on its own is a feature. PDF connected to everything else is what an enterprise buys.&lt;/p&gt;

&lt;p&gt;A dispatcher plans the week on a &lt;a href="https://www.codenameone.com/blog/field-service-scheduling-template/" rel="noopener noreferrer"&gt;Gantt chart&lt;/a&gt;, and &lt;code&gt;SchedulePrinter.writePdf&lt;/code&gt; turns the whole project into a paginated PDF, with the time scale and the task table repeated on every page, ready to mail to the client. A finance team filters a &lt;a href="https://www.codenameone.com/blog/a-million-rows-and-live-excel-formulas/" rel="noopener noreferrer"&gt;DataGrid&lt;/a&gt; of a million rows down to one region and sends the result as a report. A manager signs in through the company's Okta with &lt;a href="https://www.codenameone.com/blog/multi-tenant-saas-backend-in-java/" rel="noopener noreferrer"&gt;SAML&lt;/a&gt;, sees only their own tenant's invoices, and downloads the month as one statement generated on the server. A &lt;a href="https://www.codenameone.com/blog/diagrams-flowcharts-and-kanban-boards/" rel="noopener noreferrer"&gt;Kanban&lt;/a&gt; card for a repair carries the signed work order as an attachment.&lt;/p&gt;

&lt;p&gt;That's the list every enterprise app needs on day one: single sign-on, tenant isolation, grids, schedules, boards, documents, printing. Normally it's six vendors, six licenses and six security reviews. Here it's one framework, one language and one test suite.&lt;/p&gt;

&lt;p&gt;Codename One is great for an indie developer shipping their first app. For an enterprise developer it's fantastic, because the parts the enterprise demands are already there, and they already talk to each other.&lt;/p&gt;

&lt;p&gt;Tomorrow: &lt;a href="https://www.codenameone.com/blog/field-service-scheduling-template/" rel="noopener noreferrer"&gt;Fieldline, a complete field service app&lt;/a&gt;: scheduling, dispatch, maps and an optimizer, ready to ship.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mobile</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Build a Multi-Tenant SaaS Backend That Can't Leak One Customer Into Another</title>
      <dc:creator>Shai Almog</dc:creator>
      <pubDate>Sun, 29 Nov 2026 14:26:27 +0000</pubDate>
      <link>https://dev.to/codenameone/build-a-multi-tenant-saas-backend-that-cant-leak-one-customer-into-another-47i9</link>
      <guid>https://dev.to/codenameone/build-a-multi-tenant-saas-backend-that-cant-leak-one-customer-into-another-47i9</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp9ceeerku0ph1xiu0h5z.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp9ceeerku0ph1xiu0h5z.jpg" alt="A multi-tenant SaaS backend in Java" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The worst bug a SaaS company can ship is one customer seeing another customer's invoices. It doesn't crash anything and no test fails. A support ticket arrives, then a lawyer. It almost always comes from the same place: one query, somewhere, that forgot the &lt;code&gt;WHERE tenant_id = ?&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Codename One?&lt;/strong&gt; Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at &lt;a href="https://www.codenameone.com/" rel="noopener noreferrer"&gt;codenameone.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This week the Codename One backend refuses to run that query. It also picked up the rest of what an enterprise customer asks about in the first meeting: GraphQL, SAML single sign-on, LDAP and Active Directory, object storage on every major cloud, and document and search databases. Friday's &lt;a href="https://www.codenameone.com/blog/why-my-kids-are-learning-to-program/" rel="noopener noreferrer"&gt;post&lt;/a&gt; argued that the baseline for an app moved. This is the baseline for its server.&lt;/p&gt;

&lt;h2&gt;
  
  
  One annotation, and every query is scoped
&lt;/h2&gt;

&lt;p&gt;Mark the field that holds the tenant:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Entity&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Invoice&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;@Id&lt;/span&gt; &lt;span class="nd"&gt;@GeneratedValue&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nd"&gt;@TenantId&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From then on the ORM stamps the tenant on insert and treats it as immutable. Finds, criteria queries, JPQL, counts, bulk updates and bulk deletes are all filtered to the current tenant. Another tenant's row doesn't throw an access error. It reads as missing, which is exactly what you want an attacker probing ids to see. Saving an entity that belongs to a different tenant throws &lt;code&gt;TenantMismatchException&lt;/code&gt;, and running a query with no tenant set throws &lt;code&gt;MissingTenantException&lt;/code&gt; instead of quietly returning everything.&lt;/p&gt;

&lt;p&gt;The tenant comes from the request. A &lt;code&gt;TenantFilter&lt;/code&gt; sets &lt;code&gt;TenantContext&lt;/code&gt; for each request, with resolvers for the common layouts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TenantFilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;TenantFilter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;subdomain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"example.com"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// acme.example.com -&amp;gt; "acme"&lt;/span&gt;
&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TenantFilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;TenantFilter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;header&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"X-Tenant-ID"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TenantFilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;TenantFilter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;authenticated&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;accounts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tenantOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the last one in production. A header or a host name is whatever the client says it is. The authenticated user's tenant is whatever your identity provider says it is.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBSW1JlcXVlc3Q8YnIvPmFjbWUuZXhhbXBsZS5jb21dIC0tPiBGW1RlbmFudEZpbHRlcl0KICAgIEYgLS0-fFRlbmFudENvbnRleHQgPSBhY21lfCBTW09STSBzZXNzaW9uXQogICAgUyAtLT58ZmluZCwgcXVlcnksIGNvdW50LCB1cGRhdGV8IFFbU1FMIHdpdGggdGVuYW50IGNvbmRpdGlvbiBhZGRlZF0KICAgIFMgLS4tPnxuYXRpdmUgU1FMfCBYW1RlbmFudE5hdGl2ZVNxbEV4Y2VwdGlvbl0KICAgIFEgLS0-IERCWyhTaGFyZWQgZGF0YWJhc2UpXQ%3D%3D%3Ftype%3Dpng%26bgColor%3Dffffff" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBSW1JlcXVlc3Q8YnIvPmFjbWUuZXhhbXBsZS5jb21dIC0tPiBGW1RlbmFudEZpbHRlcl0KICAgIEYgLS0-fFRlbmFudENvbnRleHQgPSBhY21lfCBTW09STSBzZXNzaW9uXQogICAgUyAtLT58ZmluZCwgcXVlcnksIGNvdW50LCB1cGRhdGV8IFFbU1FMIHdpdGggdGVuYW50IGNvbmRpdGlvbiBhZGRlZF0KICAgIFMgLS4tPnxuYXRpdmUgU1FMfCBYW1RlbmFudE5hdGl2ZVNxbEV4Y2VwdGlvbl0KICAgIFEgLS0-IERCWyhTaGFyZWQgZGF0YWJhc2UpXQ%3D%3D%3Ftype%3Dpng%26bgColor%3Dffffff" alt="Diagram" width="1433" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Native SQL is blocked, on purpose
&lt;/h3&gt;

&lt;p&gt;Here's the decision people will argue with, so let me be precise about it.&lt;/p&gt;

&lt;p&gt;The moment your session maps even one entity with a &lt;code&gt;@TenantId&lt;/code&gt; field, the session stops accepting native SQL. Calling &lt;code&gt;createNativeQuery&lt;/code&gt; throws &lt;code&gt;TenantNativeSqlException&lt;/code&gt;, and so does executing one that was created earlier. That holds for every native query in that session, including queries against tables that have no tenant column at all, because the ORM can't tell which tables your SQL touches.&lt;/p&gt;

&lt;p&gt;Why not rewrite the SQL and add the tenant condition, the way the ORM does for its own queries? Because a rewrite that's right 99% of the time is a data leak the other 1%. The ORM writes its own queries, so it knows exactly where the condition goes. It didn't write your hand-tuned join, your CTE, your window function or your vendor extension, and guessing there is how a report ends up summing every customer's revenue.&lt;/p&gt;

&lt;p&gt;So it refuses, and you opt in for one call, with the tenant condition written by you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;Long&lt;/span&gt; &lt;span class="n"&gt;open&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Long&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nc"&gt;TenantContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;allowNativeSql&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createNativeQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"SELECT COUNT(*) FROM invoice WHERE tenant_id = :t"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;Long&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setParameter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"t"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;TenantContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The opt-in is checked twice, when the query is created and again when it runs, so a query built inside the block and kept in a field can't be executed outside it later. Nothing turns the restriction off for longer than that one call.&lt;/p&gt;

&lt;p&gt;Two more doors, both explicit. Migrations, cross-tenant reports and provisioning jobs run inside &lt;code&gt;TenantContext.runUnscoped(...)&lt;/code&gt;, which turns filtering off for that call only. And a statement you send straight to a &lt;code&gt;DataSource&lt;/code&gt; never passes through the session, so it isn't checked at all. That's the escape hatch for code that really is tenant agnostic, and it's easy to find in a review because it doesn't look like ORM code.&lt;/p&gt;

&lt;p&gt;The result: search for &lt;code&gt;allowNativeSql&lt;/code&gt;, &lt;code&gt;runUnscoped&lt;/code&gt; and &lt;code&gt;DataSource&lt;/code&gt; and you have the complete list of code that can read across tenants. Hibernate's &lt;code&gt;@TenantId&lt;/code&gt; and filters scope your entity queries too, then let native SQL straight through, so finding the one that forgot the tenant is your problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  A database per tenant, when the contract says so
&lt;/h3&gt;

&lt;p&gt;Some customers won't share a database, whatever you promise. &lt;code&gt;TenantDataSources&lt;/code&gt; gives each tenant its own pool from a URL template, keeps the pools in an LRU cache, and migrates every tenant's schema with one call:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="na"&gt;cn1.tenancy.datasource.url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;postgres&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//app:secret@db/app_${tenant}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;TenantContext.decorator()&lt;/code&gt; carries the tenant into executor tasks, so background work runs against the right customer.&lt;/p&gt;

&lt;h2&gt;
  
  
  GraphQL, in the Spring style you already know
&lt;/h2&gt;

&lt;p&gt;Drop a schema into &lt;code&gt;src/main/resources/graphql&lt;/code&gt; and write a controller:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;Query&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nf"&gt;book&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;ID&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Book&lt;/span&gt;  &lt;span class="n"&gt;books&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Book&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;Mutation&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nf"&gt;addBook&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;BookInput&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Book&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;Book&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;ID&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;  &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;  &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Author&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Controller&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;BookController&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;@QueryMapping&lt;/span&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Book&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;books&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;repository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nd"&gt;@MutationMapping&lt;/span&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;Book&lt;/span&gt; &lt;span class="nf"&gt;addBook&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@Argument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"input"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nc"&gt;BookInput&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;repository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBook&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nd"&gt;@BatchMapping&lt;/span&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Author&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;author&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Book&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;books&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;authors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forBooks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;books&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;@BatchMapping&lt;/code&gt; resolves the author of every book in one call, which is the fix for the N+1 problem that sinks most GraphQL servers.&lt;/p&gt;

&lt;p&gt;The interesting part is what happens at build time. The build connects every resolver to the schema, and each of these fails the build with the method's name:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A resolver for a type or field the schema doesn't declare, with the list of fields the type does have.&lt;/li&gt;
&lt;li&gt;An &lt;code&gt;@Argument&lt;/code&gt; the field doesn't take.&lt;/li&gt;
&lt;li&gt;A primitive parameter for a nullable argument, which has no way to hold the null.&lt;/li&gt;
&lt;li&gt;Two methods resolving the same field.&lt;/li&gt;
&lt;li&gt;A subscription that doesn't return a &lt;code&gt;GraphQLStream&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In Spring for GraphQL most of those surface as a warning in a startup log, or as a null in production. Here they never get past your laptop, and nothing is looked up by reflection at run time.&lt;/p&gt;

&lt;p&gt;Subscriptions run over WebSocket with the standard &lt;code&gt;graphql-transport-ws&lt;/code&gt; protocol. A mutation sent over &lt;code&gt;GET&lt;/code&gt; is refused. Queries nested deeper than &lt;code&gt;cn1.graphql.maxDepth&lt;/code&gt; (15 by default) are rejected before a resolver runs, which shuts down the classic denial of service through a deeply nested query, and the GraphiQL page is off unless you turn it on. On the client, &lt;code&gt;cn1:generate-graphql&lt;/code&gt; reads your backend's own schema and generates the typed client, so a field renamed on the server is a compile error in the app.&lt;/p&gt;

&lt;h2&gt;
  
  
  SAML, LDAP and Active Directory
&lt;/h2&gt;

&lt;p&gt;Enterprise buyers don't ask whether you support single sign-on. They ask which identity provider you've tested with. The backend is a SAML 2.0 service provider with single logout, and works with Okta, Entra ID, ADFS, Ping, Google Workspace, Keycloak and Shibboleth:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="na"&gt;cn1.security.saml2.relyingparty.registration.okta.assertingparty.metadata-uri&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//corp.okta.com/app/abc123/sso/saml/metadata&lt;/span&gt;
&lt;span class="na"&gt;cn1.security.saml2.relyingparty.registration.okta.entity-id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//app.example.com/saml2/service-provider-metadata/okta&lt;/span&gt;
&lt;span class="na"&gt;cn1.security.saml2.cookie-secret&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;$&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="no"&gt;SAML_COOKIE_SECRET&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;saml2Login&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Customizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;withDefaults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;saml2Logout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Customizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;withDefaults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SAML has a long history of implementations that verified a signature and then read a different element than the one that was signed. So a response signs a user in only when all of these hold:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An XML signature verifies under a certificate you configured. A key carried inside the document is never trusted, and SHA-1 is refused unless you allow it.&lt;/li&gt;
&lt;li&gt;The signature covers the element that is read. A signed assertion moved elsewhere in the document, or an unsigned one placed next to it, is refused.&lt;/li&gt;
&lt;li&gt;The destination, issuer, audience and recipient all name this server and this provider.&lt;/li&gt;
&lt;li&gt;The time is inside the validity window, within three minutes of clock skew.&lt;/li&gt;
&lt;li&gt;The assertion was never used before on this server, so a captured response can't be replayed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The parser accepts no DTD and no custom entities, which closes XML external entity attacks before they start.&lt;/p&gt;

&lt;p&gt;For the companies still running a directory on premises, &lt;code&gt;LdapAuthenticationProvider&lt;/code&gt; binds against LDAP and &lt;code&gt;ActiveDirectoryLdapAuthenticationProvider&lt;/code&gt; against AD, reporting locked, expired and disabled accounts as distinct errors so your login screen can say something useful:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;BindAuthenticator&lt;/span&gt; &lt;span class="n"&gt;bind&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BindAuthenticator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;directory&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setUserDnPatterns&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"uid={0},ou=people"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;authenticationProvider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;LdapAuthenticationProvider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DefaultLdapAuthoritiesPopulator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;directory&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"ou=groups"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;formLogin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Customizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;withDefaults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you've written Spring Security, you've already read this code. That's deliberate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Object storage on any cloud, with no SDK
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;ObjectStorage&lt;/code&gt; is one interface, and a URL picks the provider:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;cn1.storage.url&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s3://us-east-1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Amazon S3, plus MinIO, Ceph, Backblaze B2 and Wasabi with &lt;code&gt;cn1.storage.s3.endpoint&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;r2://&amp;lt;account id&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Cloudflare R2, with an EU jurisdiction option&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gs://&amp;lt;project&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Google Cloud Storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;azblob://&amp;lt;account&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Azure Blob Storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;memory:&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;In memory, the default for tests&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;There's no cloud SDK in your server. The build links only the provider you named, so switching from S3 to R2 to cut egress costs is a property change, not a dependency migration. Uploads don't pass through your server at all:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Component&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Avatars&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;ObjectStorage&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;Avatars&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ObjectStorage&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;storage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;uploadUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;IOException&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;presignPut&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"avatars"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;userId&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;".png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The app gets a signed URL, does a plain HTTP &lt;code&gt;PUT&lt;/code&gt; straight to the bucket, and your server never pays for the bandwidth.&lt;/p&gt;

&lt;h2&gt;
  
  
  MongoDB, DynamoDB and search, with the same entities
&lt;/h2&gt;

&lt;p&gt;The entity classes you already have work against document databases too. Point &lt;code&gt;cn1.document.url&lt;/code&gt; at &lt;code&gt;mongodb://...&lt;/code&gt; or &lt;code&gt;dynamodb://us-east-1&lt;/code&gt; and query with the ORM's own API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;DocumentSession&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DocumentSession&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;current&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;persist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Order&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;open&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"open"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;orderBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"created"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;@SortKey&lt;/code&gt; marks the second half of a DynamoDB composite key. Full-text search is two annotations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Entity&lt;/span&gt; &lt;span class="nd"&gt;@Searchable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"products"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Product&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;@Id&lt;/span&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nd"&gt;@SearchField&lt;/span&gt; &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;supplierCode&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rows are indexed after the transaction commits, so search never shows a product the database rolled back. &lt;code&gt;cn1.search.url&lt;/code&gt; picks Elasticsearch, OpenSearch, Amazon OpenSearch Service or OpenSearch Serverless. The default, &lt;code&gt;database:&lt;/code&gt;, uses PostgreSQL text search or MySQL &lt;code&gt;FULLTEXT&lt;/code&gt;, so you get search on day one and move to a cluster when the traffic says so, without touching a line of code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Spring, where Spring got it right
&lt;/h2&gt;

&lt;p&gt;If this reads like Spring, that's on purpose. Spring did a good job of leading the direction of backend Java, and most Java developers already think in its annotations: &lt;code&gt;@RestController&lt;/code&gt;, &lt;code&gt;@Transactional&lt;/code&gt;, &lt;code&gt;@QueryMapping&lt;/code&gt;, &lt;code&gt;saml2Login&lt;/code&gt;. We follow it wherever we can, so your knowledge carries over and so do your agent's.&lt;/p&gt;

&lt;p&gt;We take a different route in two places.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We fail fast.&lt;/strong&gt; Failing fast is core to Codename One, on the client and on the server. A dependency nobody can satisfy, a GraphQL resolver for a field that doesn't exist, a malformed cron expression or a constructor cycle fails the build, naming the line, instead of failing the first request in production. A configuration key nothing sets stops the server at startup with the key's name. A query with no tenant throws instead of answering every tenant. I believe that's simply better for reliability, and more so in today's serverless and Kubernetes deployments, where a container that starts and then misbehaves is worse than one that refuses to start at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We build for performance and AOT.&lt;/strong&gt; The backend compiles to a native executable through the same ParparVM pipeline as our iOS port. There's no JVM underneath, no classpath scan, no reflection and no runtime proxies: the build writes the wiring out as plain &lt;code&gt;new&lt;/code&gt; calls, and &lt;code&gt;@Transactional&lt;/code&gt; rewrites the method itself, so it also applies to a call through &lt;code&gt;this&lt;/code&gt;, where a Spring proxy silently skips it. Spring can't rewrite its core concepts for ahead-of-time compilation without breaking a decade of applications built on them. We started without that baggage, and it's an opportunity they don't have.&lt;/p&gt;

&lt;p&gt;Next up on Monday: &lt;a href="https://www.codenameone.com/blog/generate-and-view-pdfs-in-java/" rel="noopener noreferrer"&gt;generating, viewing and printing PDFs&lt;/a&gt;, on the phone and on this same server.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mobile</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>A Million Rows and Live Excel Formulas, Inside Your Own App</title>
      <dc:creator>Shai Almog</dc:creator>
      <pubDate>Sat, 28 Nov 2026 14:17:51 +0000</pubDate>
      <link>https://dev.to/codenameone/a-million-rows-and-live-excel-formulas-inside-your-own-app-34bp</link>
      <guid>https://dev.to/codenameone/a-million-rows-and-live-excel-formulas-inside-your-own-app-34bp</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp5qbihjo6jzprguhmoif.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp5qbihjo6jzprguhmoif.jpg" alt="A data grid and a spreadsheet in a Java app" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My high school finishing exams included a test in Lotus 1-2-3. I've spent a good part of my career since then yelling at spreadsheets, and I still use them every day: the company P&amp;amp;L, grocery lists, student attendance. People love to hate them. The world runs on them anyway, because nothing else lets a person who isn't a programmer build a working model of their business in an afternoon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Codename One?&lt;/strong&gt; Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at &lt;a href="https://www.codenameone.com/" rel="noopener noreferrer"&gt;codenameone.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Lotus is worth remembering for another reason. It didn't invent the spreadsheet. VisiCalc did. Lotus put charts next to the numbers, and mixing two good ideas made one of the first great software companies. Here are the components. Remix them.&lt;/p&gt;

&lt;p&gt;This week Codename One gained two of them. &lt;code&gt;DataGrid&lt;/code&gt; is a grid for data at enterprise scale, and &lt;code&gt;Workbook&lt;/code&gt; turns it into a spreadsheet with real files and live formulas.&lt;/p&gt;

&lt;h2&gt;
  
  
  DataGrid is Table for a million rows
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Table&lt;/code&gt; stays. It lays out a real component in every cell, which is what you want for a form with twenty fields. &lt;code&gt;DataGrid&lt;/code&gt; is a different animal, closer to SwingX's &lt;code&gt;JXTable&lt;/code&gt; and &lt;code&gt;JXTreeTable&lt;/code&gt; if you remember those. It paints its own cells, like our Gantt chart and scheduler, so there's no component per row and only the visible rows cost anything.&lt;/p&gt;

&lt;p&gt;If you've built a back office system you know why that matters. A parts catalog, a ledger, a log of sensor readings or a CRM export isn't a hundred rows. It's a hundred thousand on a slow day.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;DataGrid&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DataGrid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// any TableModel, a million rows is fine&lt;/span&gt;
&lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setFrozenColumns&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;AMOUNT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setAggregate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;GridAggregate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;ORDER&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setAggregate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;GridAggregate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setGroupColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;REGION&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The developer guide's example hands the grid a model whose &lt;code&gt;getRowCount()&lt;/code&gt; returns 1,000,000 and scrolls past row 500,001. Selection is stored as ranges, so selecting all million rows is one range, not a million objects. Sorting and filtering reorder an array of row numbers and never copy your data.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-renderers.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-renderers.png" alt="A DataGrid with a frozen column, progress bars and colored amounts" width="800" height="356"&gt;&lt;/a&gt;Frozen columns and custom renderers.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-million.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-million.png" alt="A DataGrid scrolled deep into a million rows" width="800" height="356"&gt;&lt;/a&gt;A million rows.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-grouped.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-grouped.png" alt="A DataGrid grouped by region with sums and averages" width="800" height="356"&gt;&lt;/a&gt;Grouping with aggregates.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-tree.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-tree.png" alt="A tree grid with expandable rows" width="800" height="356"&gt;&lt;/a&gt;The tree grid.&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The rest is the feature list of a grid you'd normally license: resizable, movable and hidden columns, flex widths, a stable multi-key sort, filters, keyboard navigation, single and multiple row selection, and in-place editing with date, boolean and choice pickers. Every column takes its own renderer, formatter and comparator, and the whole thing is styled with CSS, with light and dark modes and a native iOS look out of the box.&lt;/p&gt;

&lt;p&gt;The tree mode takes a &lt;code&gt;TreeTableModel&lt;/code&gt; and loads children lazily, so a node costs only what it shows when it opens. A bill of materials ten levels deep is fine.&lt;/p&gt;

&lt;p&gt;Swing developers get a bonus. Our Swing compatibility layer's &lt;code&gt;JTable&lt;/code&gt; and &lt;code&gt;JXTreeTable&lt;/code&gt; now run on the same row engine, so the &lt;a href="https://www.codenameone.com/blog/swing-and-javafx-on-phones/" rel="noopener noreferrer"&gt;Swing code you bring to a phone&lt;/a&gt; sorts a big table as fast as the native grid does.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then it becomes a spreadsheet
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Workbook&lt;/code&gt; reads and writes &lt;code&gt;.xlsx&lt;/code&gt;, &lt;code&gt;.ods&lt;/code&gt; and CSV. Each &lt;code&gt;Sheet&lt;/code&gt; is a &lt;code&gt;TableModel&lt;/code&gt;, so it drops straight into a &lt;code&gt;DataGrid&lt;/code&gt;, with the number formats from the file turned into column formatters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Workbook&lt;/span&gt; &lt;span class="n"&gt;book&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Workbook&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Workbook&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Format&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;detect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fileName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;Sheet&lt;/span&gt; &lt;span class="n"&gt;sheet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;book&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getSheet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;DataGrid&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DataGrid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setColumns&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createColumns&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-orders.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-orders.png" alt="An orders sheet with formulas in a DataGrid" width="800" height="356"&gt;&lt;/a&gt;An orders sheet, live.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-loan.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-loan.png" alt="A loan calculator built from spreadsheet formulas" width="800" height="356"&gt;&lt;/a&gt;A loan model with PMT.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-summary.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-summary.png" alt="A summary sheet referencing other sheets" width="800" height="356"&gt;&lt;/a&gt;Cross-sheet references.&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Formulas are live. Change a cell and every dependent cell recalculates, including on other sheets, and the grid repaints without a line of your code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Workbook&lt;/span&gt; &lt;span class="n"&gt;book&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Workbook&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;Sheet&lt;/span&gt; &lt;span class="n"&gt;sheet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;book&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addSheet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Orders"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addRow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Item"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Units"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Price"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Total"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addRow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Bolt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;40.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addRow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Bracket"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;12.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;3.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setCellFormula&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"D2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"=B2*C2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setCellFormula&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"D3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"=B3*C3"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setCellFormula&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"D4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"=SUM(D2:D3)"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;Object&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getCellValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"D4"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// 52.0&lt;/span&gt;
&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setCellValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"B2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;100.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;            &lt;span class="c1"&gt;// D2 and D4 update&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The engine implements 402 Excel functions across math, statistics, text, dates, lookup, financial, engineering, database and dynamic arrays. &lt;code&gt;XLOOKUP&lt;/code&gt;, &lt;code&gt;FILTER&lt;/code&gt;, &lt;code&gt;SORT&lt;/code&gt;, &lt;code&gt;SEQUENCE&lt;/code&gt;, &lt;code&gt;LET&lt;/code&gt; and &lt;code&gt;PMT&lt;/code&gt; are all there, with cross-sheet references, defined names and Excel's own nesting limit of 64.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBYW1hMU1gsIE9EUywgQ1NWPGJyLz5mcm9tIGFueXdoZXJlIGluIHRoZSBvcmddIC0tPiBXW1dvcmtib29rXQogICAgVyAtLT4gU1tTaGVldCA9IFRhYmxlTW9kZWxdCiAgICBTIC0tPiBHW0RhdGFHcmlkPGJyLz5zb3J0LCBmaWx0ZXIsIGdyb3VwXQogICAgUyAtLT4gRls0MDIgbGl2ZSBmdW5jdGlvbnNdCiAgICBHIC0tPiBFW1dvcmtib29rLmZyb21HcmlkPGJyLz5leHBvcnQgd2hhdCB0aGUgdXNlciBzZWVzXQogICAgRSAtLT4gWDJbWExTWCBiYWNrIHRvIEV4Y2VsXQ%3D%3D%3Ftype%3Dpng%26bgColor%3Dffffff" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBYW1hMU1gsIE9EUywgQ1NWPGJyLz5mcm9tIGFueXdoZXJlIGluIHRoZSBvcmddIC0tPiBXW1dvcmtib29rXQogICAgVyAtLT4gU1tTaGVldCA9IFRhYmxlTW9kZWxdCiAgICBTIC0tPiBHW0RhdGFHcmlkPGJyLz5zb3J0LCBmaWx0ZXIsIGdyb3VwXQogICAgUyAtLT4gRls0MDIgbGl2ZSBmdW5jdGlvbnNdCiAgICBHIC0tPiBFW1dvcmtib29rLmZyb21HcmlkPGJyLz5leHBvcnQgd2hhdCB0aGUgdXNlciBzZWVzXQogICAgRSAtLT4gWDJbWExTWCBiYWNrIHRvIEV4Y2VsXQ%3D%3D%3Ftype%3Dpng%26bgColor%3Dffffff" alt="Diagram" width="1146" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Typing a formula feels like Excel
&lt;/h3&gt;

&lt;p&gt;This is the part I'm proudest of, because it's what makes a spreadsheet usable by the people who actually live in them. The formula editor is a one line code editor. It colors each reference and outlines the same cells in the grid in the same color. It completes function names with a description, shows the argument list with the current argument in bold, inserts a cell's address when you tap it, and cycles &lt;code&gt;$A$1&lt;/code&gt; and the other reference forms on F4.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-formula-complete.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-formula-complete.png" alt="Formula completion listing ROUND, ROUNDDOWN and ROUNDUP" width="800" height="356"&gt;&lt;/a&gt;Function completion.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-formula-hint.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-formula-hint.png" alt="A formula argument hint with the current argument in bold" width="800" height="356"&gt;&lt;/a&gt;Argument hints and colored references.&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;FormulaBar&lt;/code&gt; is the ready-made field above the sheet, if you want the Excel layout without building it.&lt;/p&gt;

&lt;p&gt;When the user is done, &lt;code&gt;Workbook.fromGrid&lt;/code&gt; saves exactly what the grid shows: the sort, the filter, the groups as outline levels and the frozen columns. They open it in Excel and it looks the way they left it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you can build with this
&lt;/h2&gt;

&lt;p&gt;Every company has a folder of spreadsheets that are secretly applications. A pricing model in sales, a shift roster in operations, an inventory count somebody reconciles every Friday. Today those files get emailed around, and the version on someone's laptop is the one that matters.&lt;/p&gt;

&lt;p&gt;Pull them into your app instead. Import the sheet, keep the formulas the finance team wrote, and connect the cells to everything else Codename One does: your backend's database, a &lt;a href="https://www.codenameone.com/blog/multi-tenant-saas-backend-in-java/" rel="noopener noreferrer"&gt;multi-tenant server&lt;/a&gt;, push notifications when a number crosses a line, a PDF of the result, a chart, a map. The model stays a spreadsheet the business can read. Everything around it is the part a spreadsheet could never do.&lt;/p&gt;

&lt;p&gt;That's the Lotus move. Two ideas everyone already has, put together, make something nobody had.&lt;/p&gt;

&lt;p&gt;Tomorrow: &lt;a href="https://www.codenameone.com/blog/multi-tenant-saas-backend-in-java/" rel="noopener noreferrer"&gt;the backend that keeps each customer's data its own&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mobile</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Why My Kids are Learning to Program - The New Baseline</title>
      <dc:creator>Shai Almog</dc:creator>
      <pubDate>Fri, 27 Nov 2026 14:23:23 +0000</pubDate>
      <link>https://dev.to/codenameone/why-my-kids-are-learning-to-program-the-new-baseline-1349</link>
      <guid>https://dev.to/codenameone/why-my-kids-are-learning-to-program-the-new-baseline-1349</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpyqwvnrl3enclb3mphoh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpyqwvnrl3enclb3mphoh.jpg" alt="Why my kids are learning to program: the new baseline" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Type one paragraph into Claude Code or Codex and an agent builds a Codename One app, taps through every screen, draws the icon, signs it, and submits it to TestFlight and Google Play. This week we wired our build cloud straight into that loop, so the whole trip from prompt to store is one conversation. You approve screenshots. You never see a line of Java. You don't need a Mac.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Codename One?&lt;/strong&gt; Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at &lt;a href="https://www.codenameone.com/" rel="noopener noreferrer"&gt;codenameone.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'm teaching my kids to program anyway. Java, specifically.&lt;/p&gt;

&lt;p&gt;Agents moved the baseline so far up that the people who understand what's under it just became the most valuable people in the room.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Your first app is now a complete app.&lt;/strong&gt; An Uber clone used to be the final exam. Now it's what one prompt hands you before lunch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An agent can take it all the way to the App Store.&lt;/strong&gt; It builds in our cloud, reads the log, fixes the error and submits. You tick three boxes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I'm still teaching my kids Java.&lt;/strong&gt; An agent is brilliant at sounding right. Only someone who reads code can tell when it isn't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apps are about to be a thousand times bigger.&lt;/strong&gt; Billions of lines, and the people who understand them run the show.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't own code you didn't need to write.&lt;/strong&gt; We maintain 4.5 million lines and paid $21,512.95 last month to test them on every platform. That bill stays ours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your enterprise features, behind your firewall.&lt;/strong&gt; Corporate Server is back.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A spreadsheet engine, PDFs, flowcharts, a SaaS backend and a game studio.&lt;/strong&gt; All in this week's release, all free.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Coming This Week
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Saturday, November 21:&lt;/strong&gt; &lt;a href="https://www.codenameone.com/blog/a-million-rows-and-live-excel-formulas/" rel="noopener noreferrer"&gt;A Million Rows and Live Excel Formulas, Inside Your Own App&lt;/a&gt;. DataGrid, and spreadsheets with XLSX files and 402 live functions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sunday, November 22:&lt;/strong&gt; &lt;a href="https://www.codenameone.com/blog/multi-tenant-saas-backend-in-java/" rel="noopener noreferrer"&gt;Build a Multi-Tenant SaaS Backend That Can't Leak One Customer Into Another&lt;/a&gt;. Tenant isolation, GraphQL, SAML and LDAP, object storage on four clouds, MongoDB, DynamoDB and search.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monday, November 23:&lt;/strong&gt; &lt;a href="https://www.codenameone.com/blog/generate-and-view-pdfs-in-java/" rel="noopener noreferrer"&gt;Invoices, Tickets and Reports: Generate, View and Print PDFs From One Java Codebase&lt;/a&gt;. On the phone and on the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tuesday, November 24:&lt;/strong&gt; &lt;a href="https://www.codenameone.com/blog/field-service-scheduling-template/" rel="noopener noreferrer"&gt;Fieldline: Launch Your Own Field Service App, With a Scheduler That Plans the Week&lt;/a&gt;. Dispatch, routes, signatures and a heuristic optimizer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wednesday, November 25:&lt;/strong&gt; &lt;a href="https://www.codenameone.com/blog/diagrams-flowcharts-and-kanban-boards/" rel="noopener noreferrer"&gt;Flowcharts, Node Editors and Kanban Boards Are Now Standard Components&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thursday, November 26:&lt;/strong&gt; &lt;a href="https://www.codenameone.com/blog/build-a-game-platform-with-luau-scripting/" rel="noopener noreferrer"&gt;Brickyard: Launch Your Own Game Platform, With the Studio Inside the App&lt;/a&gt;. Plus portable shaders and 3D audio.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://www.codenameone.com/blog/a-million-rows-and-live-excel-formulas/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-formula-complete.png" alt="Formula completion in a spreadsheet" width="800" height="356"&gt;&lt;/a&gt;Live formulas.&lt;br&gt;
&lt;a href="https://www.codenameone.com/blog/field-service-scheduling-template/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Ffieldline-gantt.png" alt="Fieldline's dispatch Gantt chart" width="800" height="480"&gt;&lt;/a&gt;Fieldline dispatch.&lt;br&gt;
&lt;a href="https://www.codenameone.com/blog/diagrams-flowcharts-and-kanban-boards/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-flowchart.png" alt="A flowchart with swim lanes" width="800" height="356"&gt;&lt;/a&gt;Flowcharts.&lt;br&gt;
&lt;a href="https://www.codenameone.com/blog/build-a-game-platform-with-luau-scripting/" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-desktop-studio.png" alt="The Brickyard studio" width="800" height="441"&gt;&lt;/a&gt;Brickyard's studio.&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hello world is now a complete app
&lt;/h2&gt;

&lt;p&gt;For forty years the first program anyone wrote printed one line. Then it was a screen with a button. Then a to-do list.&lt;/p&gt;

&lt;p&gt;Today the first program an agent writes for you is a complete app. It has sign-in, a database, push notifications, dark mode, and builds for iOS, Android, the desktop and the web. That's what one prompt produces today, and it gets bigger every quarter.&lt;/p&gt;

&lt;p&gt;When the floor rises, everything above it rises too. A few years ago "build an Uber clone" was the hardest assignment in a mobile course. We made one you can &lt;a href="https://www.codenameone.com/blog/create-an-uber-clone-in-1-minute/" rel="noopener noreferrer"&gt;generate in a minute&lt;/a&gt;. Cloning Uber is now where a modern app starts, not where it ends.&lt;/p&gt;

&lt;p&gt;So what does the ceiling look like? Embedded systems on a factory floor talking to the cloud and to the phone in a technician's pocket. Every spreadsheet in a company pulled into one app, with each formula wired to live data. Business processes as diagrams that people edit and the server executes. Games where players build the games. Each of those used to need a department. Now it needs three people and an agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  An agent can ship your app
&lt;/h2&gt;

&lt;p&gt;We spent the last few weeks making sure agents can drive all of Codename One, not only write code for it. The front door is &lt;a href="https://www.codenameone.com/agents/" rel="noopener noreferrer"&gt;codenameone.com/agents&lt;/a&gt;. Point any agent at our &lt;a href="https://www.codenameone.com/llms.txt" rel="noopener noreferrer"&gt;llms.txt&lt;/a&gt; with a prompt like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use Codename One (read https://www.codenameone.com/llms.txt) to build me an
iPhone and Android app that tracks daily habits with streaks and reminders.
Show me screenshots before you submit it to TestFlight and Google Play testing.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent installs our skill, interviews you once, and creates the project with a script that downloads its own JDK. It runs the app, taps through it and screenshots every screen, then makes the icon. Before anything ships, it reviews the app against the App Store and Google Play rules that get apps rejected.&lt;/p&gt;

&lt;p&gt;Then it talks to our build cloud directly. Every new project carries the Codename One cloud MCP server in its &lt;code&gt;.mcp.json&lt;/code&gt;, so the agent can start builds, read the build log, fix what broke and build again. You sign in once in the browser and choose what it's allowed to do. Three checkboxes grant Apple signing, push setup and store submission. Anything outside them, like revoking a certificate or touching billing, stops and sends you a link to approve that one request. You decide what the agent may touch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2Fc2VxdWVuY2VEaWFncmFtCiAgICBwYXJ0aWNpcGFudCBZb3UKICAgIHBhcnRpY2lwYW50IEFnZW50IGFzIENsYXVkZSBvciBDb2RleAogICAgcGFydGljaXBhbnQgQ2xvdWQgYXMgQ29kZW5hbWUgT25lIGNsb3VkIChNQ1ApCiAgICBwYXJ0aWNpcGFudCBTdG9yZXMgYXMgQXBwIFN0b3JlIC8gR29vZ2xlIFBsYXkKICAgIFlvdS0-PkFnZW50OiBPbmUgcGFyYWdyYXBoIGRlc2NyaWJpbmcgdGhlIGFwcAogICAgQWdlbnQtPj5BZ2VudDogQ3JlYXRlIHByb2plY3QsIGJ1aWxkLCBzY3JlZW5zaG90IGV2ZXJ5IHNjcmVlbgogICAgQWdlbnQtPj5Zb3U6IFNjcmVlbnNob3RzLCB2aWRlbywgaWNvbgogICAgWW91LT4-QWdlbnQ6IEFwcHJvdmVkCiAgICBBZ2VudC0-PkNsb3VkOiBzdGFydF9idWlsZCAoc2lnbmluZyBncmFudGVkIG9uY2UpCiAgICBDbG91ZC0tPj5BZ2VudDogQnVpbGQgbG9nLCBmaXgsIHJlYnVpbGQKICAgIEFnZW50LT4-Q2xvdWQ6IFN1Ym1pdCB0byBUZXN0RmxpZ2h0IGFuZCBQbGF5IHRlc3RpbmcKICAgIENsb3VkLT4-U3RvcmVzOiBTaWduZWQgYnVpbGRzCiAgICBBZ2VudC0-PllvdTogUmV2b2tlIGEgY2VydGlmaWNhdGU_IEFwcHJvdmUgdGhpcyBsaW5r%3Ftype%3Dpng%26bgColor%3Dffffff" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2Fc2VxdWVuY2VEaWFncmFtCiAgICBwYXJ0aWNpcGFudCBZb3UKICAgIHBhcnRpY2lwYW50IEFnZW50IGFzIENsYXVkZSBvciBDb2RleAogICAgcGFydGljaXBhbnQgQ2xvdWQgYXMgQ29kZW5hbWUgT25lIGNsb3VkIChNQ1ApCiAgICBwYXJ0aWNpcGFudCBTdG9yZXMgYXMgQXBwIFN0b3JlIC8gR29vZ2xlIFBsYXkKICAgIFlvdS0-PkFnZW50OiBPbmUgcGFyYWdyYXBoIGRlc2NyaWJpbmcgdGhlIGFwcAogICAgQWdlbnQtPj5BZ2VudDogQ3JlYXRlIHByb2plY3QsIGJ1aWxkLCBzY3JlZW5zaG90IGV2ZXJ5IHNjcmVlbgogICAgQWdlbnQtPj5Zb3U6IFNjcmVlbnNob3RzLCB2aWRlbywgaWNvbgogICAgWW91LT4-QWdlbnQ6IEFwcHJvdmVkCiAgICBBZ2VudC0-PkNsb3VkOiBzdGFydF9idWlsZCAoc2lnbmluZyBncmFudGVkIG9uY2UpCiAgICBDbG91ZC0tPj5BZ2VudDogQnVpbGQgbG9nLCBmaXgsIHJlYnVpbGQKICAgIEFnZW50LT4-Q2xvdWQ6IFN1Ym1pdCB0byBUZXN0RmxpZ2h0IGFuZCBQbGF5IHRlc3RpbmcKICAgIENsb3VkLT4-U3RvcmVzOiBTaWduZWQgYnVpbGRzCiAgICBBZ2VudC0-PllvdTogUmV2b2tlIGEgY2VydGlmaWNhdGU_IEFwcHJvdmUgdGhpcyBsaW5r%3Ftype%3Dpng%26bgColor%3Dffffff" alt="Diagram" width="1133" height="661"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Somebody who has never heard of Java can now publish a real app, and plenty of good ones will come from people who know their problem better than any programmer.&lt;/p&gt;

&lt;h2&gt;
  
  
  So why am I teaching my kids Java?
&lt;/h2&gt;

&lt;p&gt;For the same reason the best Java developers know assembly language and what the CPU does with their code.&lt;/p&gt;

&lt;p&gt;Almost none of us write assembly. But knowing what a cache line is, why a branch costs something, what the JIT is doing with your loop, makes you write better Java. Fundamentals are what let you work one level up without being a passenger.&lt;/p&gt;

&lt;p&gt;I learned that from the other direction. I'm a terrible graphic artist. Out of necessity I learned GIMP, Photoshop and Sketch well enough to get by. I never became good at it. What I got instead was a much better sense of style, and something I value more: I can talk to people who actually have talent. I understand what they do, so I can give feedback they take seriously instead of "make it pop."&lt;/p&gt;

&lt;p&gt;Working with a coding agent is the same relationship. It explains what it did. If you can't read the code, you can't judge the explanation, and you can't steer it to where you need to go. An agent is very good at sounding right. Its answers are often not right, and the only way to tell is to look at the code. Java is a good language to learn that in: it's explicit, it's typed, and what it does is what it says.&lt;/p&gt;

&lt;p&gt;A couple of weeks ago I wrote that &lt;a href="https://www.codenameone.com/blog/rewrite-everything-in-java-not-rust/" rel="noopener noreferrer"&gt;you should rewrite everything in Java, not Rust&lt;/a&gt;. Same idea from the other side. A developer who knows the language can push an agent much further, because they catch the confident wrong answer on the second line instead of in production. That's how you build software that's both more sophisticated and more reliable than what came before, instead of more of the same, faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  From millions of lines to billions
&lt;/h2&gt;

&lt;p&gt;Will you read every line an agent writes? No. Nobody reads every line now either.&lt;/p&gt;

&lt;p&gt;But understanding is what keeps a system in check as it grows. It's how you know whether your tests cover the code or only run it. It's how you notice that the agent's fix for one bug added a second code path that nothing tests. It's how you see complexity piling up layer by layer before it falls over.&lt;/p&gt;

&lt;p&gt;We used to call a million lines a big system. Agents write code faster than any team that ever wrote one of those, they never get bored, and they never say no to a feature. The apps of the next decade will reach billions of lines. A codebase that size isn't navigated by prompting harder. It's navigated by engineers who understand architecture, testing and failure modes, and can tell an agent precisely what to do. That's the job my kids are training for.&lt;/p&gt;

&lt;h2&gt;
  
  
  A framework should take you past the OS
&lt;/h2&gt;

&lt;p&gt;This is what this week's release is about.&lt;/p&gt;

&lt;p&gt;An agent can write a spreadsheet engine for you, on top of any framework. It can write a PDF renderer, a diagramming library, tenant filtering for your ORM, a heuristic scheduler. Each one will look fine in the first demo. Then it's yours. It's more code in your repository, more context the agent has to hold, more tests in your CI, more platforms to verify, forever. Code is cheap to generate and expensive to own, and the complexity binds you. A homegrown PDF renderer is a tax you pay every release.&lt;/p&gt;

&lt;p&gt;So a framework's job is no longer to wrap what the operating system offers. Agents do that easily. The job is to take you far beyond it. Neither iOS nor Android ships a spreadsheet with live formulas, a flowchart editor, a Gantt chart or a multi-tenant backend. A complete spreadsheet is now the starting point. A flowchart of a business process is the bare minimum for a business app.&lt;/p&gt;

&lt;p&gt;Codename One is 4.5 million lines of code you don't have to write. We test it on every commit across iOS, Android, macOS, Windows, Linux and the web, with screenshot comparisons on each one. That costs us about $20,000 a month in CI ($21,512.95 last month, to be exact). Generate the same coverage yourself and that bill is yours.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enterprises have to move like startups
&lt;/h2&gt;

&lt;p&gt;Large companies are now expected to ship at the speed a three-person startup ships with agents. But they can't take the risks an indie developer takes. Their source code, signing keys and user data can't leave the network, and no compliance team will approve a build pipeline they don't control.&lt;/p&gt;

&lt;p&gt;Codename One itself is free and open source, and that includes building offline on your own machine. Every developer, in every company, can build for every platform without sending a byte to anyone. That never changes.&lt;/p&gt;

&lt;p&gt;What a large company wants on top of that are our commercial, enterprise grade services, and until now those lived in our cloud. So we're bringing back &lt;a href="https://www.codenameone.com/corporate-server/" rel="noopener noreferrer"&gt;Corporate Server&lt;/a&gt;. It's an optional product that runs those services on premises at your site, or in a dedicated private cloud isolated from every other customer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The build cloud&lt;/strong&gt;, so developers keep sending a build and getting a signed app back, without a Mac on every desk.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The push server&lt;/strong&gt; for your backend.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;App Shield attestation&lt;/strong&gt;, so your API serves only genuine, untampered copies of your app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;App Hardening&lt;/strong&gt;, obfuscation at the level of DexGuard: renamed classes, encrypted strings and scrambled control flow, on every port.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Crash Protection&lt;/strong&gt;, with symbolicated crashes filed into your own issue tracker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analytics&lt;/strong&gt; and the rest of the enterprise services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of it inside your network, under your compliance rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  More This Week
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A million rows, and spreadsheets with live formulas
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;DataGrid&lt;/code&gt; doesn't replace &lt;code&gt;Table&lt;/code&gt;. It's the extreme version, in the spirit of SwingX's &lt;code&gt;JXTable&lt;/code&gt; and &lt;code&gt;JXTreeTable&lt;/code&gt;: a painted grid that scrolls a million rows, with frozen columns, grouping with aggregates, in-place editing and a lazy tree mode. On top of it, &lt;code&gt;Workbook&lt;/code&gt; reads and writes XLSX, ODS and CSV and evaluates 402 Excel functions live, with completion and syntax highlighting while you type a formula.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Sheet&lt;/span&gt; &lt;span class="n"&gt;sheet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Workbook&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addSheet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Orders"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addRow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Item"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Units"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Price"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Total"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addRow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Bolt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;40.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setCellFormula&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"D2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"=B2*C2"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;DataGrid&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DataGrid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sheet&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-million.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-million.png" alt="A DataGrid scrolled deep into a million rows" width="800" height="356"&gt;&lt;/a&gt;A million rows.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-grouped.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-grouped.png" alt="A DataGrid grouped by region with aggregates" width="800" height="356"&gt;&lt;/a&gt;Grouping and aggregates.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-formula-hint.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fdatagrid-sheet-formula-hint.png" alt="Typing a formula with argument hints and colored references" width="800" height="356"&gt;&lt;/a&gt;Formulas that feel like Excel.&lt;p&gt;&lt;/p&gt;

&lt;p&gt;My high school finishing exams included a test in Lotus 1-2-3. Lotus didn't invent the spreadsheet, VisiCalc did. Lotus put charts next to the numbers, and two great ideas combined made one of the first iconic software startups. That's my theme for this week: here are the components, remix them into something wonderful. Saturday's &lt;a href="https://www.codenameone.com/blog/a-million-rows-and-live-excel-formulas/" rel="noopener noreferrer"&gt;article&lt;/a&gt; has the details.&lt;/p&gt;

&lt;h3&gt;
  
  
  A backend that can't leak one customer into another
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;@TenantId&lt;/code&gt; on an entity filters every ORM query, count and bulk update by the current tenant. Native SQL in a multi-tenant session is blocked by default, because the forgotten &lt;code&gt;WHERE tenant_id = ?&lt;/code&gt; in a hand-written query is the most common data leak in SaaS. You opt in explicitly, and &lt;code&gt;allowNativeSql&lt;/code&gt; becomes the one thing a security review has to search for.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Entity&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Invoice&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;@Id&lt;/span&gt; &lt;span class="nd"&gt;@GeneratedValue&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nd"&gt;@TenantId&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The backend also gained a Spring-style GraphQL server, SAML 2.0 single sign-on, LDAP and Active Directory, object storage on S3, R2, Google Cloud Storage and Azure Blob with no SDKs, and MongoDB, DynamoDB and Elasticsearch through the same entity classes. Sunday's &lt;a href="https://www.codenameone.com/blog/multi-tenant-saas-backend-in-java/" rel="noopener noreferrer"&gt;backend article&lt;/a&gt; covers all of it.&lt;/p&gt;

&lt;h3&gt;
  
  
  PDFs on the client and the server
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;com.codename1.pdf&lt;/code&gt; writes documents with a canvas or a flowing layout of paragraphs and tables, and the same classes run in the app and on the backend. &lt;code&gt;PdfViewer&lt;/code&gt; renders in pure Java, so a file looks identical on every platform. It opens encrypted documents and prints them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8fh9cd13fv5s59jldd2u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8fh9cd13fv5s59jldd2u.png" alt="The PDF viewer showing a generated invoice" width="800" height="780"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Monday's &lt;a href="https://www.codenameone.com/blog/generate-and-view-pdfs-in-java/" rel="noopener noreferrer"&gt;PDF article&lt;/a&gt; walks through invoices, tickets, and printing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fieldline, a field service company in a template
&lt;/h3&gt;

&lt;p&gt;One of my first jobs was at a scheduling company, writing heuristic scheduling algorithms that planners watched as Gantt charts full of constraints. It's a hard field. Fieldline makes it a template: technicians follow their day as a route on a map, fill checklists, photograph problems for an AI diagnosis and collect signatures. Dispatchers drag work on a Gantt chart, ask the assistant to re-plan in plain words, and let a solver plan the week around skills, hours, and travel. Maps, location, an AI expert on call and heuristic optimization, connected in one app.&lt;/p&gt;

&lt;a href="https://www.codenameone.com/fieldline/fieldline-dispatcher-mobile.mp4" rel="noopener noreferrer"&gt;Download the Fieldline video&lt;/a&gt;.

&lt;p&gt;Tuesday's &lt;a href="https://www.codenameone.com/blog/field-service-scheduling-template/" rel="noopener noreferrer"&gt;Fieldline article&lt;/a&gt; opens up the optimizer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Diagrams, node editors and Kanban boards
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;NodeGraph&lt;/code&gt; draws diagrams with automatic layered, tree, radial and force layouts, flowchart shapes and swim lanes, and doubles as a port-based node editor. &lt;code&gt;KanbanBoard&lt;/code&gt; adds draggable cards, swim lanes and WIP limits. In most frameworks these are commercial add-ons. The baseline for a business app moved, so they're in the core.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;DefaultGraphModel&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DefaultGraphModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GraphNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"web"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Web app"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GraphNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"api"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"API gateway"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEdge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"web"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"api"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;NodeGraph&lt;/span&gt; &lt;span class="n"&gt;graph&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;NodeGraph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;graph&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arrange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;LayeredArrangement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-flowchart.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-flowchart.png" alt="A flowchart with swim lanes" width="800" height="356"&gt;&lt;/a&gt;Flowcharts with swim lanes.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-editor.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fgraph-editor.png" alt="A node editor with typed ports" width="800" height="356"&gt;&lt;/a&gt;Node editors.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fkanban-lanes.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fgenerated%2Fkanban-lanes.png" alt="A Kanban board with swim lanes and a WIP limit" width="800" height="356"&gt;&lt;/a&gt;Kanban with WIP limits.&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Wednesday's &lt;a href="https://www.codenameone.com/blog/diagrams-flowcharts-and-kanban-boards/" rel="noopener noreferrer"&gt;article&lt;/a&gt; shows flowcharts, editors, and boards.&lt;/p&gt;

&lt;h3&gt;
  
  
  Brickyard, shaders and 3D audio
&lt;/h3&gt;

&lt;p&gt;Brickyard is a real game development studio, and it ships as a template. Games are Luau scripts in a 3D world of parts, and the interpreter runs the full Luau language with its standard libraries. Bring a Roblox place file, &lt;code&gt;.rbxlx&lt;/code&gt; or binary &lt;code&gt;.rbxl&lt;/code&gt;, and it opens and runs, with a compatibility report listing any API the engine doesn't cover yet. Export it back out when you're done.&lt;/p&gt;

&lt;p&gt;The studio has an explorer, a properties panel, a Luau editor with syntax checking and completion, lighting, models, undo, play test with several players, and publish, on a phone, a tablet or a desktop. Multiplayer runs on an authoritative server. An AI agent can drive the whole studio through MCP and play test its own game to see what broke.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-desktop-code.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-desktop-code.png" alt="Editing a Luau script in the Brickyard studio on the desktop" width="800" height="441"&gt;&lt;/a&gt;Luau, with completion and syntax checks.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-desktop-studio.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-desktop-studio.png" alt="The Brickyard studio with the explorer, viewport and properties" width="800" height="441"&gt;&lt;/a&gt;The studio on the desktop.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-playtest.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fbrickyard-playtest.png" alt="A Brickyard play test with several players" width="607" height="1080"&gt;&lt;/a&gt;Play test before you publish.&lt;p&gt;&lt;/p&gt;

&lt;a href="https://www.codenameone.com/brickyard/brickyard-game-types.mp4" rel="noopener noreferrer"&gt;Download the Brickyard video&lt;/a&gt;.

&lt;p&gt;Under it, the GPU package gained portable shader nodes that compile to Metal, Direct3D, GLSL and WebGL from one Java definition, a library of water, terrain, surface and effect shaders, image-based lighting, GPU skinning, instancing and a full post-processing stack. The new audio graph, modeled on Web Audio, adds spatial sound with HRTF for headphones. Thursday's &lt;a href="https://www.codenameone.com/blog/build-a-game-platform-with-luau-scripting/" rel="noopener noreferrer"&gt;article&lt;/a&gt; covers all three.&lt;/p&gt;

&lt;h3&gt;
  
  
  Foldable skins you can record
&lt;/h3&gt;

&lt;p&gt;The simulator now draws foldable skins in 3D and animates them between flat, half open and closed, moving your app to the cover display when the device closes. Posture events fire at the same angles Android uses, so your fold handling runs in the simulator exactly as it will on the device. &lt;em&gt;Simulate, Record Device Tour&lt;/em&gt; records the device folding and rotating to an MP4 at a smooth 60 frames per second, staged and ready for your store listing. Here's a raw recording, straight out of the simulator:&lt;/p&gt;

&lt;a href="https://www.codenameone.com/blog/release-2026-11-20/foldable-device-tour.mp4" rel="noopener noreferrer"&gt;Download the foldable tour video&lt;/a&gt;.

&lt;p&gt;The skin designer has a new Fold tab for building your own foldables, and agents can fold the device too, through the &lt;code&gt;sim_fold&lt;/code&gt; MCP tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  Xcode 27.1, Gradle 9 and goodbye to Mac Catalyst
&lt;/h3&gt;

&lt;p&gt;With next week's update, iOS builds move to Xcode 27.1 by default and the iOS 27 styling becomes the default theme. &lt;a href="https://www.codenameone.com/blog/ios-27-glass-you-can-test/" rel="noopener noreferrer"&gt;Liquid Glass stays your choice&lt;/a&gt;, on your schedule. The same update turns on Gradle 9 by default for Android builds, part of keeping the Android toolchain current. Try it today with the &lt;code&gt;android.gradleVersion=9&lt;/code&gt; build hint, so next week is a non-event for you.&lt;/p&gt;

&lt;p&gt;We're dropping Mac Catalyst support. The &lt;a href="https://www.codenameone.com/blog/native-appkit-mac-port/" rel="noopener noreferrer"&gt;native Mac port&lt;/a&gt; is better in every way: a real AppKit app with real menus and windows, not an iPad app on a Mac. Keeping Catalyst in CI was eating resources that serve you better elsewhere. If you still build for Catalyst, switch to the native Mac target.&lt;/p&gt;

&lt;h2&gt;
  
  
  Everything, for everyone
&lt;/h2&gt;

&lt;p&gt;Look at the size of this one week. A spreadsheet engine with 402 functions. A PDF writer and viewer. A diagram editor and a Kanban board. Tenant isolation, GraphQL, SAML and four object stores for the server. A field service product with an optimizer. A game studio that runs Roblox places. Shaders, spatial audio, foldables. Any one of those is a product somebody sells on its own.&lt;/p&gt;

&lt;p&gt;That's the scope I mean when I call Codename One a &lt;a href="https://www.codenameone.com/blog/flutter-better-in-java/" rel="noopener noreferrer"&gt;universal platform&lt;/a&gt;. Instead of coding to an operating system, you code to Codename One, and it runs your app on iOS, Android, the desktop, the web and the watch, with your backend in the same language. Bring Java, Kotlin, Swing, JavaFX, Android or Flutter code. Build a bank, a game, a SaaS product or a homework app. It's free and open source, for a solo developer and for a company with ten thousand of them.&lt;/p&gt;

&lt;p&gt;Every week it grows, and it has to. When an agent can generate the boring parts of any app in a minute, the framework underneath has to cover everything else: every platform, every component a business expects, every service a company has to run. The bar moved for everyone, so the platform has to give everything to everyone.&lt;/p&gt;

&lt;p&gt;That's also why I'm comfortable teaching my kids Java. They won't spend their careers wrapping an OS or rebuilding a PDF renderer. They'll start where all of this ends, and the ones who can read the code will take it further than we can picture today.&lt;/p&gt;

&lt;p&gt;Start with Saturday's &lt;a href="https://www.codenameone.com/blog/a-million-rows-and-live-excel-formulas/" rel="noopener noreferrer"&gt;spreadsheets&lt;/a&gt;, or point your agent at &lt;a href="https://www.codenameone.com/llms.txt" rel="noopener noreferrer"&gt;llms.txt&lt;/a&gt; and see what it ships.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mobile</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Run an LLM and Whisper on the Phone, With No Server Bill</title>
      <dc:creator>Shai Almog</dc:creator>
      <pubDate>Thu, 26 Nov 2026 14:04:34 +0000</pubDate>
      <link>https://dev.to/codenameone/run-an-llm-and-whisper-on-the-phone-with-no-server-bill-d2m</link>
      <guid>https://dev.to/codenameone/run-an-llm-and-whisper-on-the-phone-with-no-server-bill-d2m</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe3yg3c9j1psuou42td9j.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe3yg3c9j1psuou42td9j.jpg" alt="An LLM running on a phone" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most AI features in mobile apps don't need a cloud model, and paying per token for them is a habit, not a requirement. Summarizing a note, tagging a caption, turning a voice memo into text or filling a form from a sentence is work a half billion parameter model does on the phone: offline, with no per request cost, and without sending your user's text to anyone's data center.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Codename One?&lt;/strong&gt; Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at &lt;a href="https://www.codenameone.com/" rel="noopener noreferrer"&gt;codenameone.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Codename One already had a provider neutral &lt;code&gt;LlmClient&lt;/code&gt; for the cloud: OpenAI, Anthropic, Gemini, Ollama and any OpenAI compatible endpoint behind one API. This week it gained a client that runs the model on the phone, and a cn1lib that transcribes speech there too.&lt;/p&gt;

&lt;h2&gt;
  
  
  A local model behind the same API
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;LocalLlmClient&lt;/span&gt; &lt;span class="n"&gt;llm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;LlmClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;local&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FileSystemStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getInstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAppHomePath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"qwen2.5-0.5b-instruct-q4_k_m.gguf"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ChatRequest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ChatMessage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;user&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Name three primes"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;Log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;p&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;LlmClient.local&lt;/code&gt; runs a GGUF model with &lt;a href="https://github.com/ggml-org/llama.cpp" rel="noopener noreferrer"&gt;llama.cpp&lt;/a&gt;. Any instruction-tuned GGUF works without configuration, because the prompt is rendered with the chat template the model file carries. The client supports chat, streaming, and embeddings. &lt;code&gt;ResponseFormat.JSON_OBJECT&lt;/code&gt; is enforced with a grammar, so when you ask for JSON the output always parses, which is something small models are otherwise bad at.&lt;/p&gt;

&lt;p&gt;Because it's the same interface as the cloud clients, the decision of where a feature runs is one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;LlmClient&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;LocalLlmClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isSupported&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nc"&gt;LlmClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;local&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;modelPath&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;LlmClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ollama&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;          &lt;span class="c1"&gt;// desktop development&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBGW1lvdXIgZmVhdHVyZSBjb2RlPGJyLz5DaGF0UmVxdWVzdCwgc3RyZWFtaW5nLCBKU09OXSAtLT4gSXtMbG1DbGllbnR9CiAgICBJIC0tPnxMbG1DbGllbnQubG9jYWx8IExbbGxhbWEuY3BwIG9uIHRoZSBwaG9uZTxici8-TWV0YWwgb24gaU9TXQogICAgSSAtLT58TGxtQ2xpZW50Lm9sbGFtYXwgT1tPbGxhbWEgb24geW91ciBkZXNrdG9wXQogICAgSSAtLT58Y2xvdWQgcHJvdmlkZXJzfCBDW09wZW5BSSwgQW50aHJvcGljLCBHZW1pbmld%3Ftype%3Dpng%26bgColor%3Dffffff" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBGW1lvdXIgZmVhdHVyZSBjb2RlPGJyLz5DaGF0UmVxdWVzdCwgc3RyZWFtaW5nLCBKU09OXSAtLT4gSXtMbG1DbGllbnR9CiAgICBJIC0tPnxMbG1DbGllbnQubG9jYWx8IExbbGxhbWEuY3BwIG9uIHRoZSBwaG9uZTxici8-TWV0YWwgb24gaU9TXQogICAgSSAtLT58TGxtQ2xpZW50Lm9sbGFtYXwgT1tPbGxhbWEgb24geW91ciBkZXNrdG9wXQogICAgSSAtLT58Y2xvdWQgcHJvdmlkZXJzfCBDW09wZW5BSSwgQW50aHJvcGljLCBHZW1pbmld%3Ftype%3Dpng%26bgColor%3Dffffff" alt="Diagram" width="732" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The model loads on the first request, which can take a few seconds for a larger file, and stays in memory until you call &lt;code&gt;close()&lt;/code&gt;. Requests run one at a time on a background thread and the callbacks arrive on the EDT, so you update the UI directly. &lt;code&gt;setContextSize&lt;/code&gt;, &lt;code&gt;setThreads&lt;/code&gt; and &lt;code&gt;setGpuLayers&lt;/code&gt; tune it, and on iOS the GPU layers run on Metal.&lt;/p&gt;

&lt;p&gt;It runs on Android and iOS. In the simulator &lt;code&gt;LlmClient.ollama()&lt;/code&gt; gives you the same API against the same model on your desktop. Tools and image inputs aren't supported by the local client yet, and the request fails with a clear error if you send them.&lt;/p&gt;

&lt;p&gt;Since the callbacks arrive on the EDT, a streaming local reply can feed &lt;code&gt;ChatView&lt;/code&gt;, the chat component from the cloud clients, token by token:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmr3dx85ay0d5d34xe0cu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmr3dx85ay0d5d34xe0cu.png" alt="ChatView showing a streamed conversation" width="800" height="1732"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Speech to text, offline
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;cn1-ai-whisper&lt;/code&gt; cn1lib runs &lt;a href="https://github.com/ggml-org/whisper.cpp" rel="noopener noreferrer"&gt;whisper.cpp&lt;/a&gt; on the device. Give it a ggml whisper model and a 16 kHz mono WAV file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;WhisperRecognizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transcribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;modelPath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;audioPath&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;noteField&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;transcribeSegments&lt;/code&gt; returns the text with millisecond timestamps for each segment, which is what you want for captions or for jumping to a spot in a recording. It runs on Android and iOS, and in the simulator too, so you can develop the feature on your desktop. With the cn1lib present, the general &lt;code&gt;SpeechRecognizer&lt;/code&gt; API uses it in the simulator as well.&lt;/p&gt;

&lt;p&gt;Voice memo to summary is then two calls, both on the device:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;WhisperRecognizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transcribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;whisperModel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;memoWav&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;transcript&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
        &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ChatRequest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ChatMessage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Summarize in one sentence."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ChatMessage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;user&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;transcript&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  You only pay for what you link
&lt;/h2&gt;

&lt;p&gt;Native AI libraries are big, and an app that never calls them shouldn't carry them. The builders link llama.cpp only into apps that call &lt;code&gt;LlmClient.local&lt;/code&gt;, and whisper only into apps that reference the whisper classes. Each library carries a private copy of ggml with its symbols hidden. An app can use both without the two copies colliding.&lt;/p&gt;

&lt;p&gt;The native libraries are built from pinned upstream release tags and published to the Codename One Maven repository as Android AARs for four ABIs and iOS xcframeworks for devices and the simulator. Nothing binary is committed to our repository, and every &lt;code&gt;.so&lt;/code&gt; is linked for 16 KB pages, as Google Play requires.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shipping the model
&lt;/h2&gt;

&lt;p&gt;Models are the part you have to plan. A 0.5 billion parameter model quantized to 4 bits is around 400 MB, and whisper's base model is around 150 MB. Ship it as a download on first use rather than inside the app bundle, keep it in the app's home directory, and pick the smallest model that does the job. For tagging, extraction and short summaries a small model is enough. For open-ended chat, the cloud clients are one line away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn more
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://www.codenameone.com/developer-guide/#ai-and-speech-section" rel="noopener noreferrer"&gt;AI and speech chapter&lt;/a&gt; covers &lt;code&gt;LlmClient&lt;/code&gt;, the providers, streaming, &lt;code&gt;ChatView&lt;/code&gt; and speech, and the &lt;code&gt;LocalLlmClient&lt;/code&gt; javadoc covers the local options. If you build something with a local model, I'd like to hear which model you picked and why.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mobile</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Windows Kiosks and Command Line Tools, Built From Java</title>
      <dc:creator>Shai Almog</dc:creator>
      <pubDate>Wed, 25 Nov 2026 14:18:58 +0000</pubDate>
      <link>https://dev.to/codenameone/windows-kiosks-and-command-line-tools-built-from-java-4mpb</link>
      <guid>https://dev.to/codenameone/windows-kiosks-and-command-line-tools-built-from-java-4mpb</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9uk1x1vag7kxpe72tb1p.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9uk1x1vag7kxpe72tb1p.jpg" alt="A Windows kiosk and a terminal running a Java CLI" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The two kinds of software people least expect to write in Java are the app that owns a panel PC in a shop and the tool you type into a terminal. Both used to be bad fits for the same reason: a JVM to install, seconds of startup, and a runtime that doesn't own the machine. Codename One compiles your Java ahead of time to C and then to one native executable, so both problems go away. This week that covers locked down Windows kiosks and command line tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Codename One?&lt;/strong&gt; Codename One is an open-source framework for building native iOS, Android, desktop, and web apps from a single Java or Kotlin codebase. Learn more at &lt;a href="https://www.codenameone.com/" rel="noopener noreferrer"&gt;codenameone.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Two weeks ago we added &lt;a href="https://www.codenameone.com/blog/embedded-linux-ui-in-18-mb/" rel="noopener noreferrer"&gt;embedded Linux&lt;/a&gt;. Plenty of devices in shops, factories and lobbies run Windows on a panel PC instead, because that's what the hardware vendor shipped and what IT knows how to manage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Kiosks on Windows IoT Enterprise
&lt;/h2&gt;

&lt;p&gt;A kiosk is an app that owns the device. The customer at a self-checkout shouldn't be able to reach the desktop, open a browser or press Alt+F4. On Windows, getting there usually means a native app plus a day of fighting Shell Launcher and Group Policy.&lt;/p&gt;

&lt;p&gt;One build hint turns your app into one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="na"&gt;codename1.arg.windows.embedded&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;codename1.arg.windows.embedded.board&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;imx8&lt;/span&gt;
&lt;span class="na"&gt;codename1.arg.windows.embedded.rotation&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;90&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result is the same native &lt;code&gt;.exe&lt;/code&gt; the native Windows port builds, with no JVM, configured for a device:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A frameless window that covers the monitor and stays on top.&lt;/li&gt;
&lt;li&gt;The Windows key, Alt+Tab, Alt+F4 and Ctrl+Esc are blocked.&lt;/li&gt;
&lt;li&gt;Codename One's own on-screen keyboard instead of the Windows one, so it matches your UI.&lt;/li&gt;
&lt;li&gt;Rotation, density, the target monitor and the cursor set by build hints or environment variables, so one build serves a portrait totem and a landscape counter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Board profiles cover generic x64 with or without a mouse, generic arm64, i.MX 8 and Qualcomm IoT boards. Windows 10 and 11 IoT Enterprise are supported. Windows 10 IoT Core isn't.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deploy over SSH
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mvn cn1:deploy-device -Dcn1.device.host=kiosk.local -Dcn1.device.user=Administrator \
    -Dcn1.device.kioskUser=kiosk -Dcn1.device.keyboardFilter=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That copies the app to the device, configures Shell Launcher so the app replaces the desktop for the kiosk user, and with &lt;code&gt;keyboardFilter=true&lt;/code&gt; also blocks Ctrl+Alt+Del. If the app crashes, Shell Launcher restarts it. &lt;code&gt;mvn cn1:device-logs&lt;/code&gt; follows the log from your machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBEW1lvdXIgbWFjaGluZTxici8-bXZuIGNuMTpkZXBsb3ktZGV2aWNlXSAtLT58U1NIfCBLW1BhbmVsIFBDPGJyLz5XaW5kb3dzIElvVCBFbnRlcnByaXNlXQogICAgSyAtLT4gU0xbU2hlbGwgTGF1bmNoZXI8YnIvPmFwcCByZXBsYWNlcyB0aGUgZGVza3RvcF0KICAgIFNMIC0tPiBBW1lvdXIgYXBwPGJyLz5mdWxsIHNjcmVlbiwga2V5cyBibG9ja2VkXQogICAgQSAtLT58Y3Jhc2h8IFNMCiAgICBBIC0tPiBIW1NlcmlhbCwgR1BJTywgYmFja2xpZ2h0XQogICAgQSAtLT58UkVTVCwgc2hhcmVkIERUT3N8IEJbWW91ciBiYWNrZW5kXQ%3D%3D%3Ftype%3Dpng%26bgColor%3Dffffff" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmermaid.ink%2Fimg%2FZmxvd2NoYXJ0IExSCiAgICBEW1lvdXIgbWFjaGluZTxici8-bXZuIGNuMTpkZXBsb3ktZGV2aWNlXSAtLT58U1NIfCBLW1BhbmVsIFBDPGJyLz5XaW5kb3dzIElvVCBFbnRlcnByaXNlXQogICAgSyAtLT4gU0xbU2hlbGwgTGF1bmNoZXI8YnIvPmFwcCByZXBsYWNlcyB0aGUgZGVza3RvcF0KICAgIFNMIC0tPiBBW1lvdXIgYXBwPGJyLz5mdWxsIHNjcmVlbiwga2V5cyBibG9ja2VkXQogICAgQSAtLT58Y3Jhc2h8IFNMCiAgICBBIC0tPiBIW1NlcmlhbCwgR1BJTywgYmFja2xpZ2h0XQogICAgQSAtLT58UkVTVCwgc2hhcmVkIERUT3N8IEJbWW91ciBiYWNrZW5kXQ%3D%3D%3Ftype%3Dpng%26bgColor%3Dffffff" alt="Diagram" width="1280" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Talking to the hardware
&lt;/h3&gt;

&lt;p&gt;The same &lt;code&gt;com.codename1.hardware&lt;/code&gt; API from the Linux port works on Windows. Every &lt;code&gt;COM&lt;/code&gt; port is available, which covers most receipt printers, scales and card readers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Hardware&lt;/span&gt; &lt;span class="n"&gt;hw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Hardware&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getInstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;SerialPort&lt;/span&gt; &lt;span class="n"&gt;printer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;openSerial&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"COM3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;SerialPort&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PARITY_NONE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;receipt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Thank you!\n"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"UTF-8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;printer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;hw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setBacklightBrightness&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getMaxBacklightBrightness&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// night mode&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GPIO, I2C, SPI and PWM go through the &lt;code&gt;Windows.Devices&lt;/code&gt; APIs, which need a board whose vendor ships the bus drivers. IoT boards do. Most x64 panel PCs don't, and on those the API reports that the feature isn't available rather than failing at run time. The backlight works over DDC/CI or WMI. CAN and a hardware watchdog aren't available, because Windows has no standard interface for either.&lt;/p&gt;

&lt;p&gt;The app on the kiosk shares its entity classes with your backend and your phone app, which is the point of building all of them from one project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Command line tools with real terminal UIs
&lt;/h2&gt;

&lt;p&gt;Most internal tooling is a command line tool: deploy scripts, data migrations, admin utilities. Java has always been an awkward fit for those because of JVM startup and because you need to ship a JVM. Codename One's backend now builds a CLI as one native executable with nothing to install beside it.&lt;/p&gt;

&lt;p&gt;The command line is declared with annotations in the picocli style, and bound at build time with no reflection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"deploy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Deploys a service."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;mixinStandardHelpOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Deploy&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;Callable&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;Integer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;@Option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;names&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"-s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"--service"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Service to deploy"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"api"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Override&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;Integer&lt;/span&gt; &lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// ...&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The new console API draws the output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Service"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Status"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Replicas"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;align&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Table&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Align&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;RIGHT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addRow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"api"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"running"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;GREEN&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addRow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"worker"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"degraded"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;YELLOW&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ProgressBar&lt;/span&gt; &lt;span class="n"&gt;bar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ProgressBar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"upload"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"files"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;upload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;step&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;Spinner&lt;/span&gt; &lt;span class="n"&gt;spinner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Spinner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"waiting for health checks"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;waitForHealthy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;spinner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;succeed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"healthy"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4kch3lw7ub28vrfjgxu8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4kch3lw7ub28vrfjgxu8.png" alt="A table, a progress bar and a spinner in the terminal" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Interactive prompts handle the questions a deployment tool asks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Prompt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Environment"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Arrays&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"staging"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"production"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;regions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Prompt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;multiSelect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Regions"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Arrays&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"us-east"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"eu-west"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nc"&gt;Prompt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;confirm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Deploy to "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;/p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fcli-console-select.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fcli-console-select.png" alt="An arrow key selection prompt in the terminal" width="800" height="182"&gt;&lt;/a&gt;Select with the arrow keys.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fcli-console-prompts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fcli-console-prompts.png" alt="Confirmation, password and number prompts in the terminal" width="800" height="159"&gt;&lt;/a&gt;Confirm, password and number prompts.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fcli-console-progress.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fcli-console-progress.png" alt="Several progress bars running in parallel in the terminal" width="800" height="205"&gt;&lt;/a&gt;Parallel progress.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fcli-console-checkbox.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codenameone.com%2Fdeveloper-guide%2Fimg%2Fcli-console-checkbox.png" alt="A multiple selection prompt with checkboxes" width="800" height="182"&gt;&lt;/a&gt;Multiple selection.&lt;p&gt;&lt;/p&gt;

&lt;p&gt;There's also a &lt;code&gt;Tree&lt;/code&gt;, &lt;code&gt;MultiProgress&lt;/code&gt; for parallel work, &lt;code&gt;LiveRegion&lt;/code&gt; for output that redraws in place, password and number prompts, and raw key reading. &lt;code&gt;Console&lt;/code&gt; knows the terminal's width, whether output is a terminal at all, and how many colors it supports, and it honors &lt;code&gt;NO_COLOR&lt;/code&gt; and &lt;code&gt;CLICOLOR_FORCE&lt;/code&gt;. Pipe the tool into a file and the colors and spinners step aside by themselves.&lt;/p&gt;

&lt;p&gt;It isn't a windowing toolkit with panes. It's the set of pieces that make up nearly every CLI people like to use.&lt;/p&gt;

&lt;p&gt;Build the executable with &lt;code&gt;./mvnw cn1:backend-package&lt;/code&gt;. It compiles to C and then to a native binary for the host machine, which can be Linux or macOS. During development it runs on the JVM like any other backend code, and the &lt;a href="https://www.codenameone.com/initializr/" rel="noopener noreferrer"&gt;Initializr&lt;/a&gt; has a "Command-line tool" project type for Maven and Gradle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn more
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://www.codenameone.com/developer-guide/#_embedded_windows_devices" rel="noopener noreferrer"&gt;embedded Windows chapter&lt;/a&gt; covers board profiles, deployment options and hardware access. The &lt;a href="https://www.codenameone.com/developer-guide/#command-line-applications" rel="noopener noreferrer"&gt;command line chapter&lt;/a&gt; covers commands, options, the console API and packaging. If you're running kiosks on Windows today, I'd like to know what you're using to build them.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mobile</category>
      <category>android</category>
      <category>ios</category>
    </item>
  </channel>
</rss>
