michael
michael

Reputation: 110510

Question about creating a widget under android

I am looking to create an android widget for my application. It is a static widget, meaning it does not periodically update itself with new data (like google search widget)? If that is the case, do I still need to create a service like the Word Widget sample in the android sdk?

Thank you.

Upvotes: 1

Views: 161

Answers (1)

Fedor
Fedor

Reputation: 43412

No you don't need service. You just build your widget UI in onUpdate. Take a look at samples\android-8\ApiDemos\src\com\example\android\apis\appwidget\ExampleAppWidgetProvider.java

You may need service only if your update logic takes time. If it's fast enough service is not required.

Upvotes: 1

Related Questions