Changes

Line 1: Line 1:  
{{OLPC}}
 
{{OLPC}}
= Introduction =
+
== Introduction ==
 +
 
 
Every activity in the [[Sugar]] environment is packaged into a self-contained '''"bundle"'''.  The bundle contains all the resources and executable code (other than system-provided base libraries) which the activity needs to execute.  Any resources or executable code that is not provided by the base system must be packaged within the bundle.
 
Every activity in the [[Sugar]] environment is packaged into a self-contained '''"bundle"'''.  The bundle contains all the resources and executable code (other than system-provided base libraries) which the activity needs to execute.  Any resources or executable code that is not provided by the base system must be packaged within the bundle.
 +
; See also : [[OLPC Bitfrost]] in general and its section on [[OLPC Bitfrost#Software installation|software installation]]
 +
: [[OLPC Human Interface Guidelines/Activities|HIG-Activities]] and its section on [[OLPC Human Interface Guidelines/Activities/Activity Bundles|activity bundles]]
 +
 +
== Rationale ==
   −
= Rationale =
   
Activities are meant to be shared between children.  If a child doesn't have the activity, it is automatically transfered to the child when he or she joins the shared activity.  Packaging activities in self-contained bundles allows easy sharing, installation, removal, and backup.
 
Activities are meant to be shared between children.  If a child doesn't have the activity, it is automatically transfered to the child when he or she joins the shared activity.  Packaging activities in self-contained bundles allows easy sharing, installation, removal, and backup.
   −
= Location =
+
== Location ==
 +
 
 
Activities are installed and removed automatically by [[Sugar]], in response to user actions.  Sugar places activities in directory of its choice.  Activities should not rely on being installed in a specific location, and should use relative paths where paths are necessary (i.e., for shared library linkage, activity resources such as images, sounds, etc).  They should also not rely on the bundle's base directory name remaining the same.  Sugar may rename the activity bundle base directory at any time to prevent bundle conflicts.
 
Activities are installed and removed automatically by [[Sugar]], in response to user actions.  Sugar places activities in directory of its choice.  Activities should not rely on being installed in a specific location, and should use relative paths where paths are necessary (i.e., for shared library linkage, activity resources such as images, sounds, etc).  They should also not rely on the bundle's base directory name remaining the same.  Sugar may rename the activity bundle base directory at any time to prevent bundle conflicts.
   Line 19: Line 24:  
  profile_path = sugar.env.get_profile_path()
 
  profile_path = sugar.env.get_profile_path()
   −
= Bundle Structure =
+
== Bundle Structure ==
 +
 
 
The activity bundle is a directory, with a name ending in ".activity".  Each activity bundle must, in a subdirectory called 'activity', contain a file named "activity.info", and following a special format.  For example:
 
The activity bundle is a directory, with a name ending in ".activity".  Each activity bundle must, in a subdirectory called 'activity', contain a file named "activity.info", and following a special format.  For example:
   Line 39: Line 45:  
All metadata about the activity is organized in the 'activity' subdirectory of the activity bundle.
 
All metadata about the activity is organized in the 'activity' subdirectory of the activity bundle.
   −
= .info File Format =
+
== .info File Format ==
    
.info files follow a key/value pair format, similar to the [http://www.freedesktop.org/wiki/Standards_2fdesktop_2dentry_2dspec Desktop Entry standard], but not conforming to it.  An example is shown here:
 
.info files follow a key/value pair format, similar to the [http://www.freedesktop.org/wiki/Standards_2fdesktop_2dentry_2dspec Desktop Entry standard], but not conforming to it.  An example is shown here:
Line 50: Line 56:  
  icon = activity-web
 
  icon = activity-web
 
  class = browseractivity.BrowserActivity
 
  class = browseractivity.BrowserActivity
 +
mime_types = application/pdf;image/tiff
 
  show_launcher = yes
 
  show_launcher = yes
   Line 77: Line 84:  
  class = browseractivity.BrowserActivity
 
  class = browseractivity.BrowserActivity
 
: For Python-based activities, it's not necessary to write a custom factory since a generic one is provided with [[Sugar]]. Use this attribute to specify the main Activity class. When a class is specified the exec attribute is ignored.
 
: For Python-based activities, it's not necessary to write a custom factory since a generic one is provided with [[Sugar]]. Use this attribute to specify the main Activity class. When a class is specified the exec attribute is ignored.
 +
 +
mime_types = application/pdf;image/tiff
 +
: List of mime types supported by the activity, separated by semi colons.
    
  show_launcher = yes
 
  show_launcher = yes
 
: This key is optional.  If not present, or if present with a value of "yes", the activity is shown with its icon in the [[Sugar]] panel launcher and a valid 'icon' key/value pair is required.  If specified with a value of "no", the activity is not shown in the [[Sugar]] panel launcher, and the 'icon' key is not required.
 
: This key is optional.  If not present, or if present with a value of "yes", the activity is shown with its icon in the [[Sugar]] panel launcher and a valid 'icon' key/value pair is required.  If specified with a value of "no", the activity is not shown in the [[Sugar]] panel launcher, and the 'icon' key is not required.
   −
= Activity Name Localization/Translation =
+
== Activity Name Localization/Translation ==
 +
 
 
Localized data lives in the locale directory. Each language stores its localized keys in a <u>separate</u> directory named for the language's ISO code.  Localized keys from the 'activity.info' file are stored in the 'activity.linfo' files in that directory. For example, German-localized German (as opposed to Swiss-localized German) language translations are stored in the 'de_DE/activity.linfo' file:
 
Localized data lives in the locale directory. Each language stores its localized keys in a <u>separate</u> directory named for the language's ISO code.  Localized keys from the 'activity.info' file are stored in the 'activity.linfo' files in that directory. For example, German-localized German (as opposed to Swiss-localized German) language translations are stored in the 'de_DE/activity.linfo' file:
   Line 101: Line 112:  
Keys in the languague-specific '.linfo' files selectively override keys from the 'activity.info' file; if a key is not present in the '.linfo' file the value from the 'activity.info' file is used instead.
 
Keys in the languague-specific '.linfo' files selectively override keys from the 'activity.info' file; if a key is not present in the '.linfo' file the value from the 'activity.info' file is used instead.
   −
= Package ==
+
== Package ==
    
Activity bundles should be packaged as zip files with the ".xo" extension.
 
Activity bundles should be packaged as zip files with the ".xo" extension.
   −
= Other Technologies Comparison =
+
== Other Technologies Comparison ==
    
Activity bundles are similar to OS X bundles or Java JAR files; a simple mechanism to encapsulate everything you need in a single directory that can be moved around independently.  
 
Activity bundles are similar to OS X bundles or Java JAR files; a simple mechanism to encapsulate everything you need in a single directory that can be moved around independently.  
Anonymous user