First-Party Packages

Copy Markdown View Source

Mob is fully featured — but since 0.7.0 the capabilities live in focused packages rather than one monolithic core. Core ships the kernel every app needs (screens, navigation, rendering, state, storage, permissions, distribution, the test harness, and the neutral light/dark/adaptive themes); everything else is one dep + one config line away.

Activating a capability plugin takes a dep and a config line:

# mix.exs
{:mob_camera, "~> 0.1"}

# mob.exs
config :mob, :plugins, [:mob_camera]

Every plugin with a manifest (priv/mob_plugin.exs) is checked at build time: first-party ones are signed in release CI (mob_webrtc with its own key, the rest with the shared first-party key), and the build refuses an activated plugin that isn't trusted in config :mob, :trusted_plugins. Apps generated by mix mob.new from mob_new 0.6.24 on pre-trust every signed first-party plugin in that map (mob_deliver with --deliver). In an app generated earlier, and for any third-party plugin, run mix mob.plugin.trust <name> once.

A plugin's native code reaches the device only through a native build (mix mob.deploy --native in development); a plain mix mob.deploy pushes BEAMs only. A few packages activate differently; their Notes say how.

Style packages use the styles lane instead:

config :mob, :styles, [:mob_themes]
config :mob, :default_style, :mob_themes

Capability plugins

The core loop — screens, navigation, state, storage, the neutral theme, distribution — is in mob itself. Everything below is opt-in.

Device I/O

PackageGives youNotes
mob_cameraPhoto/video capture, headless stills (MobCamera.snap/1), a hardware-encoded H264 video stream, live preview and frame streamingThe <CameraPreview> view node is in core: on iOS pair it with MobCamera.start_preview/2; on Android it binds CameraX itself. Frame streaming delivers on iOS only for now (on Android start_frame_stream/2 succeeds but no frame arrives). MobCamera.PreviewView with start_video_stream/1 shows the camera on both
mob_photosThe system photo/video picker (MobPhotos.pick/2), library listing with metadata (list_media/2), thumbnails (thumbnail/2), and saving into the library (save/3)The picker runs out of process and needs no runtime permission; listing and thumbnails of library items need :media, saving needs :media_save
mob_videoOn-device video clip / probe / thumbnail / extract-audioNo ffmpeg; uses AVFoundation on iOS and MediaCodec on Android
mob_mediaMedia file helpers through the platform decoders: MobMedia.info/2, the audio track as 16 kHz mono PCM (audio_pcm/2, the format MobWhisper.transcribe/2 takes), and one video frame as a JPEG (frame/3)Android MediaExtractor / MediaCodec, iOS AVFoundation. No ffmpeg and no runtime permission; takes a local file path
mob_locationGPS/network location — one-shot + continuous
mob_sensorsEvery phone sensor: MobSensors.list/0, one-shot read/2, streaming start/2 / stop/1, step history steps/2. Includes barometer, proximity, light, humidity, temperature, step counter and vendor sensorsAndroid lists every SensorManager sensor. iOS covers CoreMotion, CMAltimeter, CMPedometer and proximity, with no ambient light. Step sensors need :activity_recognition. For accelerometer/gyro/heading in core, see Mob.Motion
mob_biometricFace ID / Touch ID / fingerprint authiOS + Android both green (Android now via platform BiometricPrompt on ComponentActivity)
mob_scannerQR / barcode scanning (full-screen scanner)Also activate mob_camera (it owns the :camera permission)
mob_bluetoothBluetooth Classic discovery, pairing, HFP and SPP (Android only); a BLE GATT peripheral (MobBluetooth.Le: advertise, notify, receive writes) on both platformsClassic calls return {:error, :unsupported} on iOS (Apple gates Classic behind MFi). BLE scanning (MobBluetooth.ble_scan/2) is iOS-only, and there is no BLE central connect yet. Verified on both Moto G Power + iPhone
mob_midiMIDI in + out (over USB, Bluetooth LE MIDI, and app-to-app)
mob_audio_ioLow-latency audio output, input and duplex streams (AAudio on Android, RemoteIO / VoiceProcessingIO on iOS) that call your own C DSP on the audio thread, plus audio device lists and file decodingFor your own DSP, also register its NIF with config :mob_dev, static_nifs: [%{module: :my_dsp, archs: [:all]}]; the C interface is priv/include/mob_audio_io.h. Needs mob 0.9.31+. Input needs the :microphone permission
mob_touchRaw touch stream, observe-without-consumeUseful for gesture prototyping / analytics without owning the UI event flow
mob_screencastThe device's own screen as an on-device-encoded H264 streamFor remote viewing / WebRTC; max_size is Android-only today
mob_speechSpeech-to-text: MobSpeech.listen/2, stop/1, cancel/1, with {:speech, :state | :partial | :final | :error, …} events and a pluggable engineThe default engine is the platform recognizer (Android SpeechRecognizer, iOS SFSpeechRecognizer); pair with mob_whisper for offline recognition. Text-to-speech stays in core (Mob.Speech).
mob_whisperOffline speech-to-text on the device: whisper.cpp as a mob_speech engine (engine: MobWhisper)No Google/Apple speech service needed. The model (base_en default, tiny_en option, ~60 MB) downloads once with a SHA-256 check; MobWhisper.prefetch/0 fetches it ahead of time. Verified on a Moto G 2021; iOS builds but hasn't run on a device.
mob_nfcNFC: read and write NDEF tags, read raw tag UIDs, emulate a tag (Android HCE)iOS via CoreNFC, Android via NfcAdapter. Tag emulation is Android-only. Device-verified on iPhone SE 3rd gen and Moto G Power 5G 2024.
mob_audio_captureGlobal device-audio capture: meters audio that other apps or native players produce (Android MediaProjection / AudioPlaybackCapture)A test-environment probe for audio the in-app Mob.Audio probes can't reach. Android only; iOS has no API for this and returns {:error, :unsupported_on_platform}.

Messaging + wake

PackageGives youNotes
mob_smsSystem SMS composer pre-filled with recipient + bodyMobSms.compose/2 on both platforms. iOS observes send / cancel via the MessageUI delegate; Android hands off to the user's SMS app (outcome unobservable — see the plugin's per-platform-delivery docs). No permissions on either platform.
mob_notifyLocal notification scheduling + push token registration (device-side)Two ends of the same wire as mob_push (server-side); delivery into handle_info is core behaviour. See Push notifications.
mob_wakeOS-triggered background execution (device-side) — iOS BGTaskScheduler + silent APNs, Android WorkManager + FCM data messagesFor episodic work fired by the OS or a silent push (server-side push via mob_push using MobWake.wake_payload/2). Foreground + backgrounded verified end-to-end on Moto G Power 5G 2024 + iPhone SE 3rd-gen (MOB-268 / MOB-271); force-quit drop is intentional platform behaviour on both OSes.
mob_backgroundKeep-alive execution while backgrounded — iOS silent-audio session, Android foreground serviceFor continuous work (music, upload, walk tracker) that the user has explicitly kicked off. Not the same as mob_wake — mob_background keeps a process alive while backgrounded; mob_wake wakes a specific handler on an OS event. They stack. See Background execution.

Connectivity

PackageGives youNotes
mob_webrtcWebRTC calls: peer connections (ex_webrtc on the device's BEAM), Opus audio, H264 video decoded into MobWebrtc.video_view/1, and data channelsActivate it with mob_audio_io (config :mob, :plugins, [:mob_webrtc, :mob_audio_io]) and register ex_sctp's NIF: config :mob_dev, static_nifs: [%{module: :ex_sctp, init: "nif_init", archs: [:all]}]. Needs mob_dev 0.7.33+ and Rust with the mobile targets. Outgoing video is RTP you supply, e.g. mob_screencast's H264
mob_pair (not on Hex yet)Pairing and Erlang distribution between sibling Mob apps, on one phone or across Wi-Fi: QR link or typed code (SRP-6a), pinned mutual TLS 1.3, per-peer cookies, mDNSA pure Elixir library, not a plugin: no mob dependency and nothing to activate; depend on a GitHub commit

System services

PackageGives youNotes
mob_secure_storeSmall secrets (tokens, API keys): MobSecureStore.put/2, get/1, delete/1, kept in the iOS Keychain or in Android EncryptedSharedPreferences under a Keystore master keyOn the host each value is a 0600 file. On a phone built without the NIF it stores nothing and answers {:error, :secure_store_unavailable} rather than fall back to files. The iOS simulator needs a Keychain entitlement in the app (see its README)
mob_printThe system print dialog for a PDF file: MobPrint.pdf/2 (Android PrintManager, iOS UIPrintInteractionController):ok means the dialog was requested; there is no completion callback. PDF only, foreground only, no permissions

ML

PackageGives youNotes
mob_nx_eigenOn-device Nx backend backed by Eigen — the header-only C++ linear-algebra library, NEON-vectorised on ARM. Always-available CPU baseline for on-device numerics — needs no GPU, runs anywhere mob runs.Makes NxEigen.Backend the global Nx backend at boot, falling back to Nx.BinaryBackend when the NIF can't load (as on an x86_64 Android emulator). Its self-test passes on an iOS simulator and an arm64 Android emulator.
mob_visionOn-device OCR: recognize text in a still image fileiOS Vision (VNRecognizeTextRequest), Android ML Kit text recognition (bundled Latin model). No network and no runtime permission. Pairs with mob_camera / mob_photos for the image. Face and pose detection are planned.
nx_tflite_mobTensorFlow Lite from the BEAM with vendor accelerators: Apple Neural Engine on iOS, MediaTek/Qualcomm GPU and NPU HALs on AndroidInstall with mix mob.enable tflite (mob_dev), not config :mob, :plugins: it adds the dep and registers the static NIF. Runs pre-compiled .tflite models; it is not an Nx backend.

3D + physics

PackageGives youNotes
mob_scene3dDeclarative 3D scenes: one scene IR, diffed and patched over a NIF wire, rendered by FilamentWorking on both platforms (Metal on iOS, Vulkan/GLES on Android).
mob_rapier3D rigid-body physics: Rapier as a Rustler NIF, with a named-world registry and face-up decode rules for diceNot activated via config :mob, :plugins: register the NIF in mob.exs with config :mob_dev, static_nifs: [%{module: :lab_physics, archs: [:all]}] and set config :mob_rapier, :otp_app, :my_app (see its README). Physics only; render with mob_scene3d or your own view.

Delivery

PackageGives youNotes
mob_deliverContent-addressed BEAM delivery: signed over-the-air updates and just-in-time screen deliverySignature-verified, hot-loaded module by module. Server side is mob_deliver_server (below).

Style packages

PackageGives you
mob_themesFive preset looks — Obsidian (default), ObsidianGlass, Citrus, Birch, Material3. Switch live with Mob.Theme.set(MobThemes.Citrus)

Component kits

PackageGives youNotes
mob_mishkaMishka Chelekom composites for Mob apps — dialogs, tabs, accordions, hue / alpha / range / angle sliders, semi-circle progress, JSON input, and moreShipped as a proper Hex plugin (replaces the pre-mob_new 0.6 vendoring pattern). Reads Mob's theme tokens (see Theming), so switching Mob.Theme.set/1 re-skins every composite at once, identically on both platforms. mix mob_mishka.gen <name> ejects a specific composite into your lib/<app>/components/ for editing with config :mob_mishka, :override_namespace, MyApp.Components. mix mob_mishka.migrate converts pre-plugin vendored apps in one pass. Design system upstream: mishka-group/mishka_chelekom (Shahryar Tavakkoli / @shahryarjb).
mob_markdown (not on Hex yet)Native Markdown views: MobMarkdown.view/3 draws CommonMark plus GitHub tables and strikethrough in the platform's selectable text view (Markwon on Android, Foundation's Markdown parser on iOS)Depend on a GitHub commit. Until it's released it is unsigned, so also list it in config :mob, :acknowledge_unsafe_plugins. Needs mob_dev 0.7.29+

Framework integrations

PackageGives you
mob_ashDeclare Ash resources, get generated list/detail/create screens per resource — Ash runs on-device

Server-side companions

PackageGives you
mob_pushAPNs + FCM push sending from your Elixir server (no mob dependency — works for any app)
mob_deliver_serverReference server for mob_deliver: compiles a Phoenix project's mobile/ tree into content-addressed BEAMs, signs the manifest, and serves it from a Plug

Choosing plugins for an app

The catalog is deliberately un-monolithic — you pay for what you activate. Some pairing hints:

  • Verification / OTP flow. mob_sms + the built-in text-field text_content_type: :one_time_code prop (mob 0.9.1+) covers iOS QuickType autofill; mob_sms's MobSms.OneTimeCode.arm/2 covers Android via Google Play Services' SMS Retriever. Same shape on both platforms, no READ_SMS permission on Android.
  • Camera-centric app. mob_camera for capture + preview, mob_scanner if you want QR/barcode as its own screen (activate mob_camera alongside it; it owns :camera), mob_photos for picking existing images from the library. mob_video for on-device editing.
  • Sensor / peripheral app. mob_bluetooth for BLE + BR/EDR, mob_midi for musical instruments, mob_location for GPS, mob_sensors for barometer, proximity, light, steps and every other phone sensor, mob_touch if you need the raw touch stream.
  • Background sync. mob_notify for local reminders, mob_wake for OS-triggered handlers (scheduler firings + silent-push receive), mob_background for continuous keep-alive while the app is backgrounded. Three distinct concerns — see each plugin's moduledoc for the "which one do I want" table.
  • Design system. mob_mishka gives you the Mishka composites; mob_themes gives you five preset visual looks that all composites read from.
  • Push notifications end-to-end. mob_notify on the client (register for pushes, receive them) + mob_push on your server (send APNs / FCM).

Building your own

  • Pure-Elixir UI kits: function composites work with a plain Hex dep, and tag-name composites via Mob.Composite — see the Components guide.
  • Anything deeper: mix mob.new_plugin --tier 0|1|2|3|4 scaffolds a plugin with tests; the Plugins guide and the manifest reference cover the rest.
  • If your plugin will fill an obvious gap in the first-party catalog above, reach out — happy to review, credit, and potentially adopt it into first-party status once it stabilises.