Changes

added information on native libraries
Line 141: Line 141:     
Activity bundles should be packaged as zip files with the ".xo" extension. The mime type in the journal is "application/vnd.olpc-sugar".
 
Activity bundles should be packaged as zip files with the ".xo" extension. The mime type in the journal is "application/vnd.olpc-sugar".
 +
 +
== Bundling Native Libraries ==
 +
 +
Sometimes you need to include a native library or two with your activity.  A good strategy, the one that [[Develop]] and [[Model]] use, is to specify a shell script for the executable in the .info file:
 +
 +
exec = ./model_startup.sh
 +
 +
The script, 'model_startup.sh', modifies the library path, python, or both paths (depending on the types of libraries you are including) to point to folders inside your bundle, then launches your application:
 +
 +
#!/bin/sh
 +
 +
export PYTHONPATH=$SUGAR_BUNDLE_PATH/site-packages:$PYTHONPATH
 +
export LD_LIBRARY_PATH=$SUGAR_BUNDLE_PATH/lib:$LD_LIBRARY_PATH
 +
 +
sugar-activity model_app.ModelActivity
 +
 +
Make sure to add your shell script and any native libraries to the MANIFEST before you package your bundle.
    
== Other Technologies Comparison ==
 
== Other Technologies Comparison ==
6

edits