Note:

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

Using the Moodle App in a browser: Difference between revisions

From MoodleDocs
(Created page with "Install the “Chromium” browser: https://download-chromium.appspot.com/ 4 Install the “Chromium” browser: https://download-chromium.appspot.com/ 5 In order to be able...")
 
No edit summary
Line 1: Line 1:
Install the “Chromium” browser: https://download-chromium.appspot.com/
Chromium or Google Chrome browser are the recommended tools for Moodle Mobile development. But remember that if you are going to use functions provided by Phonegap you should use the Android SDK o iOs developer tools.


4 Install the “Chromium” browser: https://download-chromium.appspot.com/
== Differences between Chromium and Google Chrome ==


5 In order to be able to test the Mobile app in the Chromium browser, you need to launch the app using the command line (Terminal):
Google Chrome is the Chromium open source project built, packaged, and distributed by Google. We can say that Chromium is Google Chrome without the "Google" add-ons


open -a /Applications/Chromium.app --args --allow-file-access-from-files --disable-web-security
See https://code.google.com/p/chromium/wiki/ChromiumBrowserVsGoogleChrome for more information


6 Once opened, drop the index.html file of your forked repository or open it using Open - Open File
We recommend to use Chromium instead Google Chrome
Tip: You can configure the Chromium browser to use the index.html as home page


7 You can quick login just entering “student” or “teacher” in the Username field and clicking on “Add”
== Advantages and disadvantages of using Chromium/Google Chrome ==
 
Main advantages
* Quick development
* DOM inspector
* Network monitor
* Database (local storage) inspector
* Emulation options
 
Disadvantages
* You can't test/develop using Phonegap APIs and Plugins
* If you use custom Phonegap code (including plugins) you will need to edit the mm.cordova.js for "emulate" that APIs in a browser
* You will need always to test in a real device and emulator prior to a production release
* You will need to verify that your CSS/layout works the same in an Android/iOs device
 
== Installation ==
 
Install the “Chromium” browser just downloading from https://download-chromium.appspot.com/
 
In order to be able to access any domain via AJAX from the local file:/// protocol, you must run Chromium or Google Chrome in Unsafe mode adding this param:
 
--allow-file-access-from-files --disable-web-security
 
IMPORTANT: I strongly recommend you create a new link or application launch called "Chrome Unsafe" and use it only for testing the app. Better if you only use this browser for development
 
How to open the browser:
 
"Path to chrome\chrome.exe" --allow-file-access-from-files --disable-web-security
 
or in Mac (you can use Automator for creating an app bundle)
 
open -a "Google Chrome" --args --allow-file-access-from-files --disable-web-security
 
or for Chromium
 
open -a /Applications/Chromium.app --args --allow-file-access-from-files --disable-web-security
 
In Mac you can use Automator for creating a launching app
 
 
== Browser Settings ==
 
With Chromium or  Google Chrome and the F12 or "Developer tools" you can emulate mobile devices changing orientation, resolution, geo-location, touch events... It's not recommended to use de "Emulation Device" option because it just changes the user-agent and you could get some fails because of the jQuery Swipe. The best option to test with the browser is just rescaling the window to get a new viewport size.
 
Just open the Developers tools, click on the wheel bottom-right corner to see the Override options.
 
It's interesting also disabling the Cache (in general options)

Revision as of 21:16, 26 June 2014

Chromium or Google Chrome browser are the recommended tools for Moodle Mobile development. But remember that if you are going to use functions provided by Phonegap you should use the Android SDK o iOs developer tools.

Differences between Chromium and Google Chrome

Google Chrome is the Chromium open source project built, packaged, and distributed by Google. We can say that Chromium is Google Chrome without the "Google" add-ons

See https://code.google.com/p/chromium/wiki/ChromiumBrowserVsGoogleChrome for more information

We recommend to use Chromium instead Google Chrome

Advantages and disadvantages of using Chromium/Google Chrome

Main advantages

  • Quick development
  • DOM inspector
  • Network monitor
  • Database (local storage) inspector
  • Emulation options

Disadvantages

  • You can't test/develop using Phonegap APIs and Plugins
  • If you use custom Phonegap code (including plugins) you will need to edit the mm.cordova.js for "emulate" that APIs in a browser
  • You will need always to test in a real device and emulator prior to a production release
  • You will need to verify that your CSS/layout works the same in an Android/iOs device

Installation

Install the “Chromium” browser just downloading from https://download-chromium.appspot.com/

In order to be able to access any domain via AJAX from the local file:/// protocol, you must run Chromium or Google Chrome in Unsafe mode adding this param:

--allow-file-access-from-files --disable-web-security

IMPORTANT: I strongly recommend you create a new link or application launch called "Chrome Unsafe" and use it only for testing the app. Better if you only use this browser for development

How to open the browser:

"Path to chrome\chrome.exe" --allow-file-access-from-files --disable-web-security

or in Mac (you can use Automator for creating an app bundle)

open -a "Google Chrome" --args --allow-file-access-from-files --disable-web-security

or for Chromium

open -a /Applications/Chromium.app --args --allow-file-access-from-files --disable-web-security

In Mac you can use Automator for creating a launching app


Browser Settings

With Chromium or Google Chrome and the F12 or "Developer tools" you can emulate mobile devices changing orientation, resolution, geo-location, touch events... It's not recommended to use de "Emulation Device" option because it just changes the user-agent and you could get some fails because of the jQuery Swipe. The best option to test with the browser is just rescaling the window to get a new viewport size.

Just open the Developers tools, click on the wheel bottom-right corner to see the Override options.

It's interesting also disabling the Cache (in general options)