I found some conflicting definitions on the term. On http://developer.android.com/reference/android/view/View.html, the author defined widgets as "View is the base class for widgets, which are used to create interactive UI components (buttons, text fields, etc.)", bascially used to create interactive UI components. However on on another StackOverFlow question https://stackoverflow.com/questions/11911249/what-exactly-defines-a-widget, an answer was "application that can be interacted with from the home screen". My question is that in terms of android, does the term widget refer to the tool used to create the ui components or the ui components themselves? Can anyone clarify this?

  • @RossC Please don't write answers as comments. – Dan Hulme Jun 24 '14 at 8:18
  • @DanHulme It wasn't really enough for an answer in my opinion, and I was gathering some resources for a decent answer, but you'd done it in the meantime! – RossC Jun 24 '14 at 8:22
  • Please don't post the same question across multiple stack sites As per this post and Here's the duplicate – RossC Jun 24 '14 at 9:00

I'm not surprised you're confused: the term is indeed used for two different things, as you've found.

For developers, a widget means a View: a single GUI control inside an activity, which can show information or be manipulated by the user. Examples include Button, TextView, and SeekBar.

The app component that lives on the home screen (or lock screen) is properly called an appwidget. Stock Android ships with appwidgets for the calendar and email apps, amongst others.

However, terms are used differently in user-facing documentation and labels. Views don't need to be described to the user, so the term widget is used for appwidgets, presumably because it's shorter. But because it's in the user-facing documentation, and app authors have to label their appwidgets as widgets, they tend to use the term widget for both, when it's possible to tell from context which is meant.

It's common for the same thing to be described differently to users and developers; the only confusion in this case is that the users' word for one thing is the same as the developers' word for something different. It's almost always clear which one is meant, because the two components are used in different circumstances: if you need to be unambiguous, you can say "View" or "appwidget".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.