Custom Search

Home screen widget , Weather widget in android

Home-Screen widget are best when your application is running in background and you want to show progress update and related information on home screen.
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.   
Screen shot of this application will be like that



Note- This project is for android API version 3.0 and above so make sure your project have this level of API else it will show error


When you will run this.It has no launcher activity so it will give any out put.It will just show in console following message

[2012-04-17 17:43:41 - WeatherWighet] Android Launch!
[2012-04-17 17:43:41 - WeatherWighet] adb is running normally.
[2012-04-17 17:43:41 - WeatherWighet] No Launcher activity found!
[2012-04-17 17:43:41 - WeatherWighet] The launch will only sync the application package on the device!
[2012-04-17 17:43:41 - WeatherWighet] Performing sync
[2012-04-17 17:43:41 - WeatherWighet] Automatic Target Mode: using existing emulator 'emulator-5556' running compatible AVD 'android_14.0'
[2012-04-17 17:43:41 - WeatherWighet] Uploading WeatherWighet.apk onto device 'emulator-5556'
[2012-04-17 17:43:42 - WeatherWighet] Installing WeatherWighet.apk...
[2012-04-17 17:43:46 - WeatherWighet] Success!
[2012-04-17 17:43:46 - WeatherWighet] /WeatherWighet/bin/WeatherWighet.apk installed on device
[2012-04-17 17:43:46 - WeatherWighet] Done!

That is means that your HomeScreen widegt is install.you can show it on your main screen

                                          Download complete Source code



5 comments:

{ pslvseoa6 } at: January 31, 2019 at 2:20 AM said...

Apex Weather is a new weather app from the developers of Apex Launcher, one of the best Android launchers. This weather app is above average. You get your basic stuff like the current, daily, and hourly forecasts. It also includes a weather map, severe weather alerts, and some of the better clock and weather widgets we've seen in a while. It even shows less common stuff like sunrise and sunset times, air pressure, UV index, and more. You can get weather forecasts in the U.S., U.K., Canada, and Australia along with a rather bland news blog if you want one. The ads can be a tad annoying, but otherwise this weather app checks all of the boxes. You can also remove the ads with a single $5.99 payment.

{ pslvseoa6 } at: February 2, 2019 at 4:13 AM said...

Apex Weather is a new weather app from the developers of Apex Launcher, one of the best Android launchers. This weather app is above average. You get your basic stuff like the current, daily, and hourly forecasts. It also includes a weather map, severe weather alerts, and some of the better clock and weather widgets we've seen in a while. It even shows less common stuff like sunrise and sunset times, air pressure, UV index, and more. You can get weather forecasts in the U.S., U.K., Canada, and Australia along with a rather bland news blog if you want one. The ads can be a tad annoying, but otherwise this weather app checks all of the boxes. You can also remove the ads with a single $5.99 payment.

{ Unknown } at: February 14, 2019 at 10:32 PM said...

Apex Weather is a new weather app from the developers of Apex Launcher, one of the best Android launchers. This weather app is above average. You get your basic stuff like the current, daily, and hourly forecasts. It also includes a weather map, severe weather alerts, and some of the better clock and weather widgets we've seen in a while. It even shows less common stuff like sunrise and sunset times, air pressure, UV index, and more. You can get weather forecasts in the U.S., U.K., Canada, and Australia along with a rather bland news blog if you want one. The ads can be a tad annoying, but otherwise this weather app checks all of the boxes. You can also remove the ads with a single $5.99 payment.

{ Unknown } at: February 15, 2019 at 11:42 PM said...

Apex Weather is a new weather app from the developers of Apex Launcher, one of the best Android launchers. This weather app is above average. You get your basic stuff like the current, daily, and hourly forecasts. It also includes a weather map, severe weather alerts, and some of the better clock and weather widgets we've seen in a while. It even shows less common stuff like sunrise and sunset times, air pressure, UV index, and more. You can get weather forecasts in the U.S., U.K., Canada, and Australia along with a rather bland news blog if you want one. The ads can be a tad annoying, but otherwise this weather app checks all of the boxes. You can also remove the ads with a single $5.99 payment.

{ Unknown } at: February 17, 2019 at 10:34 PM said...

Apex Weather is a new weather app from the developers of Apex Launcher, one of the best Android launchers. This weather app is above average. You get your basic stuff like the current, daily, and hourly forecasts. It also includes a weather map, severe weather alerts, and some of the better clock and weather widgets we've seen in a while. It even shows less common stuff like sunrise and sunset times, air pressure, UV index, and more. You can get weather forecasts in the U.S., U.K., Canada, and Australia along with a rather bland news blog if you want one. The ads can be a tad annoying, but otherwise this weather app checks all of the boxes. You can also remove the ads with a single $5.99 payment.

Post a Comment