YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

Creating a custom Moodle Mobile app

Juan LeyvaMoodle Mobile Lead Developer

Daniel PalouMoodle Mobile Developer (CV&A)

@jleyvadelgado #mootes14

Page 2: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● Code editor (Sublime, WebStorm, Eclipse, Netbeans...)

● Github account (http://github.com/)

● Github desktop app (http://windows.github.com/)

● PhonegapBuild account (https://build.phonegap.com/)

● Chromium browser as described here:

https://docs.moodle.org/dev/Moodle_Mobile_development_using

_Chrome_or_Chromium

● Will be a plus: Moodle Mobile Simulator:

https://docs.moodle.org/dev/Moodle_Mobile_simulator

● Will be a plus: QR reader app for Android

Requirements

Page 3: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

Moodle Mobile is the official mobile

app for Moodle

https://download.moodle.org/mobile/

Moodle Mobile

Page 4: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● Custom corporate image (name, app icon,

theme, store entry)

● Add additional features or static pages

● Remove or change existing features

● Custom translation of the app

● Use your own notifications infrastructure

Why a custom app?

Page 5: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

https://github.com/moodlehq/moodlemobile

Fork the app

Page 6: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

You can use your favourite GIT client (or GitHub

Desktop clients)

git clone [email protected]:jleyva/moodlemobile.git

Clone the repo in your desktop

Page 7: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

Create a new branch

Page 8: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

about.json: Your app information

config.json: App settings

config.xml: Cordova/Phonegap settings

README.md: App info (github)

package.json: Node-webkit info

Edit the configuration files

Page 9: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

We need to change:

● id: com.moodle.moodlemobile ->

net.moodlemoot.mootes14

● versionCode, version, and

CFBundleShortVersionString

● Name, description, author, etc…

● URL_SCHEME: mootes14

https://github.com/jleyva/moodlemobile/blob/mootes14/config.xml

config.xml

Page 10: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

We need to change:

● app_id: Use the same that in config.xml

● versioncode, versionname: Same that config.xml

● default_lang: es

● Delete demo_sites

● Replace reportbugmail

● Add the Site URL in presets.url

https://github.com/jleyva/moodlemobile/blob/mootes14/config.json

config.json

Page 11: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● Overwrite the images in img/icon/ with other ones

with the same properties (alpha, width and height)

● Same for the img/splash/ directory

● Use online tools like: http://makeappicon.com/

Replace the app icons, splashscreen

Page 12: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

That’s all folks!

Page 13: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● Commit your changes!

● Create an account in:

https://build.phonegap.com/

https://build.phonegap.com/apps/1211443/builds

Build the app using Phonegap Build

Page 14: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● For iOs you need to create certificates/provisioning

files: http://docs.build.phonegap.com/en_US/

● Android, you can download and install the .apk

Build the app using Phonegap Build

Page 15: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● https://docs.moodle.org/dev/Moodle_Mobile_Themes

Create a custom theme

Page 16: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● The theme:

https://github.com/jleyva/moodlemobile/blob/mootes1

4/plugins/mootes14/theme.css

Create a custom theme

Page 17: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

Two options for adding the theme in the app:

1. Via Moodle settings:

2. Creating a plugin for the app. Recommended for

custom apps. (Described below).

Create a custom theme

Page 18: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● Remove plugins

You can easily disable some of the existing plugins,

edit the config.json and remove plugins from the

“plugins” array

● Reorder plugins

In the same “plugins” array you can reorder the

plugins list.

Remove existing features

Page 19: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● Edit the lang/xx.json file for replacing the

language strings used in the app.

Change the app strings

Page 20: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● Create a new plugin

● Inject the theme once the plugin is loaded

● This plugin can be used for replacing core

functionality, adding new static pages, etc…

● You can create multiple plugins

Plugin code:https://github.com/jleyva/moodlemobile/tree/mootes14/plugins/mootes14

Replace the base theme

Page 21: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● In the plugin created for the theme, you can add

custom html templates to replace existing core

templates.

Plugin code:https://github.com/jleyva/moodlemobile/tree/mootes14/plugins/mootes14

Change the sign-in form

Page 22: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● Static pages:

Add new options in the app

Page 23: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

● Sync your fork:

https://help.github.com/articles/syncing-a-fork/

● Rebase your changes (and resolve conflicts):

git rebase master mootes14

● Upgrade your version number

● Commit your changes

● Rebuild with Phonegap build

● Publish in the store

Keep your custom version up2date

Page 24: Creating a custom Moodle Mobile app -  MoodleMoot Spain 2014

You have more information here:

https://github.com/jleyva/moodlemobile/tree/mootes14

https://build.phonegap.com/apps/1211443/builds

http://docs.moodle.org/en/Mobile_app

https://docs.moodle.org/en/Moodle_Mobile_additional_features

http://docs.moodle.org/dev/Moodle_Mobile

https://tracker.moodle.org/browse/MOBILE

Thanks for coming


Related Documents