Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Moodle Mobile 2 (Ionic 1) Customization: Difference between revisions

From MoodleDocs
(moodle mobile template, small rewording)
Line 1: Line 1:
{{Moodle 2.4}}
{{Moodle Mobile}}
== Overview ==
== Overview ==


Line 6: Line 6:
== Creating your custom application ==
== Creating your custom application ==


Remember that if you want to only change the global styles of the app, you can use an extra CSS file in your Moodle installation without need to compile again the app.
Remember that if you only want to change the global styles of the app, you can use an extra CSS file in your Moodle installation without needing to recompile the app.


=== Development environment ===
=== Development environment ===
Line 12: Line 12:
See [[Moodle_Mobile#Testing_and_developing]]
See [[Moodle_Mobile#Testing_and_developing]]


My recomendation is having a local web server (app and moodle installation under localhost or the same local domain).
It is recommended that you have a local web server (app and moodle installation under localhost or the same local domain).


You will need:
You will need:


* A Moodle installation with WebServices (REST) enabled, see [[Web services]] documentation
* A Moodle installation with Web Services (REST) enabled - see [[Web services]] documentation


** Administration -> Plugins -> Web Services -> External Services -> Enable mobile web service
:* Administration -> Plugins -> Web Services -> External Services -> Enable mobile web service


** Administration -> Plugins -> Web Services -> Protocols -> Enable REST
:* Administration -> Plugins -> Web Services -> Protocols -> Enable REST


** Administration -> Users -> Permission -> Define roles -> Edit the Authenticated user role -> Allow webservice/rest:use  
:* Administration -> Users -> Permission -> Define roles -> Edit the Authenticated user role -> Allow webservice/rest:use  


* A local copy of the Mobile HTML5 App with the Debugging options Enabled
* A local copy of the Mobile HTML5 App with the Debugging options Enabled


=== WebServices Development ===
=== Web Services Development ===


In most cases your plugin/s will need WebServices to get data from your Moodle installation, my recommendation is develop first the Web Services you'd need (see [[Web Services]])
In most cases your plugin/s will need Web Services to get data from your Moodle installation. It is recommended that you first develop the Web Services that you will need (see [[Web Services]]).


* Create a local plugin in Moodle for adding the extra Web Services you need and also your plugin's lang files (Local WS plugin template: https://moodle.org/plugins/view.php?plugin=local_wstemplate)
* Create a local plugin in Moodle for adding the extra Web Services you need and also your plugin's lang files (Local WS plugin template: https://moodle.org/plugins/view.php?plugin=local_wstemplate)


* Create a new External Service in your Moodle installation, adding a services.php file in your new local plugin or creating manually the service in your Moodle installation.(Plugins -> WebServices) See [[External_services_description]] for more info. Remember the key name of the service, because you will need it later.
* Create a new External Service in your Moodle installation, adding a services.php file in your new local plugin or creating manually the service in your Moodle installation.(Plugins -> Web Services) See [[External services description]] for more info. Remember the key name of the service, because you will need it later.


=== Plugin Development ===
=== Plugin Development ===
Line 41: Line 41:


* Edit the /config.json file to:
* Edit the /config.json file to:
** Add the extra plugins you implement
:* Add the extra plugins you implement
** Indicate the WS service name you are going to use in your Moodle installation (Remember, that you need to create a WS Service indicating the functions available for your custom app)
:* Indicate the WS service name you are going to use in your Moodle installation (Remember, that you need to create a WS Service indicating the functions available for your custom app)
** Add your custom default lang file (es, ca, fr ...) (the language file must exists in the app's lang/ folder)
:* Add your custom default lang file (es, ca, fr ...) (the language file must exists in the app's lang/ folder)
** Change the app login form presets
:* Change the app login form presets
* Add your own css files, custom images, etc..
* Add your own css files, custom images, etc..


Line 50: Line 50:


* Build again the app using the SDK for Android and/or iOS
* Build again the app using the SDK for Android and/or iOS
[[Category: Mobile]]

Revision as of 19:13, 24 January 2013

Overview

In this document are described the general steps for building your custom Mobile app.

Creating your custom application

Remember that if you only want to change the global styles of the app, you can use an extra CSS file in your Moodle installation without needing to recompile the app.

Development environment

See Moodle_Mobile#Testing_and_developing

It is recommended that you have a local web server (app and moodle installation under localhost or the same local domain).

You will need:

  • A Moodle installation with Web Services (REST) enabled - see Web services documentation
  • Administration -> Plugins -> Web Services -> External Services -> Enable mobile web service
  • Administration -> Plugins -> Web Services -> Protocols -> Enable REST
  • Administration -> Users -> Permission -> Define roles -> Edit the Authenticated user role -> Allow webservice/rest:use
  • A local copy of the Mobile HTML5 App with the Debugging options Enabled

Web Services Development

In most cases your plugin/s will need Web Services to get data from your Moodle installation. It is recommended that you first develop the Web Services that you will need (see Web Services).

  • Create a new External Service in your Moodle installation, adding a services.php file in your new local plugin or creating manually the service in your Moodle installation.(Plugins -> Web Services) See External services description for more info. Remember the key name of the service, because you will need it later.

Plugin Development

See Moodle Mobile Plugins Development

For developing the plugin you need:

  • Edit the /config.json file to:
  • Add the extra plugins you implement
  • Indicate the WS service name you are going to use in your Moodle installation (Remember, that you need to create a WS Service indicating the functions available for your custom app)
  • Add your custom default lang file (es, ca, fr ...) (the language file must exists in the app's lang/ folder)
  • Change the app login form presets
  • Add your own css files, custom images, etc..

Building

  • Build again the app using the SDK for Android and/or iOS