Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ android {

apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-community-bluetooth-le')
implementation project(':capacitor-community-safe-area')
implementation project(':capacitor-filesystem')
implementation project(':microbit-capacitor-community-nordic-dfu')

}

Expand Down
23 changes: 21 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
Expand Down Expand Up @@ -29,7 +30,25 @@
</provider>
</application>

<!-- Permissions -->
<!-- BLE Hardware Features -->
<!-- Restricts app visibility in Google Play Store to devices with BLE support -->
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />

<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />

<!-- Location permissions for BLE scanning on Android < 12 only -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />

<!-- BLE permissions for Android 12+ (API 31+) -->
<!-- neverForLocation flag indicates we don't use BLE scan results for physical location -->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation"
tools:targetApi="s" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

<!-- Foreground service permission for Nordic DFU library -->
<!-- Note: Android 14+ (API 34+) requires specifying a foreground service type if using foreground services -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
</manifest>
9 changes: 9 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,14 @@
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')

include ':capacitor-community-bluetooth-le'
project(':capacitor-community-bluetooth-le').projectDir = new File('../node_modules/@capacitor-community/bluetooth-le/android')

include ':capacitor-community-safe-area'
project(':capacitor-community-safe-area').projectDir = new File('../node_modules/@capacitor-community/safe-area/android')

include ':capacitor-filesystem'
project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android')

include ':microbit-capacitor-community-nordic-dfu'
project(':microbit-capacitor-community-nordic-dfu').projectDir = new File('../node_modules/@microbit/capacitor-community-nordic-dfu/android')
29 changes: 23 additions & 6 deletions capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
import type { CapacitorConfig } from '@capacitor/cli';
import type { CapacitorConfig } from "@capacitor/cli";
import { networkInterfaces } from "os";

const config: CapacitorConfig = {
appId: 'org.microbit.createai',
appName: 'micro:bit CreateAI',
webDir: 'dist',
appId: "org.microbit.createai",
appName: "micro:bit CreateAI",
webDir: "dist",
android: {
adjustMarginsForEdgeToEdge: 'disable'
}
adjustMarginsForEdgeToEdge: "disable",
},
};

function getIP() {
const nets = networkInterfaces();
for (const name of Object.keys(nets)) {
for (const net of nets[name]) {
if (net.family === "IPv4" && !net.internal) {
return net.address;
}
}
}
throw new Error("Could not guess Vite server IP");
}

if (process.env.CAP_LOCAL_DEV) {
config.server = { url: `http://${getIP()}:5173`, cleartext: true };
}

export default config;
6 changes: 6 additions & 0 deletions ios/App/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>This app uses Bluetooth to connect to and communicate with your micro:bit.</string>
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
</array>
<key>CFBundleDisplayName</key>
<string>CreateAI</string>
<key>CFBundleExecutable</key>
Expand Down
3 changes: 3 additions & 0 deletions ios/App/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ install! 'cocoapods', :disable_input_output_paths => true
def capacitor_pods
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCommunityBluetoothLe', :path => '../../node_modules/@capacitor-community/bluetooth-le'
pod 'CapacitorCommunitySafeArea', :path => '../../node_modules/@capacitor-community/safe-area'
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
pod 'MicrobitCapacitorCommunityNordicDfu', :path => '../../node_modules/@microbit/capacitor-community-nordic-dfu'
end

target 'App' do
Expand Down
35 changes: 34 additions & 1 deletion ios/App/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,28 +1,61 @@
PODS:
- Capacitor (7.4.4):
- CapacitorCordova
- CapacitorCommunityBluetoothLe (7.3.0):
- Capacitor
- CapacitorCommunitySafeArea (7.0.0-beta.5):
- Capacitor
- CapacitorCordova (7.4.4)
- CapacitorFilesystem (7.1.5):
- Capacitor
- IONFilesystemLib (~> 1.0.1)
- IONFilesystemLib (1.0.1)
- MicrobitCapacitorCommunityNordicDfu (7.0.0-microbit.3):
- Capacitor
- NordicDFU (~> 4.16.0)
- NordicDFU (4.16.0):
- ZIPFoundation (= 0.9.19)
- ZIPFoundation (0.9.19)

DEPENDENCIES:
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
- "CapacitorCommunityBluetoothLe (from `../../node_modules/@capacitor-community/bluetooth-le`)"
- "CapacitorCommunitySafeArea (from `../../node_modules/@capacitor-community/safe-area`)"
- "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
- "CapacitorFilesystem (from `../../node_modules/@capacitor/filesystem`)"
- "MicrobitCapacitorCommunityNordicDfu (from `../../node_modules/@microbit/capacitor-community-nordic-dfu`)"

SPEC REPOS:
trunk:
- IONFilesystemLib
- NordicDFU
- ZIPFoundation

EXTERNAL SOURCES:
Capacitor:
:path: "../../node_modules/@capacitor/ios"
CapacitorCommunityBluetoothLe:
:path: "../../node_modules/@capacitor-community/bluetooth-le"
CapacitorCommunitySafeArea:
:path: "../../node_modules/@capacitor-community/safe-area"
CapacitorCordova:
:path: "../../node_modules/@capacitor/ios"
CapacitorFilesystem:
:path: "../../node_modules/@capacitor/filesystem"
MicrobitCapacitorCommunityNordicDfu:
:path: "../../node_modules/@microbit/capacitor-community-nordic-dfu"

SPEC CHECKSUMS:
Capacitor: 09d9ff8e9618e8c4b3cab2bbee34a17215dd2fef
CapacitorCommunityBluetoothLe: dd86d538624119307c46f5c67f0aa1930198e995
CapacitorCommunitySafeArea: 9d1d82a77c056101a7e0b808de3eb39ef1431df4
CapacitorCordova: bf648a636f3c153f652d312ae145fb508b6ffced
CapacitorFilesystem: 2caf7ad6e26d68defef0631b0f09adb09a353f27
IONFilesystemLib: 89258b8e3e85465da93127d25d7ce37f977e8a6f
MicrobitCapacitorCommunityNordicDfu: b7d5532fff6f36c4a202ccda3be8d835c2523eb9
NordicDFU: 116a4ec458945889f8e0e71759e03b23c39c3482
ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c

PODFILE CHECKSUM: b14023669789a78b7a53c7515766b1a886b64d37
PODFILE CHECKSUM: c99931faff9d0b8213b7a556796098549de867e5

COCOAPODS: 1.15.2
24 changes: 24 additions & 0 deletions lang/ui.ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@
"defaultMessage": "Cable micro USB",
"description": "Label for cable icon in list of requirements"
},
"connect-native-start-heading": {
"defaultMessage": "What you need to connect",
"description": "Connection dialog heading"
},
"connect-native-start-requirements1": {
"defaultMessage": "micro:bit with battery pack",
"description": "Label for image of a micro:bit and battery pack"
},
"connect-or-import": {
"defaultMessage": "<link1>Connecta una micro:bit de recollida de dades</link1> o <link2>importa mostres de dades</link2>",
"description": "Empty data samples page text"
Expand Down Expand Up @@ -355,6 +363,10 @@
"defaultMessage": "Connecta't mitjançant Web Bluetooth",
"description": "Link to alternative connection method"
},
"connect-tablet": {
"defaultMessage": "iPad or Android tablet",
"description": "Label for image of a tablet with a superimposed bluetooth icon"
},
"connect-to-record": {
"defaultMessage": "Connecta't per registrar mostres de dades",
"description": "Live graph disconnected micro:bit status message for data samples page"
Expand Down Expand Up @@ -383,6 +395,10 @@
"defaultMessage": "amb piles",
"description": "Under header 'Battery holder' this notes that batteries are required"
},
"connect-with-bluetooth": {
"defaultMessage": "with Bluetooth enabled",
"description": "Subtitle for tablet image with Bluetooth icon"
},
"connect-with-web-bluetooth": {
"defaultMessage": "Connecta amb Web Bluetooth",
"description": "Connection dialog title"
Expand Down Expand Up @@ -1447,6 +1463,14 @@
"defaultMessage": "Torna a carregar",
"description": "Reload button text"
},
"reset-to-bluetooth-mode-heading": {
"defaultMessage": "Reset to Bluetooth mode",
"description": "Title for dialog with instructures on using "
},
"reset-to-bluetooth-mode-subtitle": {
"defaultMessage": "Press RESET three times",
"description": "Instructions to press the physical reset button on the micro:bit"
},
"reset-to-default-action": {
"defaultMessage": "Restableix els blocs predeterminats",
"description": "Reset to default blocks button text"
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@
"defaultMessage": "Micro USB cable",
"description": "Label for cable icon in list of requirements"
},
"connect-native-start-heading": {
"defaultMessage": "What you need to connect",
"description": "Connection dialog heading"
},
"connect-native-start-requirements1": {
"defaultMessage": "micro:bit with battery pack",
"description": "Label for image of a micro:bit and battery pack"
},
"connect-or-import": {
"defaultMessage": "<link1>Connect a data collection micro:bit</link1> or <link2>import data samples</link2>",
"description": "Empty data samples page text"
Expand Down Expand Up @@ -355,6 +363,10 @@
"defaultMessage": "Connect using Web Bluetooth instead",
"description": "Link to alternative connection method"
},
"connect-tablet": {
"defaultMessage": "iPad or Android tablet",
"description": "Label for image of a tablet with a superimposed bluetooth icon"
},
"connect-to-record": {
"defaultMessage": "Connect to record data samples",
"description": "Live graph disconnected micro:bit status message for data samples page"
Expand Down Expand Up @@ -383,6 +395,10 @@
"defaultMessage": "with batteries",
"description": "Under header 'Battery holder' this notes that batteries are required"
},
"connect-with-bluetooth": {
"defaultMessage": "with Bluetooth enabled",
"description": "Subtitle for tablet image with Bluetooth icon"
},
"connect-with-web-bluetooth": {
"defaultMessage": "Connect with Web Bluetooth",
"description": "Connection dialog title"
Expand Down Expand Up @@ -1447,6 +1463,14 @@
"defaultMessage": "Reload",
"description": "Reload button text"
},
"reset-to-bluetooth-mode-heading": {
"defaultMessage": "Reset to Bluetooth mode",
"description": "Title for dialog with instructures on using "
},
"reset-to-bluetooth-mode-subtitle": {
"defaultMessage": "Press RESET three times",
"description": "Instructions to press the physical reset button on the micro:bit"
},
"reset-to-default-action": {
"defaultMessage": "Reset to default blocks",
"description": "Reset to default blocks button text"
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.es-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@
"defaultMessage": "Cable micro USB",
"description": "Label for cable icon in list of requirements"
},
"connect-native-start-heading": {
"defaultMessage": "What you need to connect",
"description": "Connection dialog heading"
},
"connect-native-start-requirements1": {
"defaultMessage": "micro:bit with battery pack",
"description": "Label for image of a micro:bit and battery pack"
},
"connect-or-import": {
"defaultMessage": "<link1>Conecta una colección de datos de micro:bit</link1> o <link2>importa muestras de datos</link2>",
"description": "Empty data samples page text"
Expand Down Expand Up @@ -355,6 +363,10 @@
"defaultMessage": "Conéctate utilizando Web Bluetooth en su lugar",
"description": "Link to alternative connection method"
},
"connect-tablet": {
"defaultMessage": "iPad or Android tablet",
"description": "Label for image of a tablet with a superimposed bluetooth icon"
},
"connect-to-record": {
"defaultMessage": "Conecta para grabar muestras de datos",
"description": "Live graph disconnected micro:bit status message for data samples page"
Expand Down Expand Up @@ -383,6 +395,10 @@
"defaultMessage": "con pilas",
"description": "Under header 'Battery holder' this notes that batteries are required"
},
"connect-with-bluetooth": {
"defaultMessage": "with Bluetooth enabled",
"description": "Subtitle for tablet image with Bluetooth icon"
},
"connect-with-web-bluetooth": {
"defaultMessage": "Conectar con Web Bluetooth",
"description": "Connection dialog title"
Expand Down Expand Up @@ -1447,6 +1463,14 @@
"defaultMessage": "Recargar",
"description": "Reload button text"
},
"reset-to-bluetooth-mode-heading": {
"defaultMessage": "Reset to Bluetooth mode",
"description": "Title for dialog with instructures on using "
},
"reset-to-bluetooth-mode-subtitle": {
"defaultMessage": "Press RESET three times",
"description": "Instructions to press the physical reset button on the micro:bit"
},
"reset-to-default-action": {
"defaultMessage": "Restablecer bloques por defecto",
"description": "Reset to default blocks button text"
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@
"defaultMessage": "Câble Micro USB",
"description": "Label for cable icon in list of requirements"
},
"connect-native-start-heading": {
"defaultMessage": "What you need to connect",
"description": "Connection dialog heading"
},
"connect-native-start-requirements1": {
"defaultMessage": "micro:bit with battery pack",
"description": "Label for image of a micro:bit and battery pack"
},
"connect-or-import": {
"defaultMessage": "<link1>Connecter un micro:bit de collecte de données</link1> ou <link2>importer des échantillons de données</link2>",
"description": "Empty data samples page text"
Expand Down Expand Up @@ -355,6 +363,10 @@
"defaultMessage": "Se connecter en utilisant Web Bluetooth à la place",
"description": "Link to alternative connection method"
},
"connect-tablet": {
"defaultMessage": "iPad or Android tablet",
"description": "Label for image of a tablet with a superimposed bluetooth icon"
},
"connect-to-record": {
"defaultMessage": "Se connecter aux échantillons de données d'enregistrement",
"description": "Live graph disconnected micro:bit status message for data samples page"
Expand Down Expand Up @@ -383,6 +395,10 @@
"defaultMessage": "avec des piles",
"description": "Under header 'Battery holder' this notes that batteries are required"
},
"connect-with-bluetooth": {
"defaultMessage": "with Bluetooth enabled",
"description": "Subtitle for tablet image with Bluetooth icon"
},
"connect-with-web-bluetooth": {
"defaultMessage": "Se connecter avec Web Bluetooth",
"description": "Connection dialog title"
Expand Down Expand Up @@ -1447,6 +1463,14 @@
"defaultMessage": "Recharger",
"description": "Reload button text"
},
"reset-to-bluetooth-mode-heading": {
"defaultMessage": "Reset to Bluetooth mode",
"description": "Title for dialog with instructures on using "
},
"reset-to-bluetooth-mode-subtitle": {
"defaultMessage": "Press RESET three times",
"description": "Instructions to press the physical reset button on the micro:bit"
},
"reset-to-default-action": {
"defaultMessage": "Réinitialiser les blocs par défaut",
"description": "Reset to default blocks button text"
Expand Down
Loading