Skip to main content

useAppDiscovery

Source: hooks/useAppDiscovery.ts (54 lines) The useAppDiscovery hook fetches the complete list of installed applications from the Android device via the AppListerModule Kotlin native bridge.

Native Bridge Call

The hook calls the AppListerModule’s getInstalledApps function, which uses Android’s PackageManager API to enumerate all installed packages:

Return Data Shape

Each app entry contains: The icon is a Base64-encoded PNG of the app’s launcher icon, rendered directly in Image components.

Caching Strategy

The app list is fetched once on mount and cached in component state. Subsequent renders return the cached list without re-querying the native module. The list is only refreshed if the component remounts (e.g., navigating away and back).

Performance: JSI Bridge

The AppListerModule uses JSI (JavaScript Interface) rather than the traditional React Native bridge for data transfer. This eliminates JSON serialization overhead and enables synchronous, high-performance enumeration of hundreds of installed packages without blocking the JS thread.