BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-06-2007, 01:18 PM   #1 (permalink)
Retired BBF Moderator
 
Mark Rejhon's Avatar
 
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: Bold
Carrier: Rogers
Posts: 4,870
Post Thanks: 1
Thanked 0 Times in 0 Posts
Default Developer exercise: Add easy city search/add to BBWeather (source provided!)

Please Login to Remove!

You users who are familiar with BBWeather, know you have to configure it with a 8 character city code before it loads weather for a specific city. The problem is that this requires someone to look it up on the Internet using a separate search. This needs to be simplified so that all you have to do is enter a city name and it will automatically determine the code for the city (via automatic execution of a search over HTTP).

BBWeather source code is easily available (see this post) as it is open source.

I'd like one of you developers (who's looking for an easy exercise to sharpen BlackBerry development skills) to add an automatic "area code" search into BBWeather, so I can just type in the city name instead of trying to remember 8-character codes such as CAXX0351. It may be as simple as sending a regular HTML search query http://www.weather.com/search/enhanced?where=<cityname> to weather.com and then parsing the resulting HTML screen for the 8-digit code. There may be multiple search results, so if that happens, just pop up a BlackBerry screen giving a choice of matching search results.

Once you do that, post your compile here and it can be submitted straight back to SourceForge (where BBWeather comes from) so that others can benefit from your improvement to BBWeather!

Please note, I am not the developer of BBWeather, so can't answer specific questions about BBWeather. I'd do it myself, but I'm paid to do BlackBerry development in my main working hours and don't have the time for independent development anymore after hours. However my contribution of a QuickNote text editor and QuickCompose open-source BlackBerry applications helped me get my name around too (good resume material). So make that change to BBWeather, and contribute it, and you may have a bit of BBForums fame that helps you, because this is such a popular free weather-forecast utility for BlackBerry!
__________________
Thanks,
Mark Rejhon
Author of XMPP extension XEP-0301:
www.xmpp.org/extensions/xep-0301.html - specification
www.realjabber.org - open source

Last edited by Mark Rejhon : 09-06-2007 at 01:23 PM.
Offline  
Old 09-10-2007, 09:00 AM   #2 (permalink)
akg
Talking BlackBerry Encyclopedia
 
akg's Avatar
 
Join Date: Feb 2007
Location: Dallas, TX
Model: 9700
OS: 6.0.0.344
PIN: Mont Blanc
Carrier: AT&T
Posts: 439
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wirelessly posted (BlackBerry 9000: BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/102)

Mark,

I've read people write about these city codes and I figure it must have changed at some point, because I can put in ZIP codes and they work just as well as the city codes. This has worked for me for the 7 months I've been using this software, so someone must have made this "improvement" already.
__________________
[SIGPIC][/SIGPIC]BESAdmin

BES 4.1.6 Exchange 2003 SP2
Offline  
Old 09-10-2007, 09:07 AM   #3 (permalink)
BBF Moderator
 
Stinsonddog's Avatar
 
Join Date: Mar 2005
Location: Northern California
Model: 9700
PIN: Agaboobie
Carrier: AT&T
Posts: 5,518
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you do this, note that there is actually a .75 version. See my site which does two things. First is alpha's the city list, and second it has a QWERTY shortcut - Alt-space to refresh the weather.
__________________
Shortcuts Rule!! Download Link:[Stinsonddog's Blackberry Tips ] GET TORCHED
@ Stinsonddog
Offline  
Old 09-13-2007, 10:49 AM   #4 (permalink)
New Member
 
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Would you like source code or a patch?

I also fixed the new/edit/delete options so they show up whether you click the trackball or menu button.
Offline  
Old 09-13-2007, 10:52 AM   #5 (permalink)
akg
Talking BlackBerry Encyclopedia
 
akg's Avatar
 
Join Date: Feb 2007
Location: Dallas, TX
Model: 9700
OS: 6.0.0.344
PIN: Mont Blanc
Carrier: AT&T
Posts: 439
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's a nice change with the trackball/menu click.

As for the city code, why not just use the ZIP code? I've never needed the city code to use BBWeather.
__________________
[SIGPIC][/SIGPIC]BESAdmin

BES 4.1.6 Exchange 2003 SP2
Offline  
Old 09-13-2007, 10:54 AM   #6 (permalink)
BBF Moderator
 
John Clark's Avatar
 
Join Date: Jun 2005
Model: Z30
OS: 10.2.1.x
PIN: s & needles
Carrier: AT&T
Posts: 34,679
Post Thanks: 4
Thanked 96 Times in 71 Posts
Default

I frequently go places where I don't know the zip code either. BBToday has this feature of looking up the weather code. I used to use that then type it into BBWeather.

It would be a nice feature to have added to this great app. I'd love to see it and would be very worth it to me.

Great idea, Mark!
Offline  
Old 09-13-2007, 05:28 PM   #7 (permalink)
New Member
 
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by akg View Post
That's a nice change with the trackball/menu click.

As for the city code, why not just use the ZIP code? I've never needed the city code to use BBWeather.
i had already implemented it before i saw this post.

Edit: added code. 1 new file, plus 1 modified file.


I also noticed today that the URL http://www.weather.com/outlook/travel/vacationplanner/map/<CITY CODE>

gives you the screen with the doppler radar map, so it should be pretty easy to add that. Theres a few other maps but it looks like they wont be quite as easy to screen scrape. I'm working on something else right now so that will have to wait.
Attached Files
File Type: zip bbweather_location_search.zip (5.4 KB, 6 views)

Last edited by kreneskyp : 09-13-2007 at 09:59 PM.
Offline  
Old 09-19-2007, 07:58 PM   #8 (permalink)
New Member
 
Join Date: Jun 2006
Model: 8310
Carrier: rogers & bell
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you kreneskyp,
nice dialog work,


to all of you saying that zip codes work,
it is us canadians that need this because weather.com doesn't translate canadian postal codes.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.