A simple file structure of python applications on maemo/n800:
helloword
helloword.desktop
helloword.service
helloword.png
setup.py
Note:
1. Main source file helloworld is written in python, but it must be named without ".py".
2. helloworld.desktop and helloworld.service are used for adding and linking the executable source file helloworld to the application menu of N800.
3. helloworld.png is the icon displayed in application menu.
4. setup.py is used for installing the four files above into N800. It is the only file that you can name it arbitrarily.
Necessary sentences in helloworld:
python 代码
- import osso
- osso_c = osso.Context("com.nokia.helloworld", "1.0.0", False)
All sentences in helloworld.desktop:
Terminal 代码
- [Desktop Entry]
- Version=1.0.0
- Encoding=UTF-8
- Type=Application
- Name=Hello world
- Exec=/usr/bin/helloworld
- Icon=helloworld
- X-Osso-Service=helloworld
- X-Osso-Type=application/x-executable
All sentences in helloworld.service:
Terminal 代码
- [D-BUS Service]
- Name=com.nokia.helloworld
- Exec=/usr/bin/helloworld
All sentences in setup.py:
python 代码
-
-
- from distutils.core import setup
- setup(
- name='helloworld',
- version='1.0.0',
- scripts=['helloworld'],
- data_files = [
- ('share/icons', ['helloworld.png']),
- ('share/applications/hildon', ['helloworld.desktop']),
- ('share/dbus-1/services', ['helloworld.service']),
- ]
- )
Be careful of those service names underlined and in red, which may result in fatel errors due to a little miss of coherence. Meanwhile, you can try any other combinations of those names, which however, is not recommanded.
What's more, make sure that there is not even one single space at the end of each line in .service and .desktop files.
To install the helloworld application onto maemo:
cpp 代码
- [sbox-SDK_X86: ~helloworld-1.0.0] > python2.5 setup.py install
To install it onto N800 device:
cpp 代码
- [sbox-SDK_X86: ~helloworld-1.0.0] dh_make
- [sbox-SDK_X86: ~helloworld-1.0.0] dpkg-buildpackage -rfakeroot -b
Remember to change debian/control. See article "Installing packages to N800 from sources".
![点击查看原始大小图片](http://dl2.iteye.com/upload/attachment/0001/0683/94c90dc0-9ee6-47ca-80dd-f07f910a1ad3-thumb.jpg)
- 描述: When installed, our own application can be seen in the menu now.
- 大小: 80.1 KB
分享到:
相关推荐
This handy cookbook provides dozens of ready-to-use recipes for using Apache Sqoop, the command-line interface application that optimizes data transfers between relational databases and Hadoop. ...
It sometimes feels like there are a million and one different techniques to master, spread across a bewildering array of websites. The range of possibilities seems endless and makes for a steep and ...
If you are entering this new world of parallel computing the list of new concepts and processes can be bewildering. Furthermore, the field is too new to have attracted the usual authors who know how ...
It sometimes feels like there are a million and one different techniques to master, spread across a bewildering array of websites. The range of possibilities seems endless and makes for a steep and ...
With the arrival of Big Data, statistical processing has taken on a new level of importance. Kenny lays a foundation for understanding the importance and value of Big Data, and then he shows how mined...
You might know that Windows 7 comes in a bewildering array of versions: primarily Home Premium, Professional, Enterprise, and Ultimate (not to mention Starter, intended for relatively primitive ...
The programmer says it draws an "astonishing" number of vectors with a "bewildering" variety of colors in "practically no time at all," and that it "looks real pretty when you twirl 'em around.
This book provides the most useful information to those who find themselves in the bewildering position of formulating access control lists, auditing metadata, and consolidating information silos ...
Design, deploy, and maintain your own private or public Infrastructure as a Service (IaaS), using the open source OpenStack platform. In this practical guide, experienced developers and OpenStack ...
With new features such as Content-Aware Fill and Puppet Warp, Photoshop CS5 is more amazing -- and perhaps more bewildering -- than ever. That's where this full-color Missing Manual comes in. It ...
options and shortcuts as well as a bewildering array of add-ons and plug-ins. And that’s why you’re holding this book in your hands. And why I wrote it. And why John Wiley & Sons published it. You ...