See http://docs.moodle.org/dev/Moodle_Mobile_Developing_a_plugin_tutorial