Title: Theory / Unimportant / CS / Programming / Java / Android / Widget
Tags: automatedNewLineAfterCommaSpace
On every note of this deck, unless a note says otherwise:
Page: https://developer.android.com/guide/topics/appwidgets
Page: https://developer.android.com/guide/topics/appwidgets

Name: A widget
Definition: An application shown on home screen
Page: https://developer.android.com/guide/topics/appwidgets/overview
Context: Android

Question: The types of widgets
Answer: Information
Page: https://developer.android.com/guide/topics/appwidgets/overview
Context: Android
Answer2: Collection
Answer3: Control
Answer4: Hybrid

Name: An information widget
Definition: display a few crucial information elements and track how that information changes over time.
Page: https://developer.android.com/guide/topics/appwidgets/overview
Context: Android
Example: weather widgets, clock widgets or sports score tracking widgets

Name: A collection widget
Definition: Widget that specialize in displaying multiple elements of the same type
Page: https://developer.android.com/guide/topics/appwidgets/overview
Context: Android
Example: a collection of pictures from a gallery app, a collection of articles from a news app or a collection of emails/messages from a communication app.

Name: A control widget
Definition: Widget that display often-used functions, so that the user can trigger right from the home screen without having to open the app first
Page: https://developer.android.com/guide/topics/appwidgets/overview
Context: Android

Name: An hybrid widget
Definition: A widget that mixes information, collection and control
Page: https://developer.android.com/guide/topics/appwidgets/overview
Context: Android

Question: What occurs when you click on an information widget
Answer: launches the associated app and opens a detailed view of the widget information.
Page: https://developer.android.com/guide/topics/appwidgets/overview
Context: Android

Question: What are the usual uses of collection widget
Answer: Browsing the collection
Page: https://developer.android.com/guide/topics/appwidgets/overview
Context: Android
Answer2: Opening an element of the collection to its detail view in the associated app for consumption
Answer3: Interacting with elements such as marking them done

Question: What gestures are available on widgets
Answer: touch and vertical swipe
Page: https://developer.android.com/guide/topics/appwidgets/overview
Context: Android

Name: A generative function
Definition: A function that allow the user to create new content for an app
Page: https://developer.android.com/guide/topics/appwidgets/overview
Context: Android
Example: Create a new message

Question: What occurs if you long press a widget
Answer: you can resize it
Page: https://developer.android.com/guide/topics/appwidgets/overview
Context: Android

Name: A widget host
Definition: An app component that is able to hold other widget
Page: https://developer.android.com/guide/topics/appwidgets
Context: Android

Name: A widget provider
Definition: Something that allow to publish a widget
Page: https://developer.android.com/guide/topics/appwidgets
Context: Android

Question: What do you need to create a widget
Answer: AppWidgetProviderInfo
Page: https://developer.android.com/guide/topics/appwidgets
Context: Android
Answer2: AppWidgetProvider
Answer3: A view layout

Question: What can be useful for widget
Answer: App Widget configuration activity.
Page: https://developer.android.com/guide/topics/appwidgets
Context: Android
Answer2: flexible widget layouts,
Answer3: miscellaneous enhancements,
Answer4: advanced widgets,
Answer5: collection widgets,
Answer6: building a widget host.

Instruction: <appwidget-provider>
Effect: Declaration of an app widget
Context: Android

Variable: android:targetCell(Width|Height)
Meaning: the default size of the widget in terms of grid cells
Context: Android <appwidget-provider>
Language: xml

Variable: android:min(Width|Height)
Meaning: the default size of the widget in dp. Actual size is rounded up to nearest cell size.
Context: Android <appwidget-provider>
Language: xml

Variable: android:(min|max)Resize(Width|Height)
Meaning: the widget's absolute (minimum|maximum) size
Context: Android <appwidget-provider>
Language: xml

Variable: android:resizeMode
Meaning: the rules by which a widget can be resized.
Context: Android <appwidget-provider>
Language: xml
Value: none
Value2: horizontal, vertical
Value3: horizontal|vertical

Variable: android:updatePeriodMillis
Meaning: how often the widget framework should request an update from the AppWidgetProvider by calling the onUpdate() callback method
Context: Android <appwidget-provider>
Language: xml

Variable: android:initialLayout
Meaning: layout resource that defines the widget layout.
Context: Android <appwidget-provider>
Language: xml

Variable: android: configure
Meaning: the activity that launches when the user adds the widget,
Context: Android <appwidget-provider>
Language: xml
Extra: allowing them to configure widget properties

Variable: android: description
Meaning: the description for the widget picker to display for your widge
Context: Android <appwidget-provider>
Language: xml

Variable: android: previewLayout
Meaning: a scalable preview, which you’ll provide as an XML layout set to the widget's default size
Context: Android <appwidget-provider>
Language: xml

Variable: android: previewImage
Meaning: a preview of what the widget will look like after it's configured, which the user sees when selecting the app widget
Context: Android <appwidget-provider>
Language: xml

Variable: android: autoAdvanceViewId
Meaning: the view ID of the widget subview that should be auto-advanced by the widget's host
Context: Android <appwidget-provider>
Language: xml

Variable: android: widgetCategory
Meaning: Where the widget should be displaied
Context: Android <appwidget-provider>
Language: xml
Value: Since Android 5.0, must be home_screen. Indicates the widget is for home_screen. Lock_screen used to be possible

Variable: android: widgetFeatures
Meaning: features supported by the widget.
Context: Android <appwidget-provider>
Language: xml

Instruction: onUpdate()
Effect: Method called when the widget should be updated, also when the widget is added
Language: java
Context: AppWidgetProvider

Instruction: onAppWidgetOptionsChanged()
Effect: Method called when the widget is first placed and any time the widget is resized.
Language: java
Context: AppWidgetProvider

Instruction: getAppWidgetOptions()
Language: java
Context: AppWidgetProvider
Returns: A bundle with options of size this widget can take

Instruction: onDeleted(
  Context,
  int[]
)
Effect: called every time a widget is deleted from the widget host.
Language: java
Context: AppWidgetProvider

Instruction: onEnabled(context)
Effect: Called when an instance the widget is created for the first time.
Language: java
Context: AppWidgetProvider

Instruction: onReceive(
  context,
  intent
)
Effect: called for every broadcast and before each of the other callback methods
Language: java
Context: AppWidgetProvider