Skip to main content

skip to main content

developerWorks  >  Open source  >

Create BlackBerry applications with open source tools, Part 3: Building a social-networking application

developerWorks
Page 1 of 9 Go to the next page

Document options
PDF format - Fits A4 and Letter

PDF - Fits A4 and Letter
334 KB (25 pages)

Get Adobe® Reader®

Sample code


My developerWorks needs you!

Connect to your technical community


Rate this tutorial

Help us improve this content


Level: Intermediate

Frank Ableson, Author

17 Mar 2009

The most intriguing and powerful phenomenon in the digital age is the impact of social-networking applications on the consumer and business markets. Marketing professionals are changing how they interact with prospective clients, peer groups can easily form, and, as demonstrated in the fall of 2008, social networking can be part of a successful political campaign. Combined with the popularity and power of the BlackBerry platform, you have the makings of a dynamic combination. Part 3 of this "Create BlackBerry applications with open source tools" series explores how the BlackBerry is a great device for writing and deploying social-networking applications.

Before you start

This series explores open source and Java™ technology for BlackBerry application development in the context of a mobile data-collection application. Part 1 provides an introduction to BlackBerry development with a quick introduction to the platform, a tour of the BlackBerry development tools, and construction of a complete data-collection application. Part 2 explores the RSS data-distribution format by creating a BlackBerry RSS reader.

This tutorial is for Java developers interested in BlackBerry application development in the context of social-networking applications. The example demonstrates a rudimentary social-networking application that leverages the freely available BlackBerry development tools. Mobile development experience is helpful, but not required. Java programming skills are required for BlackBerry applications, but are not an explicit requirement for this tutorial. Likewise, familiarity with social-networking concepts is helpful, but not required.

About this tutorial

Why write a social-networking application for BlackBerry? Social networking is all the rage, and people want to take this experience with them wherever they go. Many social-networking users carry BlackBerry devices. The BlackBerry platform is rich and ripe for social networking. Its capability as an Internet-accessing device is solid, its reputation as a messaging platform is legendary, and one important feature that most BlackBerry devices boast is a full keyboard. Having a camera is handy, but the power lies in a keyboard where users can rapidly type messages to friends or business associates. The BlackBerry environment also presents an open programming infrastructure where you can "catch" or hook many events of interest. These capabilities open many possibilities for feature-rich social-networking applications.

This tutorial is not singularly blazing new trails; there are already commercially available social-networking applications for the BlackBerry. This tutorial's sample application demonstrates how to build a useful open source application centered around social networking. Learn to add a custom menu into an application and implement a "Share this Event" feature that highlights interacting with the contacts database and the calendar events on the BlackBerry. Contacts and events are part of the larger, more general set of data known as Personal Information Management (PIM). Once you understand how to interact with the PIM data on a device, the social-networking opportunities are limited only by the imagination.

This tutorial provides a brief introduction to PIM data, then dives into the requirements for a BlackBerry social-networking application. Download the complete source code for the example BlackBerry application.



Back to top


System requirements

This tutorial demonstrates how to use BlackBerry development tools to construct an open source social-networking application for the BlackBerry. You will need the BlackBerry Java Development Environment (JDE) or equivalent to construct the application.

Sample code highlights

In this tutorial, a social-networking application named IBMCalendar is constructed for the BlackBerry. As you go through, try to think beyond the basics; this data may be used in the social-networking applications you use today. Download the source code. Snippets include:

ContactList
To work with a list of contacts from the PIM database.
IBMCalendar
The Application class, and contains the entry point of the application.
IBMCalendar constructor
Method that demonstrates how to add a menu item to the built-in BlackBerry applications.
CalendarMenus
Class containing the Menu UI element, which is added into the calendar/date-book application on the BlackBerry.
CalendarMenus.run()
Method invoked when a user selects the custom menu added to the DateBook application.
CalendarMenus.toString()
Method that sounds rather simple (and it is), but is very important. This is where the textual name, or label, of the menu is controlled.
CalendarMenus.handleCalendarEvent()
Method invoked when a date-book entry or event is manipulated by the custom menu added to the date-book application.
BlackBerryContactList
Class employed to provide a contact lookup for finding a user's e-mail address. This class demonstrates interacting with the PIM database from a high level.
Event and Contact
Classes used to extract data from the BlackBerry PIM database.
SendEmail
Class that interacts with the BlackBerry's messaging infrastructure to send an e-mail programmatically.


Back to top



Page 1 of 9 Go to the next page