c++ extensions to pys60 3rd ed platform
By Damien LEFEVRE, Saturday 7 October 2006 at 06:04 :: Tuto :: #19 :: rss
Example code:
There are two interesting files on the example package. The rest of the files are just stuff for building and installing:
- uikludges.cpp: actual c++ extension
- uikludges.py: extension loader required for 3rd ed
Download the full project definition.
Building for phone:
The C++ SDK shipped with GCCE compiler that is used to build the extensions. To build, simply do following:
bldmake bldfiles abld build gcce urel
This will build the binary to <SDK path>\epoc32\release\gcce\urel\_uikludges.pyd.
Making installation package
Next we need to make installation package that is used to distribute the files to phone. Take a look at uikludges.pkg. This file defines the files to be installed. Run following commands to build the installation file:
mkdir _build copy <SDK path>\epoc32\release\gcce\urel\_uikludges.pyd _build\ makesis uikludges.pkg
This will create uikludges.sis file.
Signing the package
Before we can send the installation package to phone, we need to sign it. In this example, we use self-signing. You can read more about signing from http://symbiansigned.com and http://forum.nokia.com.
In order to use self-signing, we need to generate certificate and private key:
makekeys -cert -password yourpassword -len 2048 -dname "CN=uikludges OU=Development" mykey.key mycert.cer
Then press keyboard to generate randomness.
Next, we use these keys to sign the package:
signsis uikludges.sis uikludges.sisx mycert.cer mykey.key yourpassword
Note that the .pkg uses UID which is used to identify the installation package. You can get your own UIDs by logging to http://symbiansigned.com and ordering UIDs. Order them from un-protected range if you plan to use self-signing. Please don't reuse the UIDs, otherwise there will be conflict, and that case the conflicting package cannot be installed.
Verifying installation package
After that you should have file uikludges.sisx which can be installed on the phone. Use Bluetooth or Nokia PC Suite to install it. You can verify that it works by typing this to interactive interpreter:
>>> import uikludges >>> uikludges.set_right_softkey_text(u"Back")
From: http://wiki.opensource.nokia.com/projects/PyS60_creating_extensions