Leave a comment

How to install .bar in BB10 devices (Deployment for clients)

I use to work in BB10 platform also, and in development process, we need to send different builds at different milestones to the client.

In earlier BB devices, we can easily send deliveries to clients by

  • Installing through OTA Link – Create a build (.JAD/.COD) file(s), and deploy it to device using OTA Link.
  • Installing through SDCard – We can copy these files in parallel in some folder in our SDCard and install directly from there by clicking on .JAD file.

Next, If the build was made accurately the installation process initiate this way and now we have our app running in client’s device/phone.

Installing through App World Sandbox – upload the file to the vendor portal and keep in in draft mode and then add peoples BBID to the sandbox and then they can download it via BB World. (

But, for deploying .bar files for new BB10 devices/Playbook Manager, we can have

For Android Porting Apps –


Leave a comment

ProgressDialog in Blackberry

Being a blackberry developer since last 4 years,  I know people face problems to show a Progress Dialog or Wait Screen or Loading Dialog, while execution of some long processing in a background thread.

There are several good examples over the BB Support Forums and StackOverflow pertaining to the above issue. Today, I would like to share the code I use for this. I have 2 classes for this for this functionality.

    1. ProgressDialog extends PopupScreen
    2. ProgressSpinner extends Field
    3. loader.png (attached)


import net.rim.device.api.system.Display;

import net.rim.device.api.ui.Color;

import net.rim.device.api.ui.DrawStyle;

import net.rim.device.api.ui.Graphics;

import net.rim.device.api.ui.UiApplication;

import net.rim.device.api.ui.component.LabelField;

import net.rim.device.api.ui.container.HorizontalFieldManager;

import net.rim.device.api.ui.container.PopupScreen;

import net.rim.device.api.ui.container.VerticalFieldManager;

public class ProgressDialog extends PopupScreen {

private ProgressSpinner mProgressSpinner;

public ProgressDialog () {



public ProgressDialog (String text) {

super(new VerticalFieldManager(), DEFAULT_CLOSE);

mProgressSpinner = new ProgressSpinner(true);

HorizontalFieldManager hfm = new HorizontalFieldManager();


LabelField lblText = new LabelField(text, DrawStyle.HCENTER | FIELD_VCENTER) {

protected void paint(Graphics graphics) {





lblText.setPadding(0, 0, 0, 5);


hfm.setPadding(5, 5, 5, 5);



public void show(boolean show) {

if (show) {

if (!isDisplayed()) {




else {


if (isDisplayed()) {





public void paint(Graphics g) {

g.pushContext(0, 0, Display.getWidth(), Display.getHeight(), 0, 0);





import java.util.Timer;

import java.util.TimerTask;

import net.rim.device.api.system.Bitmap;

import net.rim.device.api.ui.Field;

import net.rim.device.api.ui.Graphics;

public class ProgressSpinner extends Field {

private int mFrameCounts;

private int mFrameWidth;

private int mFrameHeight;

private int mCurrentFrame;

private Timer mTimer;

private boolean mIsLarge;

private Bitmap mProgressImage;

private static Bitmap BIG;

private static Bitmap SMALL;

public ProgressSpinner(boolean large) {

mIsLarge = large;

if (BIG == null) {

BIG = Bitmap.getBitmapResource(“loader.png”);

SMALL = Bitmap.getBitmapResource(“loader.png”);


mProgressImage = large ? BIG : SMALL;

mFrameCounts = 12;

mFrameHeight = mProgressImage.getHeight();

mFrameWidth = mProgressImage.getWidth() / mFrameCounts;


protected void layout(int width, int height) {

setExtent(mFrameWidth, mFrameHeight);


public void paint(Graphics g) {

g.drawBitmap(0, 0, mFrameWidth, mFrameHeight, mProgressImage, mCurrentFrame * mFrameWidth, 0);


public int getPreferredHeight() {

return mFrameHeight;


public int getPreferredWidth() {

return mFrameWidth;


public void startProgressbar() {

final ProgressSpinner mProgBar = this;

TimerTask mTimerTask = new TimerTask() {

public void run() {


if (mCurrentFrame == mFrameCounts – 1) {

mCurrentFrame = 0;





mTimer = new Timer();

mTimer.schedule(mTimerTask, 0, mIsLarge ? 100 : 200);


public void stopProgressbar() {

if (mTimer != null) {


mTimer = null;



protected void onUndisplay() {





How to use?

ProgressDialog progress = new ProgressDialog ();; //to show;

This works awesome. Hope, You will be loving it too…!! Let me know how did it worked for you?

Leave a comment

Twitter API v1 Retired

As, we know Twitter API v1 is retired. We need to move to v1.1.

As the old APIs are retired, I have been facing issue with Twitter – verifyCredentials(). It was throwing IOException due to HTTP Response Code 410.

As, the Twitter APIs are changed, we need to update the Twitter jar, we are using in our applications.

I have got updated Twitter Jar from : i.e. twitter_api_me-1.9.

This is working like a charm. Enjoy tweeting with your apps..!! 🙂

Twitter Jar twitter_api_me-1.9 –



Spy Software for Blackberry 10

As per the fundamentals of Blackberry 10

It was assumed that there is no market for spy software  for Blackberry Smartphones running on OS 10.

But, from below link –

it is clear that Blackberry is providing developers –  Background Services framework which allows developers to bundle a separate process with their application to run in the background without a UI.

We can also check the above with release roadmap of BB NDK –

So, what does it mean?

It means that apps will no longer require an Active Frame to be open in order to function, That’s what we need to have a spy software.

I am going to try my hands on above certainly… keep an eye..!!

1 Comment

MultiLevel ListView Demo

This is a sample project to explain about multi level list views in our BB 10 Cascades project. I have used some static JSON files which are bundled inside the project as assets. ListViews displayed here are list of albums, list of songs under an album, and details of a song. This project do not use C++ files for accessing assets, parsing JSON data and populate them at runtime in Screens using QML Only.

  • Create a new Blackberry project in your BB NDK IDE. Select Project Type->”Cascades Application”-> “Standard Empty Project”. Enter Project Name
  • As our application will use some special libraries, we need to add following lines in our Projects “.pro” file

APP_NAME = MultiLevelListViewDemo

CONFIG += qt warn_on debug_and_release cascades


LIBS += -lbbdevice

LIBS += -lbbsystem


Here are some Screenshots of how Screen flows –

I have used 2 Custom Components here:

  1. HeaderTitle – Used as title bar for Screens
  2. MyListItem – Used as List Item for First Level ListView.

Also, you can download the project from here and “Import”->Existing Projects into Workspace->Select archive file->Check Project->Finish.

Download Link :


Blackberry Push Technology

What is Push Technology?

An Overview of Push Technology in Blackberry Platform

Some important information related to Push APIs

Basically, we need a Client-Side Application tolisten for Push Messages and a Server-side Application to fire Push Messages.

Server Side Push Application 

private static String password = “Your password here”;

private static String targetURL = “”;

private static final String APP_ID = “your app id here”;

public static void main(String[] args) throws PushSDKException, BadMessageException, UnauthorizedException {

org.apache.commons.codec.binary.Base64 b6;

//net.rim.pushsdk.acknowledgement.NotificationProcessorServiceImpl nsi;

IdGenerator idGenerator = new IdGeneratorImpl();

List<String> addresses = new ArrayList<String>();

String data = “this is a test message – 2”;

System.out.println(“Data is: ” + data);

addresses.add(“your PIN here”);

PushMessageControl pushMessageControl = new PushMessageControl(idGenerator, APP_ID, addresses);

Content content = new TextContent(data);

PapService papService = new net.rim.pushsdk.pap.PapServiceImpl();

PushSDKProperties properties = getBBProperties();

HttpClientImpl client = new HttpClientImpl();




PushResponse response = papService.push(APP_ID, password, APP_ID, pushMessageControl, content);



private static PushSDKProperties getBBProperties() {

PushSDKProperties p = new PushSDKPropertiesImpl();






return p;


Client Side Application