HTML5 App Demo for Mobiles, starting from Android
-
Install JDK
1.1 Download the JDK from Oracle site
1.2 Run the installer
1.3 Setup the environment variables
JAVA_HOMEJDK_HOMEJRE_HOME -
Install Android SDK
2.1 Download the Android SDK from android developer site
2.2 Unzip the downloaded file
2.3 Setup the environment variables
ANDROID_PLATFORM_TOOLS_PATHANDROID_TOOLSANDROID_HOME -
Install Node JS and Apache Cordova
In Ubuntu
3.1
sudo apt-get install nodejs3.2
sudo apt-get install npm3.3
sudo npm install -g cordova3.4 Cordova Platform Setup
-
Creating the project
4.1 Create a project directory
run `cordova create html5-snake-app org.yit.demo SnakeApp -d`4.2 Add Android platform support
run `cd html5-snake-android` run `cordova platform add android -d` run `cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion.git`
Go to project directory
-
Build the app
run `cordova build -d` -
Lauch the app in the emulator
run `cordova emulate android -d`
Copy the apk file from platforms/android/bin