Showing posts with label firefox os. Show all posts
Showing posts with label firefox os. Show all posts

Friday, August 14, 2015

Setting up Mozilla FireFox OS development environment and Simulator on Mac.


FireFox OS is developed by Mozilla, the organization behind the Mozilla web browser. FireFox OS is a community driven project and the apps for this OS can be developed using HTML5 and Javascript.

You need Mozilla Firefox browser to develop and debug the firefox os Apps.

Install the latest version of Mozilla Firefox browser from the below link and install the browser.

https://www.mozilla.org/en-US/firefox/new/

Once Mozilla firefox is installed, launch the Mozilla browser and hit ‘Shift arrow-up-9+ F8’. This will launch the Web IDE. Alternatively you can launch Web IDE by Open Menu –> Developer –> Web IDE.

clip_image001

clip_image002

Once the Web IDE is launched, you can create a new app, open existing app, install new simulator or launch the existing simulators.

clip_image004

To install a new simulator, select ‘Select Runtime’ –> Install Simulator.

clip_image006

This will display the list of all the available FireFox OS simulators. If the simulator is already installed, a ‘uninstall’ button will be displayed against the simulator and if the simulator is not yet installed, a ‘install’ button will be displayed against the simulator.

clip_image008

clip_image010

Click on ‘Install’ button against the simulator you want to install to start the installation process.

clip_image012

Installation of FireFox OS simulator on Mac takes some time, so wait till the installation is complete.

clip_image016

Once the installation is complete, ‘Uninstall’ button will be displayed against the simulator installed.

clip_image017

Once the simulator is installed, click on ‘Select Rutime’ from the Firefox WebID and you can the see the installed version of the simulator under the ‘Simulators’ section.

clip_image018

In ‘Simulators’, select version of the Firefox OS you want to simulate. The simulator will be launched.

clip_image020

Now let us run a demo app in the simulator.
In Firefox WebIDE, click on ‘Open App’ and select ‘New App’.

clip_image022

Now you need to select a template for our demo app. Since this is our first app, we will select the ‘HelloWorld’ template.

clip_image024

Provide the project name. It can be anything you like, I just provided it as ‘MyFireFoxOSApp’. Click ‘OK’ after providing the Project Name.

clip_image026

Provide a location where the projection can be saved.

clip_image028

The project is created and displayed in the Firefox WebIDE.

clip_image030

Select the Firefox OS version you want to simulate on right side drop down in the 2nd line of the Firefox WebIDE and click on clip_image031 symbol to launch the project in the simulator.

Screen Shot 2015-08-14 at 6.11.35 pm - Copy

Once the app is launched on the simulator, the ‘Stop ‘button beside the ‘Start’ button will be enabled and the ‘Start’ button is changed to the ‘Install and Run.’

clip_image035

The app is launched in the simulator and the below screen is displayed. Since we haven’t really added any code and ran only the template, it is perfectly fine.

clip_image037

Click on stop button to stop the app running in the simulator.

Screen Shot 2015-08-14 at 6.05.43 pm - Copy

Now let us make a small change to the code and see if the change is reflected in the simulator. On the FireFox Menu bar select ‘Device Preferences’

clip_image041

On the Device Preferences, In General section, Select ‘Show editor’ if it is not already selected. This will displayed the editor if it is not already displayed.

clip_image042

As you can see, the app project structure along with the editor is displayed after we changed the preferences above.

clip_image044

Now let us make a small change to the app. Select índex.html’ and the file content is displayed.
Change the ‘Hello World’ to ‘Hello Firefox OS’ and save the modifications.

clip_image046

clip_image048

Now Ínstall & Run‘ the app and modifications done are reflected in the app on the simulator.

clip_image050

The installation of Mozilla FireFox OS development environment is similar on the Windows, Linux or the Mac platforms as the Web IDE is integrated into Mozilla FireFox browser and so all the process will be similar. We have seen on how to set up FireFox OS development environment, including how to install the simulators and running simulators on Mac and also we created a sample application. The process for creating complex apps is also similar, but you need to have better understanding of the FireFox OS API’s.



Wednesday, August 12, 2015

Setting up FireFox OS development environment on Ubuntu.


Mozilla FireFox comes preinstalled on Ubuntu OS. If it is not preinstalled on your flavor of Linux, install Mozilla FireFox from the below link.

https://www.mozilla.org/en-US/firefox/all/

Once Mozilla Firefox is installed, launch the Mozilla browser and hit ‘Shift + F8’. This will launch the Web IDE. Alternatively you can launch Web IDE by Open Menu --> Developer --> Web IDE.

mozilla-ubuntu-22

clip_image004

Once the Web IDE is launched, you can create new apps, open existing apps, launch the simulators or create new simulators.

mozilla-ubuntu-2

To install a new simulator, select ‘Select Runtime’’ and Click on ‘Install Simulator’ to install a new simulator.

mozilla-ubuntu-3

mozilla-ubuntu-3-1

Click on the ‘Install’ against the latest version of the FireFox OS simulator to install the latest version of the simulator.

mozilla-ubuntu-4

mozilla-ubuntu-5

mozilla-ubuntu-6

It won’t take long to install the Firefox OS simulator. Installing Firefox OS simulator is really fast.
Once the simulator is installed, click on ‘Select Runtime’ from the Firefox WebIDE.

mozilla-ubuntu-8

mozilla-ubuntu-8-1

In ‘Simulators’, select version of the Firefox OS you want to simulate. The simulator will be launched.

mozilla-ubuntu-7

Now let us run a demo app in the simulator.
In Firefox WebIDE, click on ‘Open App’ and select ‘New App’.

mozilla-ubuntu-9

Now you need to select a template for our demo app. Since this is our first app, we will select the ‘HelloWorld’ template.

mozilla-ubuntu-10

Provide the project name. It can be anything you like, I just provided it as ‘MyFireFoxProject’’'. Click ‘OK’ after providing the Project Name.

mozilla-ubuntu-11

Select a location where the projection can be saved.

mozilla-ubuntu-12

mozilla-ubuntu-13

The project is created and displayed in the Firefox WebIDE.

mozilla-ubuntu-14

Select the Firefox OS version you want to simulate on right side drop down from the controls in the 2nd line of the Firefox WebIDE and click on clip_image010 symbol to launch the project in the simulator.

mozilla-ubuntu-15

Once the app is launched on the simulator, the ‘Stop ‘button beside the ‘Start’ button will be enabled and the ‘Start’ button is changed to the ‘Install and Run.’
 
mozilla-ubuntu-23

mozilla-ubuntu-16

The app is launched in the simulator and the below screen is displayed. Since we haven’t really added any code and ran only the template, it is perfectly fine.

mozilla-ubuntu-18

Click on stop button to stop the app running in the simulator.

mozilla-ubuntu-24

Now let us make a small change to the app. Select índex.html’ and the file content is displayed.

mozilla-ubuntu-19

Now let us change the ‘Hello World’ to ‘Hello Firefox OS’ and save the modifications by doing a Ctrl+S.

mozilla-ubuntu-20

Now Ínstall & Run‘ the app and modifications done are reflected in the app on the simulator.

mozilla-ubuntu-21

We have configured the environment to develop FireFox apps and test them on simulators and ran sample apps. We should be able to create more complicated apps following the same process.

< Previous