Info: How to make a standalone application (using py2sis) Note: the instructions given here apply currently for making standalone applications only for 2nd edition phones (and earlier)! Instructions for 3rd edition phones will be available later. But the following links might help you further at this point when making sis packages for 3rd ed. phones (I haven't tested them myself though): Nokia wiki or ensymble (by jethro.fn ) or http://www.nbl.fi/~nbl928/py2sisng.html. A standalone application lets you start your own "python application" directly by clicking on an icon on the desktop on the phone (not having to open the python interpreter, "run script" etc. anymore). The process to create a standalone app is a bit tricky, but if you have walked once successfully through it, then it is straight forward. I have put here many ready working example files that are downloadable - including icons - so you can see how things should look like at any point, and you can try out stuff with them and modify them.
- How to make a simple standalone app out of your python script For PC only: (Symbian does not provide SDK's for MAC, so you can not do this on MAC) First of all you need to have the following software installed installed on your machine: A. Symbian SDK B. Python plug-in for the SDK To get the A. Symbian SDK, go to www.forum.nokia.com/main/0,,034-4,00.html After that you need to install B. the Python plugin Python_for_2ndEd_SDK.exe Now you are set to create your standalone application (creating a *.sis file).
Here is how you make a simple standalone app - a *.SIS file - out of your python script: On your PC, create a folder named e.g. myapps (C:\myapps). This is your working directory. Open a command line terminal e.g. via windows: Start -> Run -> then type in: cmd On the command line terminal go to your working directory, the myapps folder by typing: On the command line terminal type the command:
Hint: In case you get an error message like this when you run the above command: ERROR [Errno 2] No such file or directory: 'C:\\myapps\\templates\\pyapp_template.tmp' , then there is a quick way to get round. Copy the folder called templates (and its content) from the directory C:\Nokia\Tools\Python_for_Series_60\py2sis into the directory C:\myapps . Now you should be able to run the py2sis command successfully.
The resulting standalone app file is called myfirst.sis and is found in your C:\myapps folder. You can push this to your phone, install it and run. When running you can see that it uses a standard icon (puzzle image). If you want to have your own icon then go through the next part of text here below. You can test the making of a standalone app with the commands above by using this example test.py script.
How to make a standalone app including your own icons: You can use an own icon for your application. It will show on the top of the canvas (icon1) when running your app (instead of the snake) and also on the desktop of the phone (icon2). 1. Creating the icons In order to create these icons you can use e.g. a graphic editor like photoshop or fireworks: icon1 for the top of the canvas (when your app is running): icon2 for the desktop: Note:
2. Merging the icons and its masks into an *.mbm file (MultiBitMap): Make sure you have saved all your earlier created *.bmp files to C:\myapps On the command line terminal go to the myapps directory by typing: cd C:\myapps On the command line terminal type: Hint: make sure you add /c24 (as 24bit colour picture) in front of the icon file name and leave no space inbetween. The resulting file is testapp.mbm which is found in your C:\myapps folder.
3. Creating an *.aif file (application information file): Now you need to create an *.aif file (application information file that links your icons to your app) using a tool called aif tool that came with the Symbian SDK intallation. A. first have a *.rss file. RESOURCE AIF_DATA // You need to replace the following app uid with your own applications UID that you plan // to use for your app. // Put here the number of icons (not including the masks), in our case we use 2 icons Note: Do not copy & paste the rss file content from the text above (html), rather download and use this example file here: Modify the mobiLen.rss file and save it to your myapps folder. B. Now finally create the *.aif file (C:\myapps>aiftool mobiLen testapp.mbm ) You can find your ready mobiLen.aif file in your C:\myapps folder . It contains the icons. Example of the ready usable file: mobiLen.aif 4. Create a preliminary *.sis file to generate a modifyable *.pkg file The idea here is that we need a *.pkg (packaging file) to insert some information about the myapp.aif file how it should be packaged. (C:\myapps>py2sis test.py mobiLen.sis --uid=0x0FFFFFFF --appname=mobiLen --leavetemp)
The resulting file that we need at this point is the mobiLen.pkg file (and not the *.sis file). You find it inside a folder called temp that is left over inside your myapps folder. Note: the file name mobiLen.pkg comes from the appname that we used in the previous command. If you use a different appname also the *.pkg will change accordingly as well as the paths inside and filenames of other files etc. !). B. Modify the mobiLen.pkg file mobiLen.pkg example: "default.py" -"!:\system\apps\mobiLen\default.py" ; Add this line and change the myapp.aif to your *.aif file (at beginning and at the end) Note: Do not copy & paste the *.pkg file content from the text above (html), rather download and use this ready modified example file here: C. Save your modified file as mobiLen.pkg to the temp folder inside your myapps folder. D. Copy now your earlier created mobiLen.aif file also to the temp folder inside your myapps folder. 5. Create now your final *.sis file by using this time the makesis tool: A. Go to the temp directory by typing on the command line: cd temp B. On the command line terminal type: (C:\myapps\temp>makesis mobiLen.pkg ) The resulting standalone app file is called mobiLen.sis and is found in your C:\myapps\temp folder. You can push this to your phone, install it and run. It should now have your own icons included. Final working example: mobiLen.sis Note: If you want to add also the python interpreter into your sis file, you can go through the detailed instructions below, or take this shortcut: all you need to do is basically copy the python interpreter sis file into you temp direcory and add this line in the mobiLen.pkg file: @".\PythonForSeries60.SIS",(0x10201510) . After that run: makesis mobiLen.pkg
How to make a *.SIS file that includes the python interpreter, so you can distribute your app to people who do not have the python interpreter installed previously on their Nokia Series 60 device:
1. Create a preliminary *.sis file to generate a modifyable *.pkg file The idea here is that we need a *.pkg (packaging file) to insert some information on how to package the python interpreter into it. A. On the command line terminal type: (C:\myapps>py2sis test.py mobiLen.sis --uid=0x0FFFFFFF --appname=mobiLen --leavetemp)
The resulting file that we need at this point is the mobiLen.pkg file (and not the *.sis file). You find it inside a folder called temp that is left over inside your myapps folder. Note: the name mobiLen.pkg is because the appname that we used in the previous command was called mobiLen (when you use a different appname also the *.pkg will change accordingly as well as the paths inside and filenames of other files there). B. Modify the mobiLen.pkg file mobiLen.pkg example: "default.py" -"!:\system\apps\mobiLen\default.py" ; Add this line here (at the end) Note: Do not copy & paste the *.pkg file content from the text above, rather download and use this ready modified example file here: C. Save your modified file as mobiLen.pkg to the temp folder inside your myapps folder. D. Copy now the python interpreter sis file (pys60 v.1.2\2ndEd) also to the temp folder inside your myapps folder. E. Create now your final *.sis file by using the makesis tool: Go to the temp directory by typing on the command line: cd temp (C:\myapps\temp>makesis mobiLen.pkg ) The resulting standalone app file is called mobiLen.sis and is found in your C:\myapps\temp folder. You can push this to your phone, install it. It should install both the python interpreter and your own python app. Final working example that includes the interpreter: mobiLen_w_int.SIS
Note: If you want to include also your own icons into the sis file check the instructions above on how create icons and how to modify your .pkg file.
How to make a *.SIS file that includes other *SIS files , so you can distribute your app as one files in total. In the same way as you included the python interpreter, you can also include other *.sis files e.g. of python extensions that other people have created. A. In the .pkg file (see detailed instructions above) add at the end a line: example: @".\PythonForSeries60.SIS",(0x10201510) Note:
--------------------------------------------------------------------------------------------------------------------- RUN THROUGH:
First of all you need to have the following software installed installed on your machine: A. Symbian SDK
www.forum.nokia.com/main/0,,034-4,00.html Here is how you make a simple standalone app - a *.SIS file - out of your python script: Create a working directoryC:\myapps. Save your python script in it. On the command line terminal type the command: You can test the making of a standalone app with the commands above by using this example test.py script. How to make a standalone app including your own icons: You can use an own icon for your application. 1. Creating the icons Save them to your C:\myapps folder
2. Merging the icons and its masks into an *.mbm file (MultiBitMap): The resulting file is testapp.mbm which is found in your C:\myapps folder.
3. Creating an *.aif file (application information file): A. first have a *.rss file. B. Now finally create the *.aif file You can find your ready mobiLen.aif file in your C:\myapps folder . It contains the icons.Example of the ready usable file: mobiLen.aif 4. Create a preliminary *.sis file to generate a modifyable *.pkg file The resulting file that we need at this point is the mobiLen.pkg file inside a folder called temp that is left over inside your myapps folder. C. Save your modified file as mobiLen.pkg to the temp folder inside your myapps folder. D. Copy now your earlier created mobiLen.aif file also to the temp folder inside your myapps folder. 5. Create now your final *.sis file by using this time the makesis tool: A. Go to the temp directory by typing on the command line: cd temp B. got to tempfile on the command line terminal and type: The resulting standalone app file is called mobiLen.sis and is found in your C:\myapps\temp folder. You can push this to your phone, install it and run. It should now have your own icons included. Final working example: mobiLen.sis
How to make a *.SIS file that includes the python interpreter, so you can distribute your app to people who do not have the python interpreter installed previously on their Nokia Series 60 device:
1. Create a preliminary *.sis file to generate a modifyable *.pkg file The resulting file that we need at this point is the mobiLen.pkg file D. Copy now the python interpreter sis file (pys60 v.1.2\2ndEd) also to the temp folder inside your myapps folder. The resulting standalone app file is called mobiLen.sis and is found in your C:\myapps\temp folder. You can push this to your phone, install it. It should install both the python interpreter and your own python app. Final working example that includes the interpreter: mobiLen_w_int.SIS
How to make a *.SIS file that includes other *SIS files , so you can distribute your app as one files in total. A. In the .pkg file (see detailed instructions above) add at the end a line: example: @".\PythonForSeries60.SIS",(0x10201510) Note:
-----------------------------------------------------------------------------------------------------------------
Few helpful links: http://www.newlc.com/article.php3?id_article=197 http://www.newlc.com/recherche.php3?recherche=create+mbm+ http://www.newlc.com/recherche.php3?recherche=bmconv
|
|
|
|