Android Phones
Divooka Compute Standard runs a document on an Android phone as easily as on the computer, and publishes it as an app to install there: a small native app whenever it can, or one that carries .NET. A program for a phone uses the phone itself - its sensors, its vibration, its camera, its notifications, a screen of Android's own views - through nodes made for it.
Connecting a phone
Connect the phone by cable, unlock it, and allow USB debugging in its developer options; the first time, the phone asks Allow USB debugging? for this computer. The run target list, left of the Interpreted / Compiled switch, then lists the phone by its model - SM-S921W - beside Divooka Editor and Standalone process. A phone another program has open reads In use by another program, and one not paired for wireless debugging says how: In the Terminal, run mad pair with the code from the device's Wireless debugging.
Running on the phone
Choose the phone and press F5. Divooka Compute builds the program, puts Divooka Runner on the phone - or offers to Update it - and runs the program there, each step on the status line with its turning circle. The program's console is in Compute's dock, as for any run, and on the phone in Divooka Runner: what it prints appears in both, a line can be typed on either, and the phone keeps its own line editing. Pinch and spread on the phone to size the letters. A run ends Hello Phone finished on SM-S921W in 7 ms, the time being the program's own on the phone.
Press F5 again with nothing changed and the phone runs what it already holds, with no build. Stop, Shift+F5 and Ctrl+C stop the program on the phone first - its screens close and its loops end - and leave Divooka Runner open for the next run; only a program that has not ended about a second later has the runner closed. If the cable comes out, the run fails - The runner on the device closed its connection before the program ended. - and the runner lets the program go within three seconds and waits for Divooka Compute; at the next F5, a program the runner still holds is ended first (Ending the earlier run on SM-S921W…). If even that is refused, close Divooka Runner on the phone and run again.
A node only a phone has wears a mark, and on the computer says Not available on Windows: Android only: run on the computer, a document that uses one is refused, naming the node.
The Android Apps workload
Make a document from the Android Apps workload on the Choose a workload card. The card lists Blank and General Purpose first and every other workload after them alphabetically, by the name it shows in the editor's language: Android Apps is third in English, straight after those two, and last in Chinese, where Latin letters sort after characters. Typing android narrows the list to it. The document references two toolboxes:
- Android - 75 nodes in eleven categories: Device, Sensors, Location, Notifications, Vibration and Sound, Speech, Dialogs, Files and Pictures, Settings, Sharing, and Android API by name, which reaches anything else Android has by its own names. A program's permissions follow what it calls: a program that reads the location asks for it, and one that never touches the network does not ask for it.
- Android Views - 44 nodes that build a screen of Android's own views, in Layouts, View Properties, Text, Buttons and Choices, Values, Pictures, Lists and Screens. They are named as Android names them, with spaces - Text View, Edit Text, Seek Bar, Spinner, Linear Layout - and found by everyday words too: search
sliderfor Seek Bar,dropdownfor Spinner.
A screen of views
A screen is built in a Routine: make a Linear Layout, the views it holds - an Edit Text, a Button, a Text View - and Add View to put each in the layout, then Show Screen, which shows it and runs its events until the person presses Back. A button's Click is a Routine of the document, given what the person did, and events run one at a time on the program's thread; Close Screen and Run Later complete the set. The same nodes run in Divooka Runner on F5 and in a published app.
Publishing an app
Press Publish and choose Android under Platform. The app is written into the folder you choose as an .apk to install and an .aab for a store, signed with a key Divooka Compute keeps for you:
- Whenever every node of the program can be compiled for Android without .NET, the app is native: a few hundred kilobytes - Published 16 Greeting: 16 Greeting.apk and 16 Greeting.aab, signed by …, 0.4 MB - built in about twenty seconds.
- Otherwise it carries the .NET runtime, about 100 MB, and the last line names the node that needs it - 'IEEE Remainder' needs the .NET runtime, so the app carries it. A program that shows one of the document's own pictures is published this way for now; a native app shows a picture's file, such as Take Photo or Choose Picture gives.

Install on phone, in the Publish tab's header and at the card's lower left, installs the app just published on the connected phone, asking before it replaces one already there, and opens it. With no phone connected it says No Android device is connected. Connect a phone with USB debugging on, and install again. A published app's console is readable and pinches to size, and a program stopped on the phone says Stopped.
mad in the terminal
Every session of the terminal finds mad, the tool that builds, signs and installs Android apps and talks to a phone, signing with Publish's key. mad devices lists the phones, mad install followed by an .apk installs one, mad logcat --dump prints the phone's log, and mad dump manifest followed by an .apk shows what it asks for. mad version says which mad it is.
Examples
Android in New from examples holds sixteen, simplest first: 01 Hello Phone, which reads the phone's name, shows a dialog, vibrates and says goodbye; the sensors, the location, notifications and speech in between; 11 To Do, a screen of real views, a list kept between launches; 15 Any of Android, which reaches the phone through Android's own names; and 16 Greeting, a screen with a field and a button. Every one of them publishes as a native app.