If you want to learn how to develop Android & iOS Mobile apps using HTML, CSS, JS & Apache Cordova then enroll in my course here with 90% discount.
The web development community has been continually innovating and with the recent development of frameworks such as Angular, IONIC, jQuery and React, the traditional web applications have now almost become indistinguishable from their native platform-specific peers in terms of functionality.
However, the use of Web-based technologies leads some Apache Cordova applications to run slower than native applications with similar functionality.
And the most important thing is: Cordova is free and open source. Here’s how to get started with Apache Cordova.
Use Apache Cordova if you are:
- a mobile developer and want to extend an application across more than one platform, without having to re-implement it with each platform’s language and toolset.
- a web developer and want to deploy a web app that’s packaged for distribution in various app store portals.
- a mobile developer interested in mixing native application components with a WebView (special browser window) that can access device-level APIs, or if you want to develop a plugin interface between native and WebView components.
If you would like to watch and learn from video then you must watch on YouTube and also subscribe to the “Instill Learning” YouTube channel for a future tutorial.
Before creating a new Cordova App, there are few prerequisites and you have to install this software:
*Node.js (npm comes with Node.js) [ https://nodejs.org/en/ ]
*Cordova [after installing node.js, you can install cordova through command line or terminal by using following command “npm install -g cordova“] [ https://cordova.apache.org/#getstarted ]
cordova create DeviceInfo info.androidabcd.deviceinfo DeviceInfoSample
After creating the new app, move to Cordova project folder
cordova platform add android@latest
cordova plugin add cordova-plugin-device
By using this plugin you get the following device information:
If you haven’t install visual studio code then download and install from here: https://code.visualstudio.com/
You can open the Cordova project from the command line or terminal by typing ” code . ” [code space dot], or you can directly drag & drop the project into visual studio code.
After editing the source code in www folder, you must prepare the code, so that it can distribute to all platforms you have added. to prepare the source code type following command in the command line or terminal:
Once you build your Cordova project, you will notice that it will generate APK File and that you can install it manually in any Android device. Or if you want to install the app using the command line then see the next step.
cordova build android
You have to run Android Emulator before running this command.
cordova run android
How to run an Emulator