Activity tutorial

From OLPC
Revision as of 16:42, 23 June 2007 by 64.89.207.72 (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:

mkdir HelloWorldActivity.activity
mkdir HelloWorldActivity.activity/activity

Write the activity.info file, to describe your bundle in the activity sub-directory (i.e. HelloWorldActivity.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: