Skip to content

Commit 39d9d93

Browse files
Add AppManager framework
1 parent bb2c2fe commit 39d9d93

File tree

5 files changed

+787
-6
lines changed

5 files changed

+787
-6
lines changed

docs/apps/creating-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ If the app is installed into the /apps/ folder, it should show up in the launche
107107
You can also launch it manually by typing this in the MicroPython REPL:
108108

109109
```
110-
import mpos.apps; mpos.apps.start_app('apps/com.micropythonos.helloworld/')
110+
from mpos import AppManager ; AppManager.start_app('apps/com.micropythonos.helloworld/')
111111
```
112112

113113

docs/architecture/frameworks.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,26 @@ class MyFramework:
5656

5757
## Available Frameworks
5858

59+
### AppManager
60+
Manages app discovery, installation, launching, and version management.
61+
62+
```python
63+
from mpos.content.app_manager import AppManager
64+
65+
# Get all installed apps
66+
apps = AppManager.get_app_list()
67+
68+
# Start an app
69+
AppManager.start_app("com.example.myapp")
70+
71+
# Install from .mpk file
72+
AppManager.install_mpk("/tmp/app.mpk", "apps/com.example.newapp")
73+
74+
# Check for updates
75+
if AppManager.is_update_available("com.example.myapp", "2.0.0"):
76+
print("Update available")
77+
```
78+
5979
### AppearanceManager
6080
Manages visual appearance: light/dark mode, theme colors, UI dimensions, and LVGL styling.
6181

@@ -180,9 +200,11 @@ from mpos import (
180200
SensorManager,
181201
TaskManager
182202
)
203+
from mpos.content.app_manager import AppManager
183204

184205
def init_frameworks():
185206
"""Initialize all frameworks."""
207+
AppManager.refresh_apps() # Discover all installed apps
186208
AppearanceManager.init(prefs) # Requires SharedPreferences
187209
AudioFlinger.init()
188210
DownloadManager.init()
@@ -192,6 +214,8 @@ def init_frameworks():
192214
TaskManager.init()
193215
```
194216

217+
**Note:** AppManager doesn't require explicit initialization - call `refresh_apps()` to discover apps at startup.
218+
195219
## Creating New Frameworks
196220

197221
When creating a new framework, follow this template:
@@ -278,10 +302,12 @@ from mpos import (
278302
SharedPreferences,
279303
TaskManager,
280304
WifiService,
281-
PackageManager,
282305
)
306+
from mpos.content.app_manager import AppManager
283307
```
284308

309+
**Note:** AppManager is imported from `mpos.content.app_manager` rather than the main `mpos` module.
310+
285311
## Benefits of Harmonization
286312

287313
| Aspect | Before | After |
@@ -357,6 +383,7 @@ class TestMyFramework(unittest.TestCase):
357383

358384
## See Also
359385

386+
- [AppManager](../frameworks/app-manager.md): App discovery, installation, and launching
360387
- [System Components](system-components.md): Overview of all system components
361388
- [Architecture Overview](overview.md): High-level design principles
362389
- [App Development Guide](../apps/index.md): How to use frameworks in apps

0 commit comments

Comments
 (0)