wiki:BB10

Version 17 (modified by Martin Kolman, 7 years ago) (diff)

--

BlackBerry 10

This document describes the porting progress of modRana & related applications (Mieru, RePho, Panora) to the BlackBerry 10 operating system.

The information also of course applies to porting any other Python based application to BB10. :)

Dependencies

What needs to be available for !modRana to run.

Python

Python is available on-device in version 3.2.

ModRana has not yet been tested running on Python 3, but any changes that would be needed should be fairly minor.

Qt

Qt is available either on-device or a custom Qt version can be compiled & deployed.

Related links:

Qt@QNX overview (BB10 is based on QNX)
Building Qt4 for BB10

Weather the on-device Qt version can be used, or custom Qt version needs to be used to run !modRana still needs to be determined. If using the on-device version is possible, the resulting installation package would be quite a bit smaller as the Qt libraries would not need to be included.

PySide

building PySide

precompiled PySide binaries

the few changes to the guide that are needed for the whole thing to compile, are described below.

Building Shiboken

comment out tests in these files on around these line numbers:

/usr/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake :45
/usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake :52

Yeah, really - tis means modifying you system installation of CMAKE - make sure to have a backup ! :)

Creating a package If you are getting icon related errors during package installation, ad these argument to the packager:

-e icon.png icon.png

Qt Components

While the modRana QML GUI is largely independent on Qt Components, working set of Qt Components would simplify porting quite a lot. Also other applications, such as Mieru, currently depend on functioning Qt Components.

Symbian Qt Components

https://qt.gitorious.org/~conny/qt-components/connys-qt-components/commits/bb10

Should compile using these parameters:

./configure -symbian -no-mobility -nomake tests -nomake demos -nomake example

MeeGo/Harmattan Qt Components

Looks like MeeGo/Harmattan Qt Components should also work with some tweaks & would be the preferred choice, considering that is what modRana & co are currently using.

Links:

http://zwong.de/2012/06/using-meego-qt-components-on-blackberry-10-and-playbook/

http://supportforums.blackberry.com/t5/Native-Development/qt-components-for-BB10/td-p/1798349

http://supportforums.blackberry.com/t5/Native-Development/QML-symbian-qt-components-for-PlayBook/td-p/1574275i

Notes

Where are applications installed ? Applications are installed - in paths like this:

/accounts/1000/appdata/ca.microcode.bbpy.HelloWorld.testDev__HelloWorld7b0107f8/app/python/blackberry-py/

Running applications from the command line

It looks like it is not possible to run applications directly from the command line. But it is possible to run an application right after its package is installed through the command-line installation tool.

Debugging

Applications are started in a sandbox with some pmeade folder structure. The log folder in the sandbox contains stdout for the program.

Checking out the log

(The path seems to partially random-generated, so don't forget to change it to the path corresponding to you application).

cd /accounts/1000/appdata/ca.microcode.bbpy.HelloWorld.testDev__HelloWorld7b0107f8/
$ ls
app       data      db        logs      pps       shared    tmp

The logs folder contains the logs.

Shared log folder If you don't want to fish for the log folder, you con redirect stdout to a log file in the data/Downloads folder, which should be accessible for all applications.

Helpful commands

Pack, install and run:

blackberry-pythonpackager -package HelloWorld.bar     -devMode    -env PYTHONPATH=app/python/blackberry-py    bar-descriptor.xml    main.py main.qml     -e ../icon.png icon.png     -e ../blackberry-py/ blackberry-py/   -debugToken ~/token.bar -device 192.168.1.8 -password super_secret_password -launchApp -list -installApp

Deploy package:

blackberry-deploy -installApp 192.168.1.8 -password super_secret_password -package HelloWorld.bar