Since programming for BB10 is now supposedly much easier if you know Qt, I decided to give it a go and I have been reading this: https://developer.blackberry.com/cascades/documentation/getting_started/index.html
I noticed that all of RIM's tutorials, and all of the online tutorials that I can find centre around the QNX Momentics IDE - a customized Eclipse.
Because I'm old school, and I like VIM, I would really prefer to work with command line tools. However, I can't seem to find any documentation on how to set up a project, the build process, or a device/emulator deployment outside of this IDE. Is that even possible? If so, does anyone have any leads on some documentation or tutorials?
I also like
vi
andmake
. The really nice thing about BB10 development is that all the QNX command line tools and makefile templates are included in the Native Development Kit so it's easy to build and deploy apps from the command line.To start developing from the command line you'll need to:
Set the NDK environment variables
Run
bbndk-env.sh
found in your NDK install directory.You should now have access to a load of binaries starting with blackberry-*. These will enable you to package and deploy your app onto the simulator or device.
Build for the arm architecture
To build binaries which will run on BB10 devices you'll need to build for the arm architecture:
To build for the simulator you'll need to build for the x86 architecture, assuming that's your host OS. You can view a list of all supported architectures by running
qcc -V
Create the BAR descriptor XML
Every BB10 app must have a BAR descriptor file called
bar-descriptor.xml
. This tells the target OS how to install the app. Here's a minimal sample (my app is called 'Mini'):Package, sign and deploy
Assuming you've registered with RIM to sign applications you can package your app into a BAR (BlackBerry Archive) file and deploy this to the device using these commands:
Make things easier using Makefiles
You can use the Qt tools to make life easier for you:
qmake -project
to create a .pro file. Only run this once, subsequent runs will overwrite your .pro file.qmake
. This will generate aMakefile
based on your .pro filemake
to build your project.Further info
Check out the NDK samples here: https://github.com/blackberry/NDK-Samples and Community samples here: https://github.com/blackberry/Core-Native-Community-Samples. You can build, package and deploy all these samples to your device by running:
You'll need to set your
DEVICEIP
andDEVICEPW
environment variables to match your target.Also check out the porting guide: http://developer.blackberry.com/native/documentation/porting_getting_started.html