BlackBerry 10 Cascades: Create a Custom Control (DropDownList)


Last week I attended the BlackBerry Jam conference in San Jose (Conference recordings and samples available here). It was one of the most interesting events I've been to all year and I gained a lot by attending. With that said, there was a LOT of information presented and I felt like I was drinking from the firehose most of the time.

Now that I've had a few days to digest what was presented I've embarked on creating a few apps for the new BB10 platform. In applying my knowledge towards a goal (creating an app) I found a limitation in one of the core Cascades controls (DropDown) that I had to work-around by creating a custom control. This article will document how to create a simple custom control based on DropDown which will allow you to dynamically add additional Options to the DropDown using QML instead of C++.

14-Oct-2012 - I updated the code sample to resolve an issue reported in the comments. Also, See the bottom of the post for a way to accomplish this task WITHOUT using the custom control. RIM got back to me with a better way to do it. :)

 

19-July-2013 - A reader wrote me to let me know that there is a possibility of Memory Leak using this approach. here are his comments:

Specifically, the suggested use of ComponentDefinition, if the drop down has to be reloaded repeatedly, the objects will be leaked.

For example:

    function populate(numPieces) {
        var optionList = [];

        for (var i = 0; i < numPieces; ++ i) {
            var opt = newOptionDef.createObject();
            opt.text = i;
            opt.value = i;
            optionList.push(opt);
        }

        pieces.removeAll();
        pieces.options = optionList;
    }

The removeAll will leave the dynamically created objects parent set to the dropdown (pieces). If that dropdown persists (in my case in an AttachedObject sheet) they will leak.
I'm not sure if their is an elegant solution to clean them up though.

How to install and configure GNU Mailman on Centos 6.2


GNU Mailman allows you to setup, administer and maintain email lists. This article shows how to get it setup on Centos 6.2


My experience responding to an Apple App Store Trademark Infringement Claim


I must say I certainly didn't see this one coming. Ravensburger AG submitted a Trademark infringement claim against my app Pocket Bombs to Apple. I recently received an email fom Apple Legal indicating that Ravensburger believes that my app infringes upon their REVERSI trademark. Apple's advice? Pull the app from the market place or respond with evidence proving that my app doesn't infringe.

The most interesting part is that nowhere in the email did it mention how I had infringed. It is kind of hard to resolve a problem when you don't know WHAT the problem is. :)

Updated on 16-OCT-2012


How to use Bouncy Castle Lightweight API's TLSClient


In a previous article I explained how to get Bouncy Castle compiling into a BlackBerry application. This article takes things one step further and demonstrates how to use the TLS functionality in the Bouncy Castle light-weight API to examine server certificate chains.


How to: Bouncy Castle on BlackBerry


While RIM does provide a Cryptographic API for their BlackBerry smartphones there are times when what is provided out of the box just isn't enough. In my case I was creating a mobile application that needed to retrieve infomation about TLS certificates presented on a socket / port by a server. While the RIM API has a 'Certificate' object, it does not allow you to get the encoded public key information.

To get around this problem I turned my attention to the Bouncy Castle Lightweight API which is suitable for use with the J2ME platform (BlackBerry included). As seems to be the case with Bouncy Castle it took me a few days to find out how to accomplish my task.

This article describes how to 'install' Bouncy Castle into your BlackBerry application.

Update: For information how to use the TLS Client from the BC Lightweight API, see this article.


TCP Port scanner for Blackberry Phones


I just finished coding version 1.0 of my TCP port scanner for BlackBerry smartphones. It has been submitted to RIM for approval on AppWorld. Hopefully it will be available for download here in a few days.

The idea is fairly straight forward: Check to see if you can establish a TCP Socket using a given set of endpoints and ports.

 

(7-Apr-2013) Update submitted to AppWorld to allow specification of Hyphenated port ranges

(5-Sep-2012) Now available for download from BlackBerry AppWorld: TCP Port Scanner


Getting started with Developing and Debugging blackberry apps: OS 7.1, JDE 7 and Javaloader.exe


When my Windows Phone died (Dell Venue Pro 8GB) I picked up a BlackBerry Bold 9900 as a replacement (couldn't find a decent non-blackberry keyboard to save my life!). This got me into Blackberry phone development (previous BB dev has consisted of WebWorks applications for Playbook).

After a couple of days of trying to build & debug a Blackberry app, I can see that the road is long and the tools not as polished as what Microsoft and Apple offer. Case in point: I wanted to debug a simple 'hello world' application on my phone and couldn't figure out how to get it to work until now. I'd like to pass along my findings.

Update: Most of the issues went away when I switched from JDE to the 'Blackberry plugin for eclipse'. If you want to pursue Blackberry OS development, go with Eclipse and you will be less disappointed.


Get started with Microsoft.Web.administration - Create a simple website monitor


The other day a co-worker ran into an interesting problem: their IIS website would get stopped for no apparent reason. To assist with troubleshooting (and to help with uptime) I created a utility that checks every couple of seconds to make sure that the website is up. If it is NOT up it logs the event to a text file and attempts to restart the website.

While there are quite a few articles out there that describe how to work with Microsoft.Web.Administration (MWA), there are comparatively few that help you with the setup pre-requisites. When I first started with MWA I had no success getting the methods in the namespaces to work for me until a few simple things were explained to me.

This article will discuss how to get started with MWA at the ground floor.


Create a hybrid WinForms / CLI application


I get to create and maintain various diagnostic tools during my 'day job'. One thing that helps with the versatility of the tools is to create a Hybrid WinForms / CLI application. That way you can use a GUI for one-off scenarios and have CLI arguments for automating repetitous activities.

This article explains how to do that and provides a sample Program.cs file as an example.


Visual Studio 2012: Additional theme support


Yesterday was a disappointing day. After installing VS 2012 on my dev box my eyeballs were assaulted by some Microsoft UX designers cruel joke: The absolutely aweful "Light" and "Dark" UI Themes. Apparently I'm not alone in thinking these themes are a HUGE step backwards in terms of usability of the IDE.

Since there was some rumbling on the interwebs about Theme support in VS 2012, I decided to fire up ProcMon to answer 2 questions:

  1. Where are the themes stored?
  2. Can I edit / create my own theme?

Pithy remark: I have come to think of Visual Studio 2012 as Microsoft Visual Distraction 2012 :)