Activity tutorial

From OLPC
Revision as of 14:08, 18 April 2007 by 222.237.230.157 (talk)
Jump to navigation Jump to search

The tutorial explains step by step how to create the Hello World activity bundle.

Create the bundle directory structure.

HelloWorldActivity.activity
HelloWorldActivity.activity/activity

Write the activity.info file, to describe your bundle in the activity sub-directory (i.e. hello.activity/activity/activity.info). The Activity Bundles specification explain in detail the meaning of each field.

[Activity]
name = HelloWorld
service_name = com.ywwg.HelloWorldActivity
class = HelloWorldActivity.HelloWorldActivity
icon = activity-helloworld
activity_version = 1
show_launcher = yes

Design an icon for your activity, according to the icon format and place it in the activity sub-directory. The file name should match the one specified in the info "activity-helloworld.svg".

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
  <!ENTITY fill_color "#FFFFFF">
  <!ENTITY stroke_color "#000000">
]>
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">
  <rect x="1" y="1" width="48" height="48"
  style="fill: