Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,452 Members 42,289 Now Online
XDA Developers Android and Mobile Development Forum

Edit the HTC sense weather location database - Updated for Sense 2.x up

Tip us?
 
Hotrod68
Old
(Last edited by Hotrod68; 9th January 2013 at 03:53 AM.) Reason: Change of database in ICS and Jellybean roms
#1  
Hotrod68's Avatar
Member - OP
Thanks Meter 23
Posts: 56
Join Date: Dec 2008
Location: Tumwater, WA
Default Edit the HTC sense weather location database - Updated for Sense 2.x up

Edit the HTC sense weather location database.


For editing sense 1.0 weather databases, use the method immediately below. Information for editing sense 2.X and above is shown in the section marked “New directions for editing the weather database in sense 2.X” below .


After much searching with no results I finally came up with a way to add locations to the HTC Sense weather database. If this has been posted before sorry for the redundant post but I could not find this anywhere and thought it might help some people. The file to edit is located in the phone at /data/data/com.htc.provider.weather/files/WP_0409WWE.db. To get the file you need to be rooted and have Root Explorer from the market or QtADB (http://forum.xda-developers.com/showthread.php?t=972758) which make moving the file from the phone to the PC and back very easy.

1. With Root Explorer, copy the WP_0409WWE.db file to the Sdcard and then copy it to your computer for editing. I use QtADB to move files. Just plug the phone in and leave it on charge only. QtADB will bring up a phone and PC directory side by side and you can migrate to the file and drag it to a directory on the computer.

2. To edit the database, you can use a free SQLite Database Browser found at http://sourceforge.net/projects/sqlitebrowser/. Open the WP_0409WWE.db file in the editor and then click on the Browse Data tab. In the Table drop down list, choose locationlist. At the bottom of the page, click the forward arrow until you reach the end of the file, then scroll to the bottom of the list. Now add your own city using the format as shown in the table. To do that, click ‘new record’ at the upper right and a new line will appear at the bottom of the list. To edit the database cells with SQLite editor, double click on a cell and an editing window will pop up. Click in the window, input your info, and click ‘apply changes’ at the bottom of the window.

3. Since the file uses Accuweather, you’ll want to make sure that Accuweather has data for your city. Just go to the Accuweather.com website and put your city in the search. If Accuweather doesn’t find your city, then find the city that is closest to your location.

4. Once you are satisfied with your edits, save the file and replace the file in your phone with your new file. This is where QtADB makes copying files easy. Just drag and drop from one window to another and you’re done. Reboot your phone and enjoy your new locations.



New directions for editing the weather database in sense 2.x roms.


Have been using the new sense 2.x roms and have found that the SQLite Browser in the above directions will not edit the new weather database. The easiest way I have found for the new database format is with the SQLite editor by Speed Software form the market as suggested by Polar67 in post number 11. This is a purchase app so it requires a little cash outlay. Here are Polar67's directions with a slight modification of using SQLite editor rather than Root Explorer to locate the database. Please thank Ploar67 for this method.


1: Navigate to /data/data/com.htc.provider.weather/files

2: Backup original databases to secure location.

3: Open SQLite editor and it will display a list of databases with Weather Provider (com.htc.provider.weather) at the bottom.

4: Tap on Weather Provider and open the WP_0409WWE.db file.

5: Find location near what i want to add & clone.

6: Edit clone to fit my new location.

7: Save -> Reboot -> Done.


Another method starts the same as the sense 1.0 version, but uses the free SQLite editor, SQLite Expert Personal http://www.sqliteexpert.com/SQLiteExpertPersSetup.exe.

1. With SQLite Expert open the WP_0409WWE.db. The database will be listed in the left pane. Open locationlist and find a location close to what you need. Double click anywhere in the row and it will bring up the record for editing.

2. Copy the location code, then close the window. Click on the plus icon in the row above the data list to add a new record. Paste the weather location you copied into the code field. At this point, you can either go back and forth copying and pasting or just fill in the fields manually. When pasting the location code IE: NAM|US|WA|EAST OLYMPIA, you can just edit the state and city to the location you want as in NAM|US|WA|OAK HARBOR to NAM|US|FL|KEY WEST.

3. If you want to check that your location will bring back weather, try your location in Accuweather.com first.

4. When you are done close the database and copy it to your phone. Reboot and fill your widget with your custom locations.


As a side note the citied listed on the weather widget are located in the /data/data/com.htc.provider.weather/databases/weather.db. When you have them the way you want copy that and WP_0409WWE.db to a safe location on your SD Card. When you load a new ROM, copy them to their respective locations, and your weather is set.


For the cooks in the audience, the database is located in the system/etc/WPDB.zip file. It is a multi language file and you can safely remove the languages you don't need.

The database location for ICS and Jellybean has changed to system/app/WeatherProvider.apk.

If this has helped you clicking the thanks button is appreciated.
The Following 12 Users Say Thank You to Hotrod68 For This Useful Post: [ Click to Expand ]
 
sshark
Old
#2  
sshark's Avatar
Senior Member
Thanks Meter 24
Posts: 562
Join Date: Sep 2008
Thanks dude, I will try this out. The city where I live in (small burb of H-town) is not in HTC db and this may come handy!
 
Hotrod68
Old
#3  
Hotrod68's Avatar
Member - OP
Thanks Meter 23
Posts: 56
Join Date: Dec 2008
Location: Tumwater, WA
Glad you find this useful. Hopefully I got all the directions down if not just ask. When I get enough posts I'll try to add the download links.
 
Fightspit
Old
#4  
Fightspit's Avatar
Senior Member
Thanks Meter 338
Posts: 1,052
Join Date: May 2010
Location: Paris
I think it will be interesting to start a project about creating a huge list of cities of the world. Otherwise, it is possible to create several list for each country or continent because of the huge number of cities available in the world
 
Polar67
Old
#5  
Polar67's Avatar
Senior Member
Thanks Meter 16
Posts: 119
Join Date: Sep 2008
Location: Nanortalik
Talking Re: Weather location database

Hi!

Thanks a bundle. Tried your suggested approach.
Don´t know if this is an issue with all devices running anything else than english.
For the sake of detail i probably should mention that my device is a Desire HD.
However both are Android devices & since the guide originated here i´ll put this post here instead of starting a similar thread on the same topic elsewhere.

Anyway: As you can see on the attached screen dump I found 2 databases. BlablaWWE.db & a language specific version. I tried editing the WWE-base only but that resulted in a force closure of the weather App.
I had to edit both databases to match in order to acheive the desired result.

Regards
ELO
Attached Thumbnails
Click image for larger version

Name:	20110305184950.jpg
Views:	474
Size:	22.1 KB
ID:	535046  
The Following User Says Thank You to Polar67 For This Useful Post: [ Click to Expand ]
 
appsmotocliq
Old
#6  
Junior Member
Thanks Meter 0
Posts: 2
Join Date: Aug 2010
Can this be done on hero?
 
Hotrod68
Old
#7  
Hotrod68's Avatar
Member - OP
Thanks Meter 23
Posts: 56
Join Date: Dec 2008
Location: Tumwater, WA
Quote:
Originally Posted by Polar67 View Post
Hi!

Thanks a bundle. Tried your suggested approach.
Don´t know if this is an issue with all devices running anything else than english.
For the sake of detail i probably should mention that my device is a Desire HD.
However both are Android devices & since the guide originated here i´ll put this post here instead of starting a similar thread on the same topic elsewhere.

Anyway: As you can see on the attached screen dump I found 2 databases. BlablaWWE.db & a language specific version. I tried editing the WWE-base only but that resulted in a force closure of the weather App.
I had to edit both databases to match in order to acheive the desired result.

Regards
ELO
Hi Polar

Thanks for the find about editing the other language file. My rom is english only so I didn't see the othe laguage files. I would like to add you findings to the first post if you don't mind.

Did you use the programs for moving and editing the files from the first post or did you use something else that would make the proccess easier? It would be nice to have this as staight forword as possible.

Hotrod
 
Hotrod68
Old
#8  
Hotrod68's Avatar
Member - OP
Thanks Meter 23
Posts: 56
Join Date: Dec 2008
Location: Tumwater, WA
Quote:
Originally Posted by appsmotocliq View Post
Can this be done on hero?
Appsmotocliq

If you are using a sense rom backup your data file and give it a try.

Hotrod
 
Hotrod68
Old
#9  
Hotrod68's Avatar
Member - OP
Thanks Meter 23
Posts: 56
Join Date: Dec 2008
Location: Tumwater, WA
Quote:
Originally Posted by Fightspit View Post
I think it will be interesting to start a project about creating a huge list of cities of the world. Otherwise, it is possible to create several list for each country or continent because of the huge number of cities available in the world
Fightspit

A datadase of all locations would be handy but rather large. If it were broken down into each counrty or even states it might be easier to handle. If anyone would like to take this on that would be great.

Hotrod
 
sonoftobit
Old
#10  
Junior Member
Thanks Meter 2
Posts: 19
Join Date: Dec 2010
Location: Munich
If you're not seeing your city's code but rather something like this accuweather.com/.../quick-look.aspx in the browser bar you can use accuweather.com/rss-center.asp instead.

Sorry for the broken link but I'm not permitted to post links as a newbie and I had to find a way around. ;)

The Following User Says Thank You to sonoftobit For This Useful Post: [ Click to Expand ]
Tags
evo weather, sense weather
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes