An open API service indexing awesome lists of open source software.

https://github.com/ragingwind/mobile-chromeapp-starter-kit

Mobile Chrome Apps Starter Kit
https://github.com/ragingwind/mobile-chromeapp-starter-kit

Last synced: about 1 year ago
JSON representation

Mobile Chrome Apps Starter Kit

Awesome Lists containing this project

README

          

# Mobile Chrome Apps Starter Kit

![Demo for Mobile Chrome Apps Starter Kit](https://cloud.githubusercontent.com/assets/124117/9600512/671e3ba4-50d6-11e5-8e2f-cdf37431b88a.gif)

> Mobile Chrome Apps Starter Kit is Yet Another Opinionated Boilerplate for Chrome Apps development. "Helping you to stay productive following the best practices. A solid starting point for both professionals and newcomers to the industry." - [google/web-starter-kit](http://goo.gl/YNV3lb)

*Issues with the output or build should be reported on the `Mobile Chrome App` [issue tracker](https://github.com/MobileChromeApps/mobile-chrome-apps/issues) or `Polymer Starter Kit` [issue tracker](https://github.com/PolymerElements/polymer-starter-kit/issues).*

## Setup

1. Install [Mobile Chrome Apps](http://goo.gl/nU5O6U) and Android or iOS SDKs. Please refer to [Install guide of Mobile Chrome Apps](https://github.com/MobileChromeApps/mobile-chrome-apps/blob/master/docs/Installation.md) for further information and then please make sure that your development environment can use `cca checkenv`. You will get a message like below if you have no problem to use `cca`
```
cca v0.x.x
Android Development: SDK configured properly.
iOS Development: SDK configured properly.
```

1. Update some of properties of package.json which might be related to your project such as `name`, `appId`, `description`, `repository` and `author`, will be used to update `config.xml` for Cordova project.

```
{
"name": "mobile-chromeapp-starter-kit",
"appId": "com.your.appid2",
"description": "Mobile Chrome Apps Starter Kit is Yet Another Opinionated Boilerplate for Chrome Apps development",
"author": {
"name" : "Jimmy Moon",
"email" : "ragingwind@gmail.com",
"url" : "http://ragingwind.me"
},
"repository": "ragingwind/mobile-chromeapp-starter-kit",
}
```

1. Run those commands to install dependencies for npm and bower
```
npm install && npm run setup
```
After installing npm packages by `npm install`, `postinstall` script will be started as soon, to install the rest of npm packages and download some of patches from github to update PSK source files such as `gulpfile.js`, `route.html` and `app.js`. And then `npm run setup` command will execute setup command of `cca` to set up Cordova project, during this time, properties of package.json will be used for.

## Build and Run

To build and run application. First, get into `src` path first.

```sh
cd src
```

Next, build your PSK project by gulp on `src`

```sh
gulp
```

, and then run the app on particular platform what you want to

```
gulp cca:run --platform=chrome

```

, or for Android.

```sh
gulp cca:run --platform=android
```

### Extra gulp commands for Cordova(CCA)

This project has extra gulp commands to build and run Cordova(cca) project, which is in the `src/tasks`. Please refer to commands below

- `gulp cca:build`: build application and then build Cordova project. `platform` should be passed for build,
`--platform=android`. **At this moment, we only support build for android**
- `gulp cca:run`: run cordova project on emulate or devices. use options with `--platform=chrome|android` and `--run=emulate|device`
- `gulp cca:push`: run `cca push` command on the `platform` path. You should give target with ip address, with target option `--target=192.168.0.10` and `--watch`
- `culp cca:package`: Make and copy a unsigned zip file for Chrome and apk of Android to `package` path. It should be run after `build`

Please visit reference sites if you want to know further details of cca build commands.

## Clean or reset

If you would like to clean, reset the project to start at begin again? you can use clean-up command for npm. run below command stay on project file root. WARNING, it will remove all of files what you created after installing and setup.

```sh
npm run reset
```

## Mobile Chrome Apps

We use pre-created Cordova project for Mobile Chrome App, that means you need to update a few of configurations to fit your application what you want. During first installation time of the cca project will be configured with properties of package.json, such as application id, name or version. We are using handy script command, [cordova-config-cli](https://www.npmjs.com/package/cordova-config-cli) allow you to set a new value to config.xml. If you would like to update more configurations please see [cordova-config-cli](https://www.npmjs.com/package/cordova-config-cli) for more information

## Migrations for Polymer Starter Kit (PSK)

We use final released the full version of PSK as default application. After downloading PSK, we have to have some of changes from PSK through `npm postinstall` to fit in Chrome Apps following the [recipe](https://github.com/PolymerElements/polymer-starter-kit/blob/master/docs/mobile-chrome-apps.md). Please see below what will be changed.

- at `gulpfile.js`, Change `dist` path, Update vulcanize task
- at `app/scripts/app.js`, Change base path
- at `app/elements/routing.html`, Update default route
- at `app/bower_components/font-roboto/roboto.html`, `link` will be replace to `@import`

## Known Issues

- Tested on Mac OS X with Android and chrome only except iOS
- Some of files should be removed before build and release to App store in manually. For example `manifest.json`, `.gz`
- All of features of Polymer Starter Kit has not been tested yet
- Failed to route `home` at starting the application on Android's emulator/device

# License

MIT @[Jimmy Moon](http://ragingwind.me)