[Android Themes] bootman2:
First of all, sorry for my english. :cool:

It's a tuto to create personalized widgets using google's geolocation and forecast services.

For example, this is how my Wildfire looks like.

----------------------------------------------

A) We need:

Tasker: https://market.android.com/details?id=net.dinglisch.android.taskerm&feature=search_result

Zoom app for tasker: https://market.android.com/details?id=net.dinglisch.android.zoom&feature=search_result

Any cool icon pack. This one, for example: http://www.ateneupopular.com/diseno/iconos-del-tiempo-para-descargar/

Data conexion, to get the forecast data, from Google (obviously)

---------------------------------------------

B) First task: Geolocation, forecast and variables:

1.- HTTP Get -> Server:maps.googleapis.com/maps/api/geocode/json?latlng=%LOCN&sensor=false | Exit file -> sync

It takes the coordinates from the system variable %LOCN, and converts it in the name of the city.

For example:http://maps.googleapis.com/maps/api/geocode/json?latlng=34.172684,-118.604794&sensor=false

It doesn't need GPS, so it´s "battery friendly"

The task guves us a result of %HTTPR=-1 if there has been any problem

2.- Go to -> task 12 | if -> %HTTPR=-1

Jumps some tasks if there has been a problem with the first one

3.- Set variable -> %LIN -> To 16

We will need this valor

4.- Read line %LIN -> file -> sync | To variable %HHTPD1

In the example: "long_name" : "Woodland Hills",

5.- Split variable -> %HTTPD1 | Splitter -> "

6.- Set variable -> %LOCL -> To %HTTPD14

Now we have the log name of the location, in the variable %LOCL

Let's repeat the process to get the short name of the location.

7.- Set variable -> %LIN -> To 17

8.- Read line %LIN -> file -> sync | To variable %HHTPD1

9.- Split variable -> %HTTPD1 | Splitter -> "

10.- Set variable -> %LOCS -> To %HTTPD14

11.- Clean variable -> %LIN

Now, we have %LOCS for the short name of the location, and %LOCL, for the long name

12.- HTTP Get -> Servidor:http://www.google.com/ig/api?weather=%LOCL&hl=us (hl=es, if you want the forecast information in spanish)

It takes the location name from the variable, and converts it in the forecast information.

The variable %HTTPD gets a valor like this one: http://www.google.com/ig/api?weather=woodland hills&hl=es

Now, I'm going a bit faster

13.- Go to -> action 34 | if -> %HTTPR=-1

14.- Split variable -> %HTTPD | Spliter -> forecast

15.- Set variable -> %HTTPD1 -> To %HTTPD4

16.- Split variable -> %HTTPD1 | Spliter -> "

17.- Set variable -> %WNOW -> to %HTTPD12 (WNOW -> weather now)

18.- Set variable -> %TNOW -> to %HTTPD16 (TNOW -> temperature now)

19.- Set variable -> %HTTPD1 -> to %HTTPD5

20.- Split variable -> %HTTPD1 | Spliter -> "

21.- Set variable -> %TITOD -> to %HTTPD14 (TITOD -> Temp min today )

22.- Set variable -> %TMTOD -> to %HTTPD16 (TMTOD -> temp max today)

23.- Set variable -> %WTOD -> to %HTTPD110 (WTOD -> weather today)

24.- Set variable -> %HTTPD1 -> to %HTTPD7

25.- Split variable -> %HTTPD1 | Spliter -> "

26.- Set variable -> %TITOM -> to %HTTPD14 (TITOM -> Temp min tomorrow )

27.- Set variable -> %TMTOM -> to %HTTPD16 (TMTOM -> temp max tomorrow)

28.- Set variable -> %WTOM -> to %HTTPD110 (WTOM -> weather tomorrow)

29.- Set variable -> %HTTPD1 -> to %HTTPD9

30.- Split variable -> %HTTPD1 | Spliter -> "

31.- Set variable -> %TIDAT -> to %HTTPD14 (TIDAT -> Temp min day after tomorrow )

32.- Set variable -> %TMDAT -> to %HTTPD16 (TMDAT -> temp max day after tomorrow)

33.- Set variable -> %WDAT -> to %HTTPD110 (WDAT -> weather day after tomorrow)

Now, we have the forecast information, stored in variables

34.- Clean variable -> %HTTPD1

35.- Clean variable -> %HTTPD10

36.- Clean variable -> %HTTPD12

37.- Clean variable -> %HTTPD11

38.- Clean variable -> %HTTPD110

39.- Clean variable -> %HTTPD111

40.- Clean variable -> %HTTPD112

41.- Clean variable -> %HTTPD113

42.- Clean variable -> %HTTPD14

43.- Clean variable -> %HTTPD15

44.- Clean variablee -> %HTTPD16

45.- Clean variable -> %HTTPD17

46.- Clean variable -> %HTTPD18

47.- Clean variable -> %HTTPD19

48.- Clean variable -> %HTTPD2

49.- Clean variable -> %HTTPD3

50.- Clean variable -> %HTTPD4

51.- Clean variable -> %HTTPD5

52.- Clean variable -> %HTTPD6

53.- Clean variable -> %HTTPD7

54.- Clean variable -> %HTTPD8

55.- Clean variable -> %HTTPD9

56.- Clean variable -> %HTTPD13

57.- Delete file -> sync

(Created for us in the first task)

----------------------------------------------

With this, we have obtained this variables, with this values:

LOCL -> Long name of the locality

LOCS -> Short name of the locality

WNOW -> weather now

TNOW -> temperature now

TITOD -> Temp min today

TMTOD -> temp max today

WTOD -> weather today

TITOM -> Temp min tomorrow

TMTOM -> Temp max tomorrow

WTOM -> Weather tomorrow

TIDAT -> Temp min day after tomorrow

TMDAT -> temp max day after tomorrow

WDAT -> weather day after tomorrow

----------------------------------------------------

C) Designing the weather widget.

Now we need Zoom for Tasker.

Le's put an example of a widget, sized 1x1, which gives us information about the locality we are in, the actual weather condition, with an icon, and the temperature condition.

First of all, opened zoom, we must create a widget in the template creation menu, sized as we want (in this case, 1 x 1), and name it. In the example: weather 1x1

Now, in the workspace, we must create three objects:

- 1 - An image, named as the variable which gives values (WNOW). For the image, we must pick any image from the icon pack that we downloaded before.

- 2 - A text, named LOCL. It's useful to type some text, to give the values of size, color, etc easilly. When Tasker starts to work, the text will be changed automatically.

- 3 - Another text, named TNOW.

We can add more images, like backgrounds, the forecast for other days, and so.

Now, we must resize an order the elements as we want.

----------------------------------

D) Giving values to the widget.

Returning to tasker, we need to create another task, to give values to the widget:

1.- Text element -> Element -> Weather 1x1/TNOW | text -> %TNOW ºC

Changes the text in the widget elemen TNOW for the variable %TNOW obtained before

2.- Text element -> Element -> Weather 1x1/LOC | text -> %LOC

3.- Image element -> Element -> Weather 1x1/WNOW | URI -> content://org.openintents.filemanager/mimetype//mnt/sdcard/tasker/widgets/icons/%WTOD.png

We have stored the icons pack before un the folder sdcard/tasker/widgets/icons and rename every of them with the name of all weather condition posibilities. I'm posting a list at the end of the post

The last thing is asigning a context for the tasks, to automatize the widgets information.

Create a time context, from 6:40 to 12:10, repeat every 30 minutes.

1st task -> weather variables (first task created)

2nd task -> widget information (second task created)

-----------------------------------------

Enjoy!

-----------------------------------------