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 yoto install yo, grunt-cli and bower - run
npm install -g ccato install the chrome mobile utility - run
export PATH=/usr/local/share/npm/bin:$PATHto ensure command line access to modules. - run
cca checkenvto 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 installto initialize node modules - run
bower installto initialize bower dependencies - run
cca pre-prepareto initialize cordova plugins - run
cca platform add iosto add ios platform to project - run
./initializePlugins.shto initialize plugins
Run this the first time, and any time after you make modifications to the www directory.
- run
cca prepareto initialize the platforms directory with ios and android applications - run
./copySplashto copy splash screens fromwww/resto 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://flagsand 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 androidto install the android toolkig - run
androidto 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 namecca pre-preparecca prepare
-
README.mdThis file -
bower.jsonA list of all json dependencies. Do not modify directly. Add new dependencies withbower install <dependency name> --save -
config.xmlA config file for cordova. -
www/All of the actual content of the app is contained in this directory-
index.htmlThe 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.jsonDefines how the chrome app will be packaged, including identifiers, oauth behaviors, permissions, icons, and version name. -
background.jsDefines 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.jsonusingbower 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.jsContains the definition for the main angular appcontrollers/Contains controllers for various parts of the application
-
styles/Contains custom stylesheets for the applicationmain.cssCommon css for the applicationnav.cssStyling related to the top navsidenav.cssStyling related to the side nav
-
views/Contains different screens for the applicationmain.htmlThe 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
