Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 30, 2025

This PR transforms the ScriptableDroid repository from a concept with just a README into a fully functional Android application that provides JavaScript automation capabilities similar to iOS Scriptable.

What's New

Complete Android Application: Built a production-ready Android app with Material Design UI that allows users to write, save, and execute JavaScript scripts with access to device APIs.

JavaScript Execution Engine: Integrated Duktape JavaScript engine to provide a secure sandboxed environment for running user scripts with custom Android APIs exposed to JavaScript.

Script Management System: Implemented full CRUD operations for scripts with persistent storage using SharedPreferences and JSON serialization.

Code Editor with Syntax Highlighting: Added Sora Code Editor with JavaScript language support, providing a professional development experience directly on the device.

Key Features

  • Script Editor: Full-featured JavaScript code editor with syntax highlighting
  • Device APIs: Battery level and charging state accessible from JavaScript via Device.batteryLevel() and Device.batteryState()
  • Script Library: Save, organize, and manage multiple scripts with descriptions
  • Material Design UI: Modern Android interface with RecyclerView, FAB, and card-based layouts
  • Example Scripts: Pre-loaded scripts demonstrating battery monitoring and notification creation

Technical Implementation

The app is built using:

  • Kotlin for Android development with modern Android architecture
  • Duktape-Android for secure JavaScript execution
  • Sora Code Editor for syntax-highlighted code editing
  • Material Design 3 components for consistent UI/UX
  • Gson for JSON serialization of script data

JavaScript API Examples

// Get battery information
const batteryLevel = Device.batteryLevel();
const batteryState = Device.batteryState();
console.log(`Battery: ${batteryLevel}% (${batteryState})`);

// Create notifications (placeholder implementation)
Notification.create("ScriptableDroid", "Hello from JavaScript!");

Build System

  • Complete Gradle configuration with wrapper for cross-platform building
  • GitHub Actions CI/CD pipeline for automated testing and building
  • ProGuard rules for release optimization
  • Vector-based launcher icons with adaptive icon support

Documentation

Updated README with comprehensive build instructions, API documentation, contribution guidelines, and example usage scenarios.

This implementation provides Android users with a powerful JavaScript automation platform, filling the gap left by the lack of Scriptable on Android. Users can now create custom scripts to interact with their device, automate tasks, and potentially create custom widgets (planned for future releases).


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits July 30, 2025 04:50
Co-authored-by: rushhiii <142855385+rushhiii@users.noreply.github.com>
Co-authored-by: rushhiii <142855385+rushhiii@users.noreply.github.com>
Copilot AI changed the title [WIP] @scriptable_android.md help be build this Complete ScriptableDroid Android app implementation with JavaScript automation Jul 30, 2025
Copilot AI requested a review from rushhiii July 30, 2025 04:59
@rushhiii rushhiii marked this pull request as ready for review July 30, 2025 17:37
@rushhiii rushhiii merged commit 6450c48 into main Jul 30, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants