This is a generic app framework that can run as a standalone webpage, a chrome extension, an android app, or an ios app.
It will use the tools provided by angular's material-design package to provide basic application scaffolding.
This is a very early work in progress.
The material-design repo provided by angular is now an official bower distribution.
In addition to basic application scaffolding, this repo will provide various common mobile application behaviors, as dictated by material design.
At some point this will be a yeoman template or something, until then you can:
- Clone this repo and delete the .git directory
- Update the application name in www/manifest.mobile.json
- Update the application name in bower.json and package.json
- Follow the steps below to get the boilerplate app working.
- run
npm install -g yo
to install yo, grunt-cli and bower - run
npm install -g cca
to install the chrome mobile utility - run
export PATH=/usr/local/share/npm/bin:$PATH
to ensure command line access to modules. - run
cca checkenv
to ensure your machine is set up for mobile development. If not this will instruct you on how to get Xcode and android development environments initialized for use with cca. - run
npm install -g ios-deploy
- run
npm install -g ios-sim
- run
npm install
to initialize node modules - run
bower install
to initialize bower dependencies - run
cca pre-prepare
to initialize cordova plugins - run
cca platform add ios
to add ios platform to project - run
./initializePlugins.sh
to initialize plugins
Run this the first time, and any time after you make modifications to the www
directory.
- run
cca prepare
to initialize the platforms directory with ios and android applications - run
./copySplash
to copy splash screens fromwww/res
to the platforms directories - this is currently not handled by cordova
- grunt serve
The chrome extension is the easiest to modify and debug.
- In your chrome browser, enable chrome developer flags at
chrome://flags
and enable "Experimental Extension APIs" - Go to Tools -> Extensions
- Load Unpacked Extension- navigate to
./www
The chrome app can be debugged with the standard "Inspect Element" debugger in a chrome web browser.
The android app can be run in an emulator, which can be installed with brew
- run
brew install android
to install the android toolkig - run
android
to download packages and set up an avd device.
To run the android on an emulator or connected device
- Attach an android device in debug mode, or run the android avd emulator.
- if you are running on a connected device you can verify first with
adb devices
- run
cca run android
TODO
The ios app can be run in an emulator, which can be installed via xcode. It can only be installed on devices with a valid provisioning profile, which requires a paid apple developer account.
To run on a emulator
- run
cca emulate ios
To run on a connected device (requires provisioning)
- run
cca run ios
- Run Xcode
- Open
./platforms/ios/*.xcodeproj
- Click Run
- At the command line run
defaults write com.apple.Safari IncludeDebugMenu 1
(you only need to do this once) - Launch the app in the emulator
- Launch safari
- Connect to the Iphone Simulator in the Develop menu
- Find a module with
bower search <search term>
- Install it and save it to your bower.json file with
bower install <javascript module> --save
cca plugin add <plugin name
cca pre-prepare
cca prepare
-
README.md
This file -
bower.json
A list of all json dependencies. Do not modify directly. Add new dependencies withbower install <dependency name> --save
-
config.xml
A config file for cordova. -
www/
All of the actual content of the app is contained in this directory-
index.html
The skeleton of one-page application mostly just contains javascript and css imports. Very little modifications should be made to this, other than new bower dependencies or css. -
manifest.json
Defines how the chrome app will be packaged, including identifiers, oauth behaviors, permissions, icons, and version name. -
background.js
Defines the behavior of the chrome app, including the landing page, and the window size of the chrome extension (does not affect ios or android). -
assets/
Contains icons that will be used to represent the app -
bower_components/
Contains external javascript and css dependencies brought in by bower.json. Should not be version controlled or modified directly- make all modifications to../bower.json
usingbower install --save
-
images/
Contains all packaged images used by the application, i.e. logos. -
res/
Contains resources used by the packaged apps, such as splash screens (TBD). -
scripts/
Contains all angular scripts and javascript objects used by the applicationapp.js
Contains the definition for the main angular appcontrollers/
Contains controllers for various parts of the application
-
styles/
Contains custom stylesheets for the applicationmain.css
Common css for the applicationnav.css
Styling related to the top navsidenav.css
Styling related to the side nav
-
views/
Contains different screens for the applicationmain.html
The landing page that the user first sees
-
platforms/*
These files are generated by cca prepareplugins/*
These files should be generated with cca plugin install as they vary by machinenode_modules/*
These files are generaetd by npm installwww/bower_components/*
These files are generated by bower install