BB10Jam Session: Building Connected Apps with Cascades

image: from dreamstime.com (click to see the source)

In today’s world of social networking everyone is connected with everyone around some corners. The result for many mobile developers sooner or later: they’ll get the requirement to access API’s of Twitter, Facebook, Foursquare, Github, Vimeo, Google, LinkedIn, Dropbox, Evernote and and and ….

This session was a community session, presented by Kyle Fowler. Kyle is a mobile developer at Foursquare and it turned out that we both already had discussed during the closed beta of Cascades in the beta forums. That’s the nice thing about attending conferences: to meet the person who is behind a account.

Foursquare (20+ million users , 20k+ API developers, 1.5 billion CheckIn’s) will publish a BB10 Application at product launch of BB 10 and Kyle talked about his experiences. What do we need to connect to networks such as Foursquare:

  • 3rd Party OAuth data providers
  • Cascades UI framework and APIs
  • Qt – based OAuth Library

OAuth v1 / OAuth v2 / xAuth allows us to access user accounts. Kyle demonstrated HowTo connect with Twitter from BB10 using the Qt SIGNAL / SLOT – concept.
This was followed by the processing of data (request, response, parsing) and then sending the data to Cascades UI.

Here’s a small C++ code example for the authorization with OAuth2 at FourSquare:

void FoursquareAPI::login() {
	connect(
		oauthManager,
		SIGNAL(authorizationReceived(QString, QString)),
		this,
		SLOT(onAuthorizationReceived(QString, QString))
	);
	// send to Browser for authentication
	oauthManager->getOauth2UserAuthorization(
		QUrl("https://foursquare.com/oauth2/authenticate"),
		CONSUMER_KEY,
		extraParams
	);
}

Kyle demonstrated how easy 3rdParty Libraries, C++ Code and QML could be combined. Here’s what you need for a QuickStart:

The sample also demonstrates Cascades JSON parser and HowTo separate layout logic from business logic. At the end you learned to authenticate the user, make requests, parse data and bind the data to Cascades UI.

BB10Jam Session: The Anatomy of a BlackBerry 10 App

If you’re just new to BlackBerry 10 development and, for example (like me) previously only have written Java applications, you should become familiar both with the Eclipse IDE for C++ (QNX Momentics) and with the project and application structure of BB 10 APP’s. David Cummings and Elena Laskavaia from QNX talked about the anatomy of a BlackBerry 10 application in detail.

At first, some application guidelines to follow:

  • integrate your Application with the OS, wherever possible
  • use thew Invokation API in order to facilitate the user’s FLOW
  • observe the application life cycle
  • use Threads to improve performance (BB10 is a multi-threaded, multi-tasking OS)
  • be aware of the application – sandbox layout: there are shared / application-local / read-only areas
  • use UI layouts without absolute positioning of elements
  • provide Icons and splash screens for different devices / density / orientation
  • i18n your applications (BB10 currently supports 26 languages)
  • for updates, use the same signature keys – only then existing app-specific data is preserved
  • services may come and go, but the app has to work at any time – coming from the OSGi – world (like me) this is the first lesson you have to learn 😉
  • specify access rights in the METADATA, but be aware that users can refuse individual permissions

Again: some guidelines are valid for development at all mobile OS, some are very specific for BB10.

Signals and Slots

image: from dreamstime.com (click to see the source)

In BB 10 there are many many services and sensors where you have to react on property changes (see also above the session about intelligent applications).

The SIGNAL / SLOT concept of Qt is very good to deal with this – may it be from C++ code or from Cascades / QML code.

Application Lifecycle, Sandbox

Package, Debug, Deploy

An always unpopular topic is the application – packaging and deployment. BB10 packages applications as .BAR files, which contain Metadata and compiled code, icons and other assets, etc. The packaging is done automatically from your beloved Eclipse IDE, where you can select whether the application should run on the simulator or on real device. You can also select if the build should be done in development mode or as a release.

Debugging can be done in the simulator or directly on the device. BlackBerry applications are secure and require the signing of applications. Under BB Java this was a very complicated and time consuming task. It is now way easier with BB 10: you can generate a debug token that is installed on the device and thus allows for 30 days of testing and debugging unsigned applications in development mode. Only as last step if
you want to submit your release at AppWorld, your Apps must be signed before. The signature keys can be get for free and keys can be used on more than one computer.

next page →


  1. Intro
  2. Death Spiral’. Why developing BB, Who on Earth…
  3. How it all began, Farewell Java ME, the ‘old’ RIM vs. ‘not your fathers’ RIM, I’m independent
  4. BB10 is a Platform, Cascades more then a UI Framework
  5. Thorsten Heins: the hard Way to BB10, BlackBerry 7 is alive
  6. Alec + Chris rockin’ …, BB10Jam Conference, Creating intelligent Apps
  7. Connected Apps with Cascades, Anatomy of a BB10 App
  8. Native Camera API, NFC Apps
  9. Location-Based-Services
  10. Flow + Invokation Framework
  11. Party, SDK, AlphaDevice, Keyboard, Magic Moments
  12. Markets: Consumer, Enterprise, Government, Automobile
  13. BB10 around the World, Apps Apps Apps…, Open Source
  14. Mission RIM possible ?, Empower People like never before ?, Three Wishes

next page →

Advertisements