Getting Started

In order to create your first project, first make a directory

$ mkdir myfirstapp
$ cd myfirstapp
$ npm init

you will get the following

 myfirstapp
    |__ package.json

create directory named views and make index.html inside it.

$ mkdir views
$ echo "Hello" > index.html

Now you will get the following

 myfirstapp
    |__views
    |     |__index.html
    |
    |__ package.json
  • views is a directory to store all the views of your app
  • index.html is the first view, render's initially by app (it is must to create index.html inside the view folder)
  • add androidjs.js file in all of your views to access the API's of Android JS (download here)

create main.js file inside the parent directory

$ echo "const androidjs = require('androidjs').back;" > main.js

Now you will get something like this

 myfirstapp
    |__views
    |     |__index.html
    |__ main.js
    |__ package.json
  • main.js is the main process of your android app, which will provide the runtime environment for Node Js

results matching ""

    No results matching ""