From d2a711c312b9774db737b97ad03df526d340c3cd Mon Sep 17 00:00:00 2001 From: Chhekur <820121223505e@gmail.com> Date: Sun, 7 Jul 2019 19:09:55 +0530 Subject: [PATCH 1/2] update: documentation --- build/package.json | 2 +- docs/configuring_app.md | 31 +++++++++++++++++++++++++++++-- docs/generating_project.md | 5 ++--- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/build/package.json b/build/package.json index 7e04f71..53ae513 100644 --- a/build/package.json +++ b/build/package.json @@ -1,6 +1,6 @@ { "name": "androidjs", - "version": "2.0.0", + "version": "2.0.1", "description": "Android JS Is A Framework For Creating Android Applications With Web Technologies Like JavaScript, HTML, And CSS.", "main": "index.js", "scripts": { diff --git a/docs/configuring_app.md b/docs/configuring_app.md index dc673b1..43f64b2 100644 --- a/docs/configuring_app.md +++ b/docs/configuring_app.md @@ -60,7 +60,7 @@ In order to change the **icon** of your app, you'll have to define `icon` attrib ``` #### `Adding permissions to your android app` -In order to add the android permissions, you will have to define an array of `permissions` in `package.json` file of your app +In order to add the android permissions, you will have to define an array of `permissions` attribute in `package.json` file of your app ```json { @@ -82,7 +82,7 @@ In order to add the android permissions, you will have to define an array of `pe you can find the permissions over android official [documentation](https://developer.android.com/guide/topics/permissions/overview) #### `Adding output directory` -In order to add the output directory, you will have to define `dist-path` in `package.json` file of your app +In order to add the output directory, you will have to define `dist-path` attribute in `package.json` file of your app ```json { @@ -101,3 +101,30 @@ In order to add the output directory, you will have to define `dist-path` in `pa "license": "ISC" } ``` + +#### `Define Project Type` +In order to define project, you will have to define `project-type` attribute in `package.json` file of your app + +- `webview` + - if you are building `webview` based app or 'HTML / CSS' based +- `react-native` + - if you are building `react native` based app + +```json +{ + "name": "myfirstapp", + "app-name" : "My First App", + "package-name": "myapp", + "permission": ["android.permission.INTERNET", "android.permission.SEND_SMS"], + "dist-path": "./dist", + "project-type":"webview", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" +} +``` diff --git a/docs/generating_project.md b/docs/generating_project.md index 59d1f35..985e224 100644 --- a/docs/generating_project.md +++ b/docs/generating_project.md @@ -5,11 +5,10 @@ Android JS enables you to create android applications with pure JavaScript by providing a runtime with rich native (android) APIs. You could see it as a variant of the Node.js runtime that is focused on android applications instead of web servers. ```sh -mkdir myfirstapp -cd myfirstapp -androidjs g +androidjs init npm install ``` +it will ask for `APP NAME` (i.e. myfirstapp) it will generate a sample project inside `myfirstapp` ```text From fcfbb6590c885f9c6d571338b2aea2cd28c4c35e Mon Sep 17 00:00:00 2001 From: Chhekur <820121223505e@gmail.com> Date: Sun, 7 Jul 2019 19:12:02 +0530 Subject: [PATCH 2/2] update: docs/index.md --- docs/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.md b/docs/index.md index 8bb0e28..ad2089d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,6 +8,7 @@ - [Change the icon of your app](configuring_app.md#change-the-icon-of-your-app) - [Adding permissions to your android app](configuring_app.md#adding-permissions-to-your-android-app) - [Adding output directory](configuring_app.md#adding-output-directory) + - [Define project type](configuring_app.md#define-project-type) - [Getting Started](getting_started.md) - [IPC (Inter Process Communication)](ipc.md) - [Back Module](ipc.md#back-module)