BUILD.md
March 19, 2015 ยท View on GitHub
Building the project
These steps project lead you to the required steps to build the www folder that contains the web application.
Requirements
- Ruby (for Windows)
- Compass:
gem install compass - Node.js (including NPM)
- Gulp
npm install -g gulp(maybe with sudo) - Bower
npm install -g bower(maybe with sudo)
Installation
- Checkout PPnet 2.0 Repository
git clone https://github.com/pixelpark/ppnet - Switch into ppnet folder
cd ppnet - Install required NPM Packages
npm install - Install Bower dependencies
bower install- If you have to decide between different angular versions, use angular version 1.3.14.
- Run Gulp
gulp
Build the Phonegap/Cordova App
Requirements
- NodeJS
- Java JDK
- JRE is not sufficient
- Win7/64bit: jdk-7u51-windows-x64.exe
- Ant
- Android SDK / Xcode
- Phonegap
The project must be build.
Steps
We use gulp for building an optimized version of the app-folder. The output is saved to the www-folder.
Important: since the app needs Chromium as the default engine, only KitKat (Android >= 4.4.2) is supported. You can, however, also use the Chrome browser on any Android.
-
cd /PATH/TO/ppnet/ -
Add Android as a platform to cordova (I don't think you need to do that?):
cordova platform add android cordova platform add ios -
Add Plugins
phonegap local plugin add org.apache.cordova.device-orientation phonegap local plugin add org.apache.cordova.file phonegap local plugin add org.apache.cordova.file-transfer phonegap local plugin add org.apache.cordova.device phonegap local plugin add org.apache.cordova.camera phonegap local plugin add org.apache.cordova.statusbar phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git -
Build Android APK
phonegap build androidOr build Android APK and deploy to device
phonegap run android
Install Java/Ant on Windows
- Create the environment variable
JAVA_HOMEand set it to your JDK directory. This should look similar to: "C:\Program Files\Java\jdk1.7.0_51" - Add
%JAVA_HOME%\binto the environment variablePATH.
If everything worked out you can type java -version in a terminal and it should return the version number without errors.
- Install ANT http://ant.apache.org/manual/install.html (Kudos to Tobias Seckinger)
- Move the content of the zip file to
c:\ant. - Add
c:\ant\binto the environment variablePATH: - Create the environment variable
ANT_HOMEand set it toC:\ant. - Create the environment variable
ANT_OPTSand set it to-Xmx256M.
If everything worked out you can type ant -version in a terminal and it should return the version number without errors.
- Install Android SDK http://developer.android.com/sdk/
- Move the installation to C:\android.
- Create the environment variable
ANDROID_HOMEand set it toc:\android\sdk.
If everything worked out you can type android -h in a terminal and it should return the help text without errors.
Install Java/Ant on Ubuntu
On Ubuntu you can do it with this script (old version here ).
Setting up CouchDB
First, you need to install it (this is not mandatory, but additionally you might want to install these enhancements. Once you did that, you can access the administration interface on http://yourip.com:5984 where you need to enable CORS.
You do that by editing these values:
httpd enable_cors true
cors credentials true
cors headers accept, authorization, content-type, origin, Cookie
cors methods GET, PUT, POST, HEAD, DELETE
cors origins *
If your CouchDB is not on a local machine, you need to edit the configfile (usually at /usr/local/etc/couchdb) and edit this line:
[httpd]
bind_address = 0.0.0.0
To connect the web app to your own database, you only need to change the remoteentry in config file located in the www-folder.
Once you did that, you are good to go.