@mindroid/plugin-basic
v0.3.0
Published
Mindroid plugin set for core Android capabilities
Maintainers
Readme
@mindroid/plugin-basic
Mindroid plugin set for core Android capabilities — camera, location, sensors, notifications, contacts, Bluetooth, NFC, biometrics, background services, SMS, media, call log, calendar, dialer, clipboard, vibration, and system.
Tip: Install
@mindroid/sdkto get all plugins in a single package.
Install
npm install @mindroid/core @mindroid/plugin-basicCapabilities
| Factory | Capabilities | Requires Permission |
|---------|-------------|---------------------|
| createCameraPlugin() | camera.capture | CAMERA |
| createLocationPlugin() | location.gps | ACCESS_FINE_LOCATION |
| createSensorPlugin() | sensor.accelerometer, sensor.gyroscope | — |
| createNotificationPlugin() | notification.local, notification.push | — |
| createContactsPlugin() | contacts.read, contacts.write | READ_CONTACTS, WRITE_CONTACTS |
| createBluetoothPlugin() | bluetooth.scan, bluetooth.connect | — |
| createNfcPlugin() | nfc.read, nfc.write | — |
| createBiometricPlugin() | biometrics.authenticate | USE_BIOMETRIC |
| createBackgroundPlugin() | background.service | — |
| createSmsPlugin() | sms.send, sms.read | SEND_SMS, READ_SMS ⚠️ sensitive |
| createMediaPlugin() | media.audio, media.video | — |
| createCallLogPlugin() | calllog.read, calllog.write | READ_CALL_LOG, WRITE_CALL_LOG ⚠️ sensitive |
| createCalendarPlugin() | calendar.read, calendar.write | READ_CALENDAR, WRITE_CALENDAR |
| createDialerPlugin() | dialer.dial, dialer.call | CALL_PHONE (for direct call) |
| createClipboardPlugin() | clipboard.read, clipboard.write | — |
| createVibrationPlugin() | vibration.haptics | VIBRATE (auto-granted) |
| createSystemPlugin() | system.battery, system.display, system.audio | — |
⚠️ SMS and contacts plugins are marked sensitive. A release or AAB build will fail unless
policy.allowSensitiveModulesandpolicy.playStoreDisclosureConfirmedare bothtrueinmindroid.config.json.
Usage
import { createRuntime, MockBridge } from "@mindroid/core";
import { createCameraPlugin, createLocationPlugin } from "@mindroid/plugin-basic";
const bridge = new MockBridge({ "permissions.ensure": "granted" });
const camera = createCameraPlugin();
const location = createLocationPlugin();
const runtime = createRuntime(bridge, camera, location);
// Permission is checked automatically before the bridge call
const photo = await camera.api().takePhoto();
const pos = await location.api().getCurrentPosition();Links
- @mindroid/sdk — all-in-one install
- Mindroid monorepo
