We are pleased to announce two new repositories of Open Source code for the BlackBerry® development platform. We have a repository of Java® sample code, which includes our BlackBerry JDE samples from the 7.0 SDK and a repository of samples previously released through our Knowledge Base. Now these popular code samples are available through the Apache License, version 2.0, which allows developers full access to use these code samples in their applications and extend the samples further.
If you aren’t familiar with the samples included in the BlackBerry tools, I’d recommend taking a look at our JDE-Samples repository if there is an API you are curious about. There are 100+ samples included which cover each major API. Our JDE-Samples repository will include these samples for each version of the SDK.
This repository uses Github’s support of branches (e.g. see Pro Github’s Chapter 3), to keep the samples for all the JDE releases in the same directory. For example, the in-device samples for JDE 4.6.1 are here. There are currently 8 branches, plus the master branch. There are also 8 tags, one for each of these branches.
Our Samples-for-Java repository includes five sample applications and we will continue to add more in the future. The popular Advanced UI sample – with its many containers and components – is included. The Knowledge Base article for this sample shows some example screenshots so you can see what it can do. We’ve also included the Simple Location API, the Titlebar API, and sample apps for Analytics and a YouTube® client. Read on for more details on these samples.
Advanced UI: If you have ever wanted to take your UI designs further, this is the first place to look. There are several button extensions included, allowing you to use Bitmaps for buttons, use Embossed buttons, create hyperlinks and button lists. There are also toggle switches, sliders, ratings, and pill buttons that you can use in your applications. Advanced managers allow you to quickly create new layouts, like justified horizontal and vertical layouts, or 2-column screens. Finally, progress animations and bitmap gauge fields add polish to your UI.
Additional details and more screenshots like the one above are available in the Implement advanced buttons, fields, and managers article.
Simple Location API: Using GPS is not always the easiest task, and this code aims to change that for when you just want location information. It automatically handles carrier and device hardware support differences and battery usage concerns.
More details in the Knowledge Base article Simple Location API.
Titlebar API: Many different applications have a need for consistent system displays in their application. Basics like network coverage, the time, or the name of an application are desirable standards for an application to display at the top of the screen. In the BlackBerry Java SDK v.6.0, the Titlebar API was created for this purpose, but there are still plenty of OS 5.0 devices out there, and some of us need to support some of the 4.x code lines as well. This library attempts to port that 6.0 Titlebar API back as far as the 4.2.1 SDK. A preprocessor based wrapper allows you to code with one Titlebar class and build with any version of the SDK from 4.2.1 through 7.1.
The full Knowledge Base article including images is available: How To Implement a TitleBar with Signal Strength, Battery Level, Icon, Unread mail and Clock
Analytics Sample: This sample implements each of the BlackBerry Analytics SDK methods so you have a handy reference. If you sign up for the service, this sample is included in the SDK download, but with it being open sourced we can continue to expand on it.
YouTube Client: Originally published to both our blog and YouTube’s blog, this sample shows you how to work with the YouTube Data API using the BlackBerry Communication API from the 6.0 Java SDK. It’s a great starting point for either API or if you are doing a quick proof of concept with YouTube interaction. Further details in the Knowledge Base article: How to – Create a YouTube viewer with the BlackBerry 6 Communication API.
Check them out and see where the code takes you!