LauncherX — Android Launcher Extension

LauncherX is a powerful extension for building custom Android Home Screen / Launcher apps with Niotron and App Inventor.

Features:
:mobile_phone: Get & launch installed apps
:artist_palette: Get app icons as Base64
:house: Set/check default launcher
:high_voltage: App Shortcuts support
:bar_chart: Recent & most-used apps tracking
:counterclockwise_arrows_button: App install/remove/change events
:hammer_and_wrench: App Info & uninstall support
:globe_with_meridians: Perfect for HTML/WebView launchers

Built with Java + Rush by Zuhaib. :heart:

com.zebdroid.launcherx.aix (31.4 KB)

Vexa MIT.aia (490.1 KB)

:puzzle_piece: Blocks

1. GetLaunchableApps
Returns all launchable apps installed on the device with their app name and package name.

2. GetLaunchableAppCount
Returns the total number of launchable apps.

3. GetAppName
Returns the application name from a package name.

4. GetAppIconBase64
Returns the application's icon as a Base64 PNG Data URL.

5. GetAppIconBase64Size
Returns the app icon in Base64 with a custom icon size.

6. OpenApp
Opens an installed application using its package name.

7. IsAppInstalled
Checks whether the specified application is installed.

8. IsDefaultLauncher
Checks whether your application is currently the default Android launcher.

9. RequestDefaultLauncher
Shows Android's system interface to request your app as the default Home/Launcher.

10. GetDefaultLauncherPackage
Returns the package name of the currently selected default launcher.

11. OpenAppInfo
Opens Android's App Info page for the specified application.

12. UninstallApp
Opens Android's uninstall confirmation screen for the specified application.

13. HasShortcutPermission
Checks whether the launcher has permission to access Android App Shortcuts.

14. GetAppShortcuts
Returns shortcuts provided by an installed application.

15. OpenAppShortcut
Launches a specific Android App Shortcut.

16. HasUsageAccess
Checks whether Usage Access has been granted.

17. RequestUsageAccess
Opens Android's Usage Access settings.

18. GetLastUsedTime
Returns when a specified application was last used.

19. GetRecentlyUsedApps
Returns recently used applications.

20. GetMostUsedApps
Returns applications ordered by usage.

:high_voltage: Events

AppInstalled — Triggered when a new application is installed.

AppRemoved — Triggered when an application is removed.

AppChanged — Triggered when an installed application changes/updates.

ShortcutsChanged — Triggered when an application's shortcuts change.

GotDefaultLauncherResult — Triggered after the default-launcher request completes.

2 Likes

This is the perfect plugin I've been working on but haven't been able to get around to, and I've been searching online but couldn't find it. Thank you Therealzuhaib.

1 Like

LauncherX — Update (Bug Fixes + New Features) + Full Function Reference

Hey everyone! Pushing an update to LauncherX with a few important bug fixes and three new features. Full block reference is included at the bottom for anyone new to the extension.

com.zebdroid.launcherx.aix (63.6 KB)

:bug: Bug Fixes

1. RequestDefaultLauncher()GotDefaultLauncherResult event wasn't firing on some devices On Android versions/OEMs where the Home RoleManager role wasn't available, the block used to fall back to opening Settings directly — but never fired the GotDefaultLauncherResult event afterward. If your app was waiting on that event, it would just hang. Fixed: the fallback path now polls in the background and fires the event once the user sets (or doesn't set) LauncherX as default, or after a timeout.

2. UninstallApp() returning true when it hadn't actually started an uninstall On some devices, if the direct uninstall dialog couldn't be shown, the block fell back to opening the App Info screen instead — but was still returning true, making it look like the uninstall had started. This now correctly returns false for that fallback case, so your app logic won't be misled.

3. Rare race condition in the Home-forwarding debounce LauncherActivity (which handles Home button presses) and OpenMainScreen() shared a timestamp used to prevent duplicate rapid re-launches. Under specific timing, both could pass the check at nearly the same instant and both fire a launch. This is now handled with an atomic check-and-set, closing that window completely.

:sparkles: New Blocks

:artist_palette: Icon Pack Support

  • GetInstalledIconPacks() — lists installed icon packs (Nova, Apex, ADW, GO Launcher-style packs) as AppName|PackageName.

  • GetIconFromPackBase64(targetPackage, iconPackPackage) — returns an app's icon themed by the chosen icon pack, as a Base64 PNG. Falls back to the app's normal icon automatically if the pack doesn't have an entry for it.

  • GetIconFromPackFilePath(targetPackage, iconPackPackage) — same as above, but saves the icon to a file and returns the file path instead.

:file_folder: App Icon as File Path

  • GetAppIconFilePath(packageName) and GetAppIconFilePathSize(packageName, size) — previously icons were only available as Base64 data URLs (GetAppIconBase64 / GetAppIconBase64Size). These new blocks render the icon to a PNG file in the app's cache folder and return the file path instead — handy if you need a real file rather than a data URL.

:flashlight: Flashlight Control

  • HasFlashlight() — checks if the device has a flash unit.

  • IsFlashlightOn() — returns the real current hardware state.

  • ToggleFlashlight() — flips it on/off.

  • SetFlashlight(true/false) — sets it explicitly.

:clipboard: Manifest Changes

If you're building manually / not using the Niotron auto-merge, note the manifest now also declares:

  • android.permission.FLASHLIGHT

  • android.hardware.camera.flash (optional feature, required="false", so it won't block non-flash devices)

  • <queries> entries for the icon-pack discovery intents (Nova/Apex/ADW/GO)

Compatibility

No breaking changes — all existing blocks work exactly as before. This is purely additive + bug fixes, safe to update.


:books: Full Block Reference

App Discovery & Info

Block Description
IsReady() Returns true when LauncherX is loaded and ready.
GetLaunchableApps() Returns all launchable apps as `AppName
GetLaunchableAppCount() Returns the number of launchable applications.
GetAppName(packageName) Returns the display name of an app.
IsAppInstalled(packageName) Returns true if the package is installed.

App Icons

Block Description
GetAppIconBase64(packageName) App icon as a PNG Base64 data URL (96x96 default).
GetAppIconBase64Size(packageName, size) Same, with custom size (32-512px).
GetAppIconFilePath(packageName) :new_button: App icon rendered to a PNG file; returns the file path.
GetAppIconFilePathSize(packageName, size) :new_button: Same, with a custom size (32-512px).
GetInstalledIconPacks() :new_button: Lists installed icon packs as `AppName
GetIconFromPackBase64(targetPackage, iconPackPackage) :new_button: Themed icon (via icon pack) as Base64 PNG, with automatic fallback.
GetIconFromPackFilePath(targetPackage, iconPackPackage) :new_button: Same, saved to a file path instead.

Opening / Managing Apps

Block Description
OpenApp(packageName) Launches an installed app.
OpenAppAnimated(packageName, x, y, width, height) Launches an app with a zoom-from-icon animation.
OpenAppInfo(packageName) Opens Android's App Info screen for a package.
UninstallApp(packageName) Opens the uninstall confirmation screen for a package.
OpenMainScreen() Opens this app's main Niotron screen.
RestartApp() Restarts the app from scratch (fresh process).
HideFromRecents() Excludes this screen's task from the recent-apps list.

Default Launcher (Home Role)

Block Description
IsDefaultLauncher() Returns true if this app is the current default Home launcher.
GetDefaultLauncherPackage() Returns the package name of the current default Home launcher.
RequestDefaultLauncher() Prompts the user to set this app as the default Home launcher.
GotDefaultLauncherResult(success)event Fired after the user responds to the RequestDefaultLauncher() prompt.

App Shortcuts

Block Description
HasShortcutPermission() Returns true if this launcher has permission to access shortcuts.
GetAppShortcuts(packageName) Returns shortcuts as `ShortcutId
OpenAppShortcut(packageName, shortcutId) Launches a specific shortcut.

Usage Stats

Block Description
HasUsageAccess() Returns true if Usage Access has been granted.
RequestUsageAccess() Opens Usage Access settings for the user to grant it.
GetLastUsedTime(packageName) Returns the last-used Unix timestamp (ms) for a package.
GetRecentlyUsedApps(hours, limit) Recently used apps as `AppName
GetMostUsedApps(days, limit) Most-used apps as `AppName

Package Change Events

Block Description
AppInstalled(packageName)event Fired when a package is installed.
AppRemoved(packageName)event Fired when a package is removed.
AppChanged(packageName)event Fired when a package changes (updates etc).
AppAvailable(packageName, replacing)event Fired when a package becomes available.
AppUnavailable(packageName, replacing)event Fired when a package becomes temporarily unavailable.
ShortcutsChanged(packageName)event Fired when an app's shortcuts change.

Badges / Unread Counts

Block Description
RegisterBadgeReceiver() Starts listening for badge/unread-count broadcasts (WhatsApp, Gmail, Telegram, etc).
UnregisterBadgeReceiver() Stops listening for badge broadcasts.
GetBadgeCount(packageName) Returns the last-known badge count for a package.
ClearBadgeCounts() Clears all stored badge counts.
BadgeCountChanged(packageName, count)event Fired when a badge count is received.

System Panels & Settings Shortcuts

Block Description
Notifications() Expands the notification shade.
QuickSettings() Expands the Quick Settings panel.
EnterImmersiveMode() Hides status/navigation bars for full-screen.
ExitImmersiveMode() Restores status/navigation bars.
OpenInternetPanel() Opens the Wi-Fi + mobile data picker panel.
OpenVolumePanel() Opens the volume control overlay.
OpenWiFiSettings() Opens Wi-Fi settings.
OpenBluetoothSettings() Opens Bluetooth settings.
OpenNFCSettings() Opens NFC settings.
OpenLocationSettings() Opens Location (GPS) settings.
OpenAirplaneModeSettings() Opens Airplane mode settings.
OpenBatterySettings() Opens Battery settings.
OpenBatterySaverSettings() Opens Battery Saver settings.
OpenStorageSettings() Opens Storage settings.
OpenNotificationSettings() Opens this app's Notification settings.
OpenDateTimeSettings() Opens Date & Time settings.
OpenLanguageSettings() Opens Language settings.
OpenKeyboardSettings() Opens Keyboard/input method settings.
OpenSecuritySettings() Opens Security settings.
OpenPrivacySettings() Opens Privacy settings.
OpenDefaultAppsSettings() Opens Default Apps settings.
OpenHomeSettings() Opens the default Home app picker.
OpenDisplaySettings() Opens Display settings.
OpenSoundSettings() Opens Sound settings.

Battery, RAM & Device State

Block Description
GetBatteryLevel() Battery percentage (0-100), or -1 if unavailable.
IsCharging() True if charging via USB/AC/wireless.
GetBatteryTemperature() Battery temperature in °C, or -1 if unavailable.
IsPowerSaveMode() True if Battery Saver is on.
IsInteractive() True if the screen is currently on.
GetAvailableRAM() Free RAM in MB.
GetTotalRAM() Total device RAM in MB.
IsLowMemory() True if the system considers itself low on memory.

Flashlight :new_button:

Block Description
HasFlashlight() True if the device has a flash unit.
IsFlashlightOn() True if the flashlight is currently on (real hardware state).
ToggleFlashlight() Toggles the flashlight on/off.
SetFlashlight(on) Turns the flashlight on or off explicitly.

As always, feel free to report anything odd here on the thread. Thanks! :folded_hands:

Your new version is great too. However, the new version is adding very sensitive permissions (notification listening) to our app's AndroidManifest.xml file. Play Protect is also mistaking our app for a virus. My suggestion is: separate the notification listening plugin from LauncherX.

I checked the current LauncherX implementation, and it does not include Notification Listener permission. LauncherX only uses the access required for its core launcher functionality, such as app discovery and usage-based features. I'll still keep notification listening separate from LauncherX if it's added in the future.