All times are UTC




Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Tutorial: BerryWeather 3rd Party App Support
PostPosted: Fri Mar 05, 2010 12:23 am 
Offline
Site Admin
User avatar

Joined: Sat May 16, 2009 11:39 pm
Posts: 2101
Location: Hamburg, Germany
Device: BlackBerry 9900, Samsung Galaxy S2
We are excited to announce support for 3rd party app access to BerryWeather data in BerryWeather 2.2. This allows any developer to easily access BerryWeather's home location conditions via a simple interface to use in their own apps.

BerryWeather exports the data as a Hashtable stored in a RuntimeStore. The guid of the RuntimeStore is 0x7f0ad179383f30edL. The Hashtable will be empty if there is currently no data available (this will usually happen after boot before all locations have been updated).

If no data is available in the RuntimeStore (it returns NULL) this means BerryWeather has not been installed on the device or the version installed does not support 3rd party apps (all versions before 2.2). You can direct users to http://m.bellshare.com/berryweather for download of the latest version

The RuntimeStore can be accessed as follows:

Code:
private static final long ExportRuntimeStoreId = 0x7f0ad179383f30edL;

Object d = RuntimeStore.getRuntimeStore().get(BerryWeatherHelper.ExportRuntimeStoreId);
if(d != null && d instanceof Hashtable)
{
   Data = (Hashtable) d;
}
else
{
   Data = null;
}

The returned Hashtable will contain the following keys. Please be aware that any of the values might be NULL:

icon - Bitmap, current condition icon of home location
iconscaled - Bitmap, current condition icon of home location scaled as set by "wallpaper icon size" in BerryWeather settings
name - String, name of home location
conditions - String, current sky conditions (Clear, Sunny etc) of home location
temperature - String, current temperature of home location
temperaturelow - String, low temperature of home location
temperaturehigh - String, high temperature of home location
observed - String, observation time of conditions for home location
observedepoch - Integer, Observation time in Unix epoch
feelslike - String, feels like temperature for home location
iconname - String, name of condition icon of home location

The RuntimeStore will update whenever BerryWeather downloads new data for the home location. If you want to be notified of any changes in the data you can listen for a global event. The guid of the global event is 0x37b66763f3b37dbdL

To listen for the event you have to implement the GlobalEventListener interface and register a global event listener:

Code:
private static final long GlobalEventExportRuntimeStoreUpdated = 0x37b66763f3b37dbdL;

Application.addGlobalEventListener( this );

public void eventOccurred( long guid, int data0, int data1, Object object0, Object object1 ) {

   if( guid == GlobalEventExportRuntimeStoreUpdated ) {
      // access data via RuntimeStore or use (Hashtable)object0
   }
}

The Hashtable stored in the RuntimeStore will also be passed as object0 in the global event.

If you have any further questions post here or contact me directly via PM.


Top
   
 
 Post subject: Re: Tutorial: BerryWeather 3rd Party App Support
PostPosted: Mon Mar 08, 2010 4:22 pm 
Offline
Moderator
User avatar

Joined: Sun Jul 05, 2009 6:28 pm
Posts: 668
Location: AR
Device: 9800/6.0.0.141
H,

Does this mean more new apps to test, LOL???

_________________
THBASSMAN

Carpe Diem!!

thbassman@pinstack.com

Check this out!!! BLACKBERRYSPOT

Bellshare Rocks!

Activation code support Freqently Asked Questions


Top
   
 
 Post subject: Re: Tutorial: BerryWeather 3rd Party App Support
PostPosted: Mon May 24, 2010 9:45 am 
Offline
Bellshare Newbie

Joined: Tue May 04, 2010 7:03 am
Posts: 1
Device: 8520 OS 4.6.1
Just to confirm: 3rd Party App Support should work for BerryWeather, BeWeather and BeWeather free (version 2.2 and above)?

I'm asking this, because one of our customers has BeWeather (2.2.2 paid version) installed but it seems that the weather data is missing.


Top
   
 
Display posts from previous:  Sort by  
Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group