Blog2 min read

Duo 0.2.0 is out

Apps that hear the hardware, notifications, a microphone the sandbox never touches, a dock you arrange by hand, and twenty-five apps rebuilt after Apple’s.

0.1.0 was a folding phone you could build for. 0.2.0, one week later, is one that feels real under your finger.

days since 0.1.0
0
apps rebuilt
0
community apps redesigned
0
device event types
0

Apps can hear the hardware

Until now, apps saw the hinge and nothing else. Now one call hears any button or sensor:

What an app can hearR 11.477.4 × 112.5 mmhingetakenvolumeheardsidetakencamera-controlstateorientationstateswitches
Event
volume
Rule
Taken
Meanwhile
Ringer stays put
Heard
0×
TypeScript
1const off = os.device.on('volume', (e) => {
2 if (e.action === 'press') zoom(e.button === 'up' ? 1 : -1)
3})

The hard part was deciding who wins a press:

  • TakenVolume and Camera Control go to a listening app, not the ringer or the Camera app.
  • Heard, never takenThe side button: no app can stop you locking your phone.
  • StateOrientation and the Control Center switches: the current value, then each change.

Press the volume keys, slide Camera Control, turn the phone, flip a switch:

  1. os.device.on('volume')waiting
  2. os.device.on('camera-control')waiting
  3. os.device.on('side')waiting
  4. os.device.on('orientation')waiting
  5. os.device.on('switches')waiting

Notifications without a permission

One call: a banner for four seconds, then a card on the lock screen. Tap either to open the app with arg.

Posted by
    iPhone Duo, open, on its lock screen

    A microphone the sandbox never touches

    getUserMedia cannot run in an opaque-origin frame, so the shell records and the app gets a blob.

    Voice Memos
    Microphone waveform
    0:00
    1. await os.mic.start()
    2. os.mic.onStatus((s) => meter(s.level))
    3. const take = await os.mic.stop()
    4. await os.files.put('memo.webm', take.blob)
    Elapsed
    0.0 s
    Input
    -
    Size so far
    0.0 KB
    Bitrate
    -

    The dock, arranged by hand

    Hold an icon for half a second and carry it. Every icon moves on transforms only, so a finger that changes its mind retargets smoothly. These are the shell's rules:

    You're on a phone. Safari claims a long press for its own menu, so holding an icon here won't pick it up. Try this one on a computer.

    Maps
    Stocks
    Weather
    Music
    Photos
    Notes
    Clock
    Calendar
    Podcasts
    Voice Memos
    Reading
    Phone
    Safari
    Messages
    Mail
    Hold an icon for half a second, then carry it.

    Twenty-five apps, rebuilt

    One rule for every one: a row is real, or it is not there. So the mocks we could not make honest (YouTube, Watch, the iTunes Store, Find My) are gone, and the rest talk to the real world through keyless services.

    Maps is squares

    Maps draws real OpenStreetMap tiles. It only asks for the tiles under the glass, and a zoom between levels scales them instead of reloading. This runs the app's own code:

    Maps tile grid15/26094/1539615/26094/1539715/26095/1539615/26095/1539715/26096/1539615/26096/15397
    z 15.00
    View zoom
    15.00
    Tiles from
    Level 15
    Tile scale
    × 1.00
    Tiles fetched
    6

    Search is Photon and routes are FOSSGIS OSRM, one server per mode: the public demo quietly routes everything as driving.

    Stocks invents nothing

    Quotes from CNBC, daily closes from stockanalysis.com, crypto candles from Coinbase. Where no free feed exists, the chart stays empty:

    -After hours
    Socket lag
    -
    Volume 24h
    -
    5m candles

    Community apps

    All eight redesigned with fold sync. The UI kit reached 1.2 with Menu, Sheet, Segmented, TextField and more; the site gained /apps and /kit.

    Get it

    0.2.0 is live at duo.doan-labs.com. Everything else is in the changelog and the hardware docs.