App Launcher on fdroid with widget and work profile support
- User
App Launcher on fdroid with widget and work profile support
Assistant
Here's a comprehensive solution for developing an open-source App Launcher with work profile support and widget functionality for F-Droid:
App Launcher: F-Droid Work Profile Launcher
Core Features:
-
Work Profile Support
- Detect and display apps from both personal and work profiles
- Switch between profile views
- Enterprise-grade security compliance
-
Widget System
- Home screen widget for quick app access
- Customizable widget sizes (1x1 to 4x4)
- Adaptive icon support
-
Modern Android Features
- Material Design 3 interface
- Dynamic theming
- Accessibility support
Technical Implementation Plan
1. Project Setup (Android Studio)
// build.gradle dependencies dependencies { implementation 'androidx.core:core-ktx:1.12.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.9.0' implementation 'androidx.work:work-runtime-ktx:2.9.0' }2. Work Profile Detection
fun getWorkProfileApps(context: Context): List<ApplicationInfo> { val userManager = context.getSystemService<UserManager>() val devicePolicyManager = context.getSystemService<DevicePolicyManager>() return context.packageManager.getInstalledApplications(0).filter { val userId = it.uid / 100000 userManager.getUserProfiles().any { profile -> profile.id == userId && devicePolicyManager.isProfileOwnerApp(context.packageName) } } }3. Widget Implementation
<!-- res/xml/app_widget.xml --> <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="40dp" android:minHeight="40dp" android:updatePeriodMillis="86400000" android:initialLayout="@layout/widget_layout" android:resizeMode="none" android:widgetCategory="home_screen"/>4. Profile Switching Logic
fun switchProfile(context: Context, isWorkProfile: Boolean) { val intent = Intent().apply { action = Intent.ACTION_VIEW component = ComponentName( "com.android.settings", "com.android.settings.Settings\$WorkProfileSettingsActivity" ) } context.startActivity(intent) }
Key Challenges & Solutions
-
Work Profile Access Permissions
- Use
DevicePolicyManagerAPI - Handle
PROFILE_OWNERvsDEVICE_OWNERscenarios - Implement runtime permissions for
MANAGE_DEVICE_POLICY
- Use
-
App List Filtering
fun isWorkApp(context: Context, packageName: String): Boolean { return try { val userId = context.packageManager.getApplicationInfo( packageName, 0 ).uid / 100000 UserManager.get(context).isManagedProfile(userId) } catch (e: Exception) { false } } -
Widget Update Mechanism
class AppWidgetProvider : androidx.appwidget.AppWidgetProvider() { override fun onUpdate( context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray ) { appWidgetIds.forEach { widgetId -> val views = RemoteViews(context.packageName, R.layout.widget_layout) // Update widget UI appWidgetManager.updateAppWidget(widgetId, views) } } }
F-Droid Requirements
-
Open Source Compliance
- License: GPLv3 or Apache 2.0
- Source code on public repository (GitHub/GitLab)
- Build with F-Droid's reproducible build system
-
Privacy Considerations
- No tracking/analytics
- Minimal permissions:
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/> <uses-permission android:name="android.permission.MANAGE_DEVICE_POLICY"/>
-
Metadata Requirements
- Fastlane metadata in English and German
- Feature graphic (1024x500px)
- Proper app description in Markdown format
Recommended Tech Stack
Component Technology Choice Language Kotlin 1.9 UI Framework Jetpack Compose (if min API 21+) Dependency Injection Hilt Work Profile Android Management API Widget AppWidgetProvider Theming Material Components + Dynamic This implementation provides a modern, enterprise-ready app launcher that meets F-Droid's open-source requirements while supporting work profiles and home screen widgets. The solution uses current Android APIs while maintaining compatibility with Android 8.0+ devices.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.