Sony Addon SDK public abstract class

BaseWidget

This project is no longer being supported and will not get any further updates.
extends WidgetExtension
  1. java.lang.Object
  2. com.sonyericsson.extras.liveware.extension.util.widget.WidgetExtension
  3. com.sonyericsson.extras.liveware.extension.util.widget.BaseWidget

Class Overview

Summary

Nested Classes
class BaseWidget.WidgetBundle Simple class that encapsulates values to instantiate BaseWidget
Inherited Constants
From class WidgetExtension
java.lang.String SCHEDULED_REFRESH_INTENT
int WIDGET_WIDTH_SMARTWATCH Widget width in pixels in the original SmartWatch.
int WIDGET_HEIGHT_SMARTWATCH Widget height in pixels in the original SmartWatch.
int NOT_SET
Inherited Fields
From class WidgetExtension
protected final Context mContext The extension service context.
protected final java.lang.String mHostAppPackageName The host app package name with which the widget is connected.
protected int mInstanceId Widget instance Id.
Public Constructors
BaseWidget(BaseWidget.WidgetBundle bundle)

BaseWidget constructor.

Public Methods
void onCreate()

Called when the widget is starting.

abstract int getWidth()

Get the widget width in pixels.

abstract int getHeight()

Get the widget height in pixels.

abstract int getPreviewUri()

Get the widget preview image resource id used to describe this widget to the user in the host application settings.

abstract int getName()

Get the widget resource name used to describe this widget to the user in the host application settings.

int getCategory()

Get the widget category.

Inherited Methods
From class WidgetExtension
final void startRefresh()

Start widget refresh.

final void stopRefresh()

Stop widget refresh.

final void destroy()

Destroy widget.

abstract void onStartRefresh()

Called when widgets starts refreshing and is visible.

abstract void onStopRefresh()

Called when widget stops refreshing and is no longer visible.

void onScheduledRefresh()

Override this method to take action on scheduled refresh.

void onDoAction(int requestCode, Bundle bundle)

Called when widget receives an action request.

void onDestroy()

Called when a widget is no longer used and is being removed.

void onTouch(int type, int x, int y)

Called when the widget has been touched.

void onObjectClick(int type, int layoutReference)

Called when an object click event has occurred.

void scheduleRepeatingRefresh(long triggerAtTime, long interval, java.lang.String extensionKey)

Schedule a repeating refresh.

void scheduleRefresh(long triggerAtTime, java.lang.String extensionKey)

Schedule a refresh.

void cancelScheduledRefresh(java.lang.String extensionKey)

Cancel any pending scheduled refresh associated with the extension key.

void sendImageToHostApp(int resourceId)

Show image in the widget.

void sendToHostApp(Intent intent)

Send intent to host application.

void showBitmap(Bitmap bitmap)

Show bitmap in the widget.

void showLayout(int layoutId)

Show a layout in the widget.

void showLayout(int layoutId, Bundle[] layoutData)

Show a layout in the widget.

void showLayout(int layoutId, int noTouchLayoutId, Bundle[] layoutData)

Show a layout in the widget.

void showLayout(int layoutId, int noTouchLayoutId, int offLineLayoutId, Bundle[] layoutData)

Show a layout in the widget.

void sendImage(int layoutReference, int resourceId)

Update an image in a specific layout, in the widget.

void sendText(int layoutReference, java.lang.String text)

Update a TextView in a specific layout, in the widget.

Public Constructors

public BaseWidget(BaseWidget.WidgetBundle bundle)

BaseWidget constructor. This constructor is used by the system and should not be overwritten or used for instantiation.

Parameters
bundle
See Also

Public Methods

public void onCreate()

Called when the widget is starting. This is where most initialization should go.

public abstract int getWidth()

Get the widget width in pixels. Is written to the WIDTH field.

Returns

The width.

public abstract int getHeight()

Get the widget height in pixels. Is written to the HEIGHT field.

Returns

The height.

public abstract int getPreviewUri()

Get the widget preview image resource id used to describe this widget to the user in the host application settings. The string resource is written to the PREVIEW_IMAGE_URI field. getUriString can be used to retrieve the string from a resource id.

Returns

The preview image URI as a string.

public abstract int getName()

Get the widget resource name used to describe this widget to the user in the host application settings. The string resource written to the NAME field.

Returns

The name.

public int getCategory()

Get the widget category. The string resource written to the CATEGORY field.

Returns

The category