Configure & Install Cordova Mobile Development Framework

Cordova is a life saver as it saves you from learning the native mobile programming languages. You can use your web programming skills to develop a decent looking mobile app. Cordova will package your HTML & give you an installation file that you can submit to app stores.

Cordova comes with many plugins to expose the native device functionality. If you intend to use the Camera, there is a plugin, same for device file system & storage & so on.

MAC or PC

Question to use a MAC or PC doesn’t even arise if you intend to develop for iOS. You will need a MAC to do any kind of Apple programming. PC will only be sufficient for Android or Windows Phone based development.

Go buy a decent MAC, if you are serious about developing mobile applications. I prefer to use the MACBOOK PRO as the main development machine to build both iOS & Android projects. However a PC would do the job if you just intend to get your hands dirty & explore the world of mobile application development.

Whether you decide to use a MAC or PC, the steps to install & configure Cordova are almost same.

Prepare development environment

You need to install the following components on your MAC or PC. Remember iOS development tools i.e. XCODE can only be installed on a MAC. XCODE installation package includes all the iOS bits & pieces so you don’t need to install the SDK separately.

Once these components are installed, remember to include these on your MAC’s path. How to do that, just Google & find out or you could simply execute the following statements every time you start a Terminal session. Let me know if you find a better way to do it.

# Add Android Tools & Ant to Path
echo $PATH
export PATH=~/Documents/adt-bundle-mac/sdk/tools:$PATH
export PATH=~/Documents/adt-bundle-mac/sdk/platform-tools/:$PATH
export PATH=~/Documents/apache-ant-1.9.4/bin:$PATH

Run following commands in terminal window to ensure you have everything ready:

  • “java –version” E.g. for Java 8, version number is "1.8.0_05”
  • “node –v” or “ant –v” to find out node or ant version
  • “adb devices” to find out any android emulators or physical devices currently running

Install Cordova

Well this is pretty straight forward & all of it is clearly documented on Cordova website. Just follow the article to install Cordova, create a demo project, add platforms & build.

# Install latest version of Cordova
# sudo is only required if you are on a MAC. Remove “sudo” if installing on PC
sudo npm install -g cordova

# Create a sample project
# Once created, you can open the project in XCODE or Eclipse
cordova create hello com.example.hello HelloWorld

# Change to sample project directory
cd hello

# Add platforms
cordova platform add ios
cordova platform add android

# Check platforms
cordova platforms ls

# Build iOS
cordova build ios

# Add plugin
cordova plugin add org.apache.cordova.device
cordova plugin add org.apache.cordova.splashscreen 

Comments

Popular posts from this blog

SharePoint 2013 Search Service Activation Error

VMWare Workstation - Assign a static IP address

Office365: Assigning licenses using Azure AD PowerShell