App Store

[中文]

Overview

brookesia_app_store manages local and remote app packages for System Core installations.

Core Responsibilities

  • Fetches remote app indexes through HTTP service.

  • Downloads, installs, removes, and lists app packages.

  • Uses Storage and System Core app-management APIs for package data.

Integration Position

This component is an independent ESP-Brookesia release component. It can be integrated through ESP-IDF component dependencies and combined with peer framework components as needed.

API Reference

Header File

Classes

class AppStoreApp : public esp_brookesia::system::core::IApp

Built-in app store application for browsing, downloading, installing, and removing apps.

Public Functions

AppStoreApp()

Create an app store application instance.

~AppStoreApp() override

Destroy the app store application instance.

virtual system::core::AppManifest get_manifest() const override

Get the static metadata used to identify and present the application.

Returns

Application manifest containing id, name, version, and launch metadata.

virtual system::core::AppGuiDescriptor get_gui_descriptor() const override

Get the optional GUI resource descriptor for applications with a visual surface.

Returns

GUI descriptor; the default descriptor is empty for non-visual apps.

virtual std::expected<void, std::string> on_start(system::core::AppContext &context) override

Called when the application is started.

Parameters

context -- Runtime context for GUI, timers, storage, and services.

Returns

Empty result on success, or an error string that aborts startup.

virtual std::expected<void, std::string> on_stop(system::core::AppContext &context) override

Called when the application is stopped.

Parameters

context -- Runtime context for releasing app resources.

Returns

Empty result on success, or an error string.

virtual std::expected<void, std::string> on_action(system::core::AppContext &context, std::string_view action) override

Handle an action emitted by the application GUI or shell.

Parameters
  • context -- Runtime context for the running application.

  • action -- Action identifier registered by the application GUI.

Returns

Empty result on success, or an error string.

virtual std::expected<void, std::string> on_timer(system::core::AppContext &context, system::core::TimerId timer_id, std::string_view name) override

Handle a timer event previously scheduled through the app context.

Parameters
  • context -- Runtime context for the running application.

  • timer_id -- Runtime timer identifier.

  • name -- Application-defined timer name.

Returns

Empty result on success, or an error string.

class AppStoreAppProvider : public esp_brookesia::system::core::IAppProvider

Public Functions

virtual system::core::AppManifest get_manifest() const override

Get the manifest for the built-in app store app.

Returns

App store application manifest.

virtual std::shared_ptr<system::core::IApp> create_app() override

Create an app store application instance.

Returns

Shared application instance.