-
Notifications
You must be signed in to change notification settings - Fork 0
Development
Developing apps for KryonOS is incredibly simple. Apps are written in JavaScript and use a standard folder structure containing metadata and code.
Developing apps for KryonOS is incredibly simple. Apps are written in JavaScript and use a standard folder structure containing metadata and code.
In KryonOS, an app is a Folder containing all its necessary files. When you upload your app via the Web Dashboard, you simply select your app's folder.
A standard app folder looks like this:
MyAwesomeApp/
├── app.json
└── main.js
The app.json file is the heart of your app's identity. The KryonOS Installer reads this file to securely install, update, and categorize your application.
{
"name": "My App",
"packageName": "com.developer.myapp",
"version": "1.0.0",
"metaUrl": "https://raw.githubusercontent.com/.../myapp/app.json",
"author": "John Doe",
"description": "A cool app that does awesome things.",
"type": "App",
"category": "Utility",
"api": 1,
"changelog": "Initial release."
}-
packageName: A globally unique identifier (lowercase, dot-separated style, no spaces). The OS uses this to detect if your app is already installed. -
version: Semantic versioning (e.g.,1.0.0). The OS will smartly prompt users to "Update" if a higher version is detected. -
metaUrl: The raw URL to theapp.jsonon the internet (used for OTA app updates). If you are submitting your app to the official KryonOS App Store, leave this blank (""), as it will be auto-generated. -
author: Your name. Protects your app from being overwritten by malicious developers. -
api: The KryonOS API level your app targets. This is critical. Always ensure this number matches the API level of the JS API Guide you are referencing. If your app uses new hardware features from the latest API, but you define a low API level here, the OS might not provide those features and your app will crash!
The main.js file is the entry point. Because KryonOS handles the underlying C++ translation, you can write simple, high-level JavaScript to draw graphics, read files, and trigger UI components.
Your First App:
// Clear the screen
Graphics.fillScreen(Graphics.COLOR_BLUE);
// Draw some text in the center
Graphics.setTextColor(Graphics.COLOR_WHITE);
Graphics.drawString("Hello KryonOS!", 120, 160, 2);
// Wait for 3 seconds
System.delay(3000);
// Close the app and return to the OS Launcher
System.exit();Important
To see everything you can do in main.js, please check out the full JS API Guide!
The best way to learn how to develop for KryonOS is to study existing applications! You can find fully developed JS Apps and Games, including their app.json metadata and main.js source code, in the official App Store repository. These serve as excellent templates to help easily kickstart your own projects.