Linux Format

Cordova and Ionic framework

-

Many people who take on app developmen­t already have a background in HTML, CSS and JavaScript that are popular front-end technologi­es for building websites. There are few steps involved to making this happen – first of all, open your terminal.

You need Node.js and Nodejs package manager installed, Apache Cordova, and optionally, Ionic Framework. sudo apt-get update sudo apt-get install nodejs sudo apt-get install npm sudo npm install -g cordova sudo npm install -g ionic

Now that the required packages are installed, let’s move on to setup and editing. First, let’s start a new Apache Cordova project. The first step is to navigate to the folder where you will store the package. For an easy demo, you can simply use the desktop: cd Desktop mkdir cordova cd cordova

At this point, you can start a new project. But you will likely need to make a symbolic link to Nodejs from Node as Cordova can trigger an error by going to the wrong path. The code for that is below: ln -s /usr/bin/nodejs /usr/bin/node cordova create example com.example.hello HelloWorld After that, the next couple of steps are: cd example cordova platform add android --save For more details see https://cordova. apache.org/docs/en/latest/guide/cli/. Now, let us start a new app using Ionic Framework, as follows: cd cd Desktop mkdir ionic ionic start example blank cd example ionic platform add android To build and test your Cordova app you can run the code below: cordova build cordova run android For Ionic, you can run the code below. ionic build android ionic run android More details and help can be found at http://ionicframe­work.com/docs/guide/ starting.html.

Newspapers in English

Newspapers from Australia