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.