For example-You are playing song in MediaPlayer and want to show progress on home screen about currently playing song and other information
So for this we need three classes and in the end of this article i have posted full source code link
WeatherDataProvider
— Our ContentProvider which stores the weather data for this sample. Note that for simplicity, it currently stores the data in memory as opposed to an external and persistent storage such as a file, network location, database, or shared preference.WeatherWidgetProvider
— Our AppWidgetProvider which handles specific intent actions (such as when an item is clicked, or the refresh button is pressed). It also sets up the RemoteViews for the widget and binds the service to the collection view in the widget.WeatherWidgetService
— Our RemoteViewsService which manages the creation of new factories, which return the RemoteViews for each item in the ListView.