- Widget resizing available from Android 3.1 onward - App widget HOST: Holds app widgets - App widget PROVIDER: Publishs app widgets AppWidgetProviderInfo - Metadata for widgets: layout, update frequency, AppWidgetProvider class AppWidgetProvider - Interface to app widget - App widgets may have configuration activities - Launches when app widget is added Problem: Restoring widgets after reboot ---------------- - Android widgets are called AppWidgets - We can either a) Write our own widget framework - Doable, but requires to be well-designed - Making it support Android AppWidgets (and thus, the Android widget framework) is not feasible b) Use the Android widget framework, with the limitations described below - The following applies to devices with Android versions prior to 4.1: - We CAN make an application that can host Android app widgets - These widgets can be from any application - We CANNOT do our own widget picker in case we want to include Android AppWidgets as well - We MUST use the default OEM-provided picker in case we want to go the Android AppWidgets route - TODO: ADW Laucher has its own picker in Android 4.2, at least. Check if true on 2.x. - We CANNOT add widgets without the user manually picking them (i.e. programmatically) - Widgets CANNOT be restored after the device is rebooted. - The user MUST add the widgets manually after reboot, each time. - So why does every device's default launcher allow this? Read on. - Technical explanation: - Android requires that widgets are bound to AppWidgetService (internal component) - This requires the BIND_APPWIDGET permission - Available only for system apps, i.e. ones signed with platform certificate - NOT available for regular installable SDK apps prior to Android 4.1 - This limitation has apparently been lifted in Android 4.1 (Jelly Bean) - Still no way to make it work with Android 4.0 and below - User is asked for permission to bind widgets to the application - Permitted application is stored internally - After being granted such a permission, adding widgets programmatically MIGHT work. But there are no guarantees unless time is spent to try it out. - Even so, since our solution must work in 2.2-4.0 devices as well, using AppWidgets is a no-go. Launchers that use Android AppWidget framework: - Nova Launcher - Holo Launcher - ADW Launcher