Over the last little bit, I’ve been doing a lot of work on some apps for BlackBerry 10. With January 30th fast approaching, I was coding like a madman to try and meet the deadline, so I can get my hands on some awesome swag.

I was able to pump out two good quality apps relatively quickly by using the Tart project from the blackberry-py project. Thanks to Peter Hansen (@peter9477), we can write entire apps using just Python, QML, and JavaScript that perform at near-native speeds. This workflow allows you to rapidly prototype your app, far outweighing any concerns about performance when compared to C++.

One of the apps I built uses a UI paradigm called “Pull to Refresh.” If the user is viewing a stream of data, they can pull down on the list and reveal a hidden item that notifies them they can refresh the stream contents by releasing their touch. A number of people have asked me how to implement this.

Again, because of the speed of development that’s possible with BB Tart, I was able to put together a crude, but workable sample demonstrating how to implement this feature. Furthermore, I even integrated it with ADN’s global feed. I simply pulled a couple of libraries from Github and putting the building blocks together. I went from idea to functioning sample in 12 hours, with 6 hours of sleep in between.

As you can see, everything you need is in the blackberry-py-pulltorefresh GitHub repo. The app was built on top of my blackberry-py-bootstrap repo. I’d be more than willing to accept help/pull requests on the project to help improve it for all developers. The file you should look at in particular is PullToRefresh.qml.

You’ll note that I implemented a LayoutUpdateHandler to monitor changes in the item. If the Y-coordinate is equal to exactly 0, then it fires the refreshTriggered() signal. In my testing, this works relatively well since the control will snap to 0 when it is released past the threshold. However, it can sometimes be triggered while the user is still interacting with the control. Therefore, a better way would be to detect if the user is touching the control, and only firing if they’re not.

I hope that helps most of you BlackBerry 10 developers looking to implement this in your app. When I first got this working, I couldn’t stop playing with it! Hopefully this gives you the jumpstart you need. Oh and take a look through the rest of the repository, there’s some good stuff in there including a way to asynchronously load remote images.

Google Chromebook and Ubuntu

Sun 16 December 2012 by Xitij Ritesh Patel

I got my Google ARM Chromebook!


I was really excited for this device. I’ve been using a thick, heavy, and relatively underpowered Acer laptop for the last 5 years. I really wanted something thin and light to do my development work on that I could use on the go ...

read more

Migrating to Amazon EC2

Sun 02 December 2012 by Xitij Ritesh Patel

I’ve been pining over the Google Chromebook lately, as I’ve been wanting to become more mobile with my developer setup. In an effort to make this a reality, I started looking at my options for a VPS.

I currently have two VPSes running, one with prgmr and one ...

read more

Why I Like BlackBerry 10 and Why I Don’t Hate iOS/Android

Tue 27 November 2012 by Xitij Ritesh Patel

Some of you may know that I do quite a bit of development work. I’ve consulted on a number of projects through my company Pulsecode and more recently, I’ve worked on bootstrapping my own startup, taab. In my endeavours, I’ve been exposed to a number of platforms ...

read more

Building a FreeNAS Box

Sun 25 November 2012 by Xitij Ritesh Patel

I’ve been having a lot of trouble lately trying to figure out the best solution for backing up my data. Recently, I’ve been accumulating a large number of files, photos, and videos that I’d like to keep safe. Moreover, I’d like this data to be accessible ...

read more

Compiling tesseract for BlackBerry 10

Wed 21 November 2012 by Xitij Ritesh Patel

I’ve been on a hiatus from the blog for some time, so I figure I’ll write something up that should be useful to a few people.

Recently, I had an idea for an app, and part of it would utilize some OCR capabilities. Some quick Google searching revealed ...

read more

Signing up with prgmr

Wed 13 June 2012 by Xitij Ritesh Patel

I’ve used several different VPS providers in the past. My first experience was with Slicehost, with whom I was happy with until about 1.5 years ago. I decided that I was fed up with their lack of competitiveness against other providers.

I switched to Linode, which I use ...

read more

PySide on the BlackBerry PlayBook

Thu 24 May 2012 by Xitij Ritesh Patel

Since BlackBerry 10 Jam, I’ve been spending a lot of time doing development on the BlackBerry platform. Most of it has been related to my efforts at taab, but this past week, I decided to tackle something new on the BlackBerry PlayBook.

If you’ve been keeping up with ...

read more
Fork me on GitHub