Weekend Coder: CrackBerry's app developer guide

By Brian Scheirer on 20 Apr 2014 03:36 pm EDT

As the well-known saying goes, “A journey of a 1000 lines of code starts with a single import statement”… Oh, wait that’s not a saying at all is it? Well here's something that is well known for many new developers, it is often difficult to figure out how to get started. And the second biggest challenge is what to do next after getting started. The first is a relatively easy question to answer and for the second, while there is no single correct answer there are definitely better paths to choose than others.

So, here I hope to dig back into previous Weekend Coder posts and put them into an order that should help new developers progress through Cascades.

Step 0: Before Starting

Even before you install any programs or write a line of code there are a few things you should take into consideration. In the app making process article, I explore the fundamental workflow you should expect to take when making an app. This should give you a good frame of reference of what you are getting yourself into. To paraphrase a developer friend of mine (who codes a very popular app for BB10), “What people often fail to realize, writing an app is the same as writing ‘real software’” and by real software he means things you would normally expect on a desktop. More to his point, there is often a misconception that small screen means small effort when it comes to app development versus traditional software. I am not trying to scare/discourage anyone, rather just trying to inform you.

Knowing what kind of resources that are available to you as a coder is another important item before starting your app journey. Although you will probably use help docs and tutorials all throughout your coding life, researching along with your plan will be invaluable as you progress. Research will uncover things like what platform is best for your idea, if what you are trying to do is even possible, have others already done what you are trying to do, etc. Note, the rest of this article will be from the point of view of Native/Cascades, but there’s no reason you can’t apply the ideas to any software language.


Step 1: Getting Started

This is usually the number one question everyone has, while the previous two paragraphs are the actual answer that is not what you usually want to hear. So here’s the answer you are looking for. During your research, you’ll have discovered for Native/Cascades the most popular option for a developing environment is Momentics which is provided to you for free by BlackBerry. Once you have downloaded and installed, here is a video walkthrough of the interface. And once you know what all the buttons on the IDE do, you are ready to build your first app. I once again have a video showing how to do this.


Step 2: Foundation

There are plenty of tutorials that will get you to this point and they all pretty much end with “now you have built Hello World, go make something awesome!” However, there is a big jump between having two words appear on the screen and having a fully functional app that users will want. Possibly other tutorials stop here because like I said above there is no single correct path. And since there isn’t one the best I can do is help guide you from here. (Better than nothing, right?)

I think the best next step is deciding on a navigation plan. This is what will provide a good foundation for everything that will go into your app. Think of navigation as how users will go through your app from various presses/selections and what content will be displayed on each “screen”. I have a few write ups of some options:

Navigation and Tabbed Pane (easy): These are the two built-in types provided by BlackBerry in Cascades. I go a bit deeper into TabbedPane, but this is a specific somewhat advanced topic which you may want to hold off on until you are a bit further in your app knowledge.

Custom (advanced): One of the beauties of coding, especially design, usually if you can dream it up it can be coded. There isn’t much can’t be implemented into a design. I have mimicked a Cascades style TabbedPane and I have come up with something completely custom. The point is you can do anything you want.


Step 3: Independent Topics

Now from here, it is really just a matter of what you in your app. How do you want to style it? How do you want it to behave? So the best I can do is group a handful of my tutorials as either “easier” or “harder” topics.


Step 3a: “Easy” Topics

The easiest way to have things “do stuff” in your app is to code JavaScript into signals (like button clicks). Once you have an understanding of JavaScript you can have all kinds of things “happen” in your app. Common things you could do is add menus/menu items, implement keyboard shortcuts for hardware keyboard devices, and handle orientation changes.

These next two topics have nothing to do with each other but easy to implement. Text styling lets you change the color, size, and in 10.2+ the font of text. And you can define the style once and use it everywhere. The asset selector makes it easier to support various devices by reusing/managing code. And by the looks of the 10.3 roadmap there will be some new goodies surrounding this feature.


Step 3b: “Advanced” Topics

Next, I have done some tutorials on more advanced topics. And please don’t confuse that you need to have everything in the easy topics implemented into your app first, rather it is best to understand the more fundamental features you can add prior to jumping into more advanced ones.

One of the most popular, if not most popular, style of app is a list of “news” and there is a great set of tools to get lists into BlackBerry10. And a popular thing to add to a list (or any app really) is the ability to have the share card pop up so you can have users share something from the app to their friends via email, text, social media, etc. Another advanced topic is implementing payment services into the app for in-app purchases. Personally I think “freemium” apps are the best model to generate income.

My last two advanced topics I believe are the hardest but for separate reasons. First, I have what I dubbed “Fancy Transitions”. While the code isn’t particularly hard to understand here, the method behind the madness is a bit tricky. What I am doing here is having a few tools working together to do something no single tool or object could do on its own. I couple this is the same bracket as the custom navigation types I discussed above. And finally, active frames and more specifically dynamic active frames is the most advanced topic I have written about. Luckily, you can grab the code I show in the example and slightly tweak for your own purpose. I definitely don’t recommend this topic until you have a good understanding of Cascades and how QML interacts with C++.


Step 4: Finalizing

Regardless if you made something super simple or the most complex app in the world, the last few steps are the same. Prior to building the app for release, you need to create a name and icon and should create a splash screen. While I don’t have a Weekend Coder article on building a final .bar file, I have a tutorial on this subject I wrote for my personal website. Lastly, you will want to get your app on BlackBerry World. So I leave you with one more video showing you how to do just that.

Finally, your apps are never "final." You can always improve, add new features, or connect your app to other apps. Be sure to go back and make updates to your apps. You may love what you end up adding without even knowing prior to updating plus users always love updates.

I hope my 4 (or 5 or 6) steps give aspiring app developers a bit more of a roadmap on how to start writing apps and ultimately get you through all the steps to completion. Along the way I have referenced about 20 tutorials, 4 videos, and pointed you to read 7 or so sites that have thousands of pages of information (especially the official docs page). So to recap, app developing is most certainly real software development that requires real work. After all, for some it is a career and for many others it is very rewarding hobby (monetary or otherwise).

Let me know if I missed anything or if there is something you’d like me to include in future Weekend Coder posts.

Reader comments

Weekend Coder: CrackBerry's app developer guide


Might add only this:
For many, starting point is the hardest, not because of lack of knowledge, but because of lack of ideas. The easiest way to start (IMO), is to find a problem, which your app could potentially solve.
Nothing will get you further and faster, than a real app development.
Posted via the Android CrackBerry App!

So If I have no coding/app building experience, how likely is it that I'll be able to make an app? Or how difficult will it be?

Depends on how seriously you take it. I had no app making experience at one point too. And I didn't have an article this awesome to help me through the process. ;)

Posted via CB10

This is an awesome write-up, Brian. Thanks for the effort, hope it will inspire a lot of CB folk to start coding. :-)

There is a huge gap between complaining "We've got no apps" and writing your dream app that you think is missing.

Zzzzwiped from a Zedevice....

So if you wanted to make an app for BlackBerry, what's the best way to start/learn? I'd rather make one for BlackBerry then any other platform and I've been thinking of starting one but I'm totally clueless about how to begin the whole process lol

Posted via CB10

Actually your question would be solved by reading this article. It will show you all the steps from beginning to end.

Wow, I totally apologize. I got to read until your 'well known saying' and I thought, "this is gonna be another one of your pieces which I won't understand", as I have read all your articles trying to see if I can figure them out lol I figure it was a guide for those who already knew how to develop. Finally got the courage to ask, without trying to sound dumb. Well, that backfired lol I'm gonna credit you when I finally build one!

Posted via CB10

Haha no worries. That opening line was my poor attempt at some humor since coding is kind of a dry subject. Good luck with writing an app. I hope this article helps guide you through the process.

Posted via CB10

Will be very interesting to have a rubric for weekend coder. Everything on one spot

Posted via CB10

With the upcoming OpenSource CB10 app, this might be possible.

Posted via the Android CrackBerry App!

I didn't write the CB10 app. And honestly the CB10 app is one of the best apps out there with a really great interface and design. Sure it has a few bugs and shortcomings but I'm sure the dev who wrote it will update soon. Also Kevin did say they were going to opensource the code soon so maybe I will take a stab at an update to it too.

Posted via CB10

Great to hear what you said about the dev updating soon. Forum threads are long on the subject.
Your idea of maybe taking a stab at it yourself sounds good (wish I would be at that level). It's just strange that the android port of Crackberry app actually has some ponts over the native app. Kinda crazy.

Posted via CB10

Very nice article. Been thinking about making an app, this should be a great help. Thanks


Like my comment if you have no idea about coding but you still read every single word... ugh CrackBerry doesn't have likes on the comments.. ohwell :P

Posted via CB10 on my Z10STL100-

Sort of off topic, but one thing I really like about the BlackBerry and Android development tools is they are multi platform. Want to make a Windows phone app? You need Windows. Want to make an iOS app? You need a mac, a fairly modern mac, and a $100 code signing key that will expire in a year. Want to make a BlackBerry app? You just need a computer because there is no hidden agenda other than providing the tools you need to be successful.

Now you see where the real geeks are.

Google (Android / Linux), and BlackBerry (QNX) let you go wild without spending a dollar. Apple filters their wannabe devs and makes some money on the way, Windows phone is just plain old M$ style...

Zzzzwiped from a Zedevice....

Somebody make the frakin' #bankofamerica app alreay. I'm too busy and technologically challenged to do such a thing!

Posted via CB10

Brian: thank you so very much for this. I know I was kind of bugging you about it but I think the result is worth it.
Now all we need is... MORE of Brian's tutorials! :-D

Posted via CB10

Looks nice, but still, coding knowledge is needed. For non-coders, I think Microsoft took a better approach with the Windows Phone App Studio.

I come from lamp after a 3 year break. Your articles are a lifesaver in this dev ocean

Posted via CB10

Awesome Brian. thank you.
always a great insight. i have a question: what enviroment would you recommend to start making games, say like a platformer? is it too much of a hassle to go native/cascades when im just a beginner? (with Actionscript experience)

Now that AIR will be gone in 10.3+ i need to make the jump now.


I know a fews guys messing around with Unity and they say it is super easy to build games. There is a huge community and tons of tutorials/examples out there for it too.

Posted via CB10

Hi Brian, what do you think about Appcelerator Titanium original and Alloy code? Waist of time or is a Good to Go?

Posted via CB10

Great article Brian, thanks! I have very minimal dev experience from a high school computer engineering course I took 10+ years ago, but I've been hoping to plug some app "holes" of my own for a while now instead of just lamenting over what's not available. Mostly for personal use but if I can actually manage to develop a quality app that would benefit other BlackBerry users, hopefully it'll maybe show up in BB World one day...

Great article. Thanks, Brian! Terrific references, too. Appreciate your wisdom and consolidating all in one place.

Posted via CB10

Hi Brian, what do you think about Appcelerator Titanium original and Alloy code? Waist of time? Or is a Good to go?

Posted via CB10