<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Gaurab Kumar</title>
    <description>The latest articles on Forem by Gaurab Kumar (@progaurab).</description>
    <link>https://forem.com/progaurab</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F335187%2F8cc4eee4-47e1-4a24-a2e1-4b23a889ad1c.png</url>
      <title>Forem: Gaurab Kumar</title>
      <link>https://forem.com/progaurab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/progaurab"/>
    <language>en</language>
    <item>
      <title>How to Create Android &amp; iOS Mobile App using HTML, CSS &amp; JavaScript</title>
      <dc:creator>Gaurab Kumar</dc:creator>
      <pubDate>Tue, 18 Feb 2020 22:41:47 +0000</pubDate>
      <link>https://forem.com/progaurab/how-to-create-android-ios-mobile-app-using-html-css-javascript-6il</link>
      <guid>https://forem.com/progaurab/how-to-create-android-ios-mobile-app-using-html-css-javascript-6il</guid>
      <description>&lt;p&gt;&lt;strong&gt;Apache Cordova&lt;/strong&gt; is an open-source mobile development framework. It allows you to use standard web technologies such as HTML5, CSS3, and JavaScript for cross-platform development, avoiding each mobile platform native development language. Applications execute within wrappers targeted to each platform, and rely on standards-compliant API bindings to access each device’s sensors, data, and network status.”&lt;/p&gt;

&lt;p&gt;If you want to learn how to &lt;a href="https://www.udemy.com/course/cordova-hybrid-app-development-for-android-and-ios/?referralCode=E65798C059452FD4377E"&gt;develop Android &amp;amp; iOS Mobile apps using HTML, CSS, JS &amp;amp; Apache Cordova&lt;/a&gt; then enroll in my course here with 90% discount.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.udemy.com/course/cordova-hybrid-app-development-for-android-and-ios/?referralCode=E65798C059452FD4377E"&gt;Apache Cordova - Build Hybrid Mobile Apps with HTML CSS &amp;amp; JS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this blog post, I’ll show you how to Create your first Cordova Project for Android, iOS, Browser, and Desktop using HTML, CSS, and JavaScript.&lt;/p&gt;

&lt;p&gt;By Cross-Platform, we mean that the application codebase can be written once using HTML5, CSS3 &amp;amp; JavaScript and it can be run across multiple target mobile platforms such as Android, iOS, Windows, Firefox, Ubuntu mobile.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Apache Cordova can be extended with native plug-ins, allowing developers to add more functionalities that can be called from JavaScript, making it communicate directly between the native layer and the HTML5 page. These plugins allow access to the device’s accelerometer, camera, compass, file system, microphone, and more.&lt;/p&gt;

&lt;p&gt;However, the use of Web-based technologies leads some Apache Cordova applications to run slower than native applications with similar functionality.&lt;/p&gt;

&lt;p&gt;And the most important thing is: Cordova is free and open source. Here’s how to get started with Apache Cordova.&lt;/p&gt;

&lt;h1&gt;
  
  
  Use &lt;a href="https://androidabcd.info/how-to-create-apache-cordova-app-using-cordova-cli/"&gt;Apache Cordova&lt;/a&gt; if you are:
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;a web developer and want to deploy a web app that’s packaged for distribution in various app store portals.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/IwOXZpjBCSU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Prerequisite
&lt;/h1&gt;

&lt;p&gt;Before creating a new Cordova App, there are few prerequisites and you have to install this software:&lt;/p&gt;

&lt;p&gt;*Node.js (npm comes with Node.js) [ &lt;a href="https://nodejs.org/en/"&gt;https://nodejs.org/en/&lt;/a&gt; ]&lt;br&gt;
*Cordova [after installing node.js, you can install cordova through command line or terminal by using following command “npm install -g cordova“] [ &lt;a href="https://cordova.apache.org/#getstarted"&gt;https://cordova.apache.org/#getstarted&lt;/a&gt; ]&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Create a new Cordova App
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;cordova create DeviceInfo info.androidabcd.deviceinfo DeviceInfoSample&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After creating the new app, move to Cordova project folder&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;cd DeviceInfo&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2: Add the Android platform
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;cordova platform add android@latest&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 3: Add plugin to get device information
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;cordova plugin add cordova-plugin-device&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;By using this plugin you get the following device information:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;device.cordova&lt;/li&gt;
&lt;li&gt;device.model&lt;/li&gt;
&lt;li&gt;device.platform&lt;/li&gt;
&lt;li&gt;device.uuid&lt;/li&gt;
&lt;li&gt;device.version&lt;/li&gt;
&lt;li&gt;device.manufacturer&lt;/li&gt;
&lt;li&gt;device.isVirtual&lt;/li&gt;
&lt;li&gt;device.serial&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Step 4: Open code in Visual Studio Code Editor
&lt;/h2&gt;

&lt;p&gt;If you haven’t install visual studio code then download and install from here: &lt;a href="https://code.visualstudio.com/"&gt;https://code.visualstudio.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can open the Cordova project from the command line or terminal by typing ” code . ” [code space dot], or you can directly drag &amp;amp; drop the project into visual studio code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6khSZoYe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/androidabcd.info/wp-content/uploads/2020/01/Screenshot-2020-01-26-at-3.55.08-PM.png%3Fresize%3D1536%252C963%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6khSZoYe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/androidabcd.info/wp-content/uploads/2020/01/Screenshot-2020-01-26-at-3.55.08-PM.png%3Fresize%3D1536%252C963%26ssl%3D1" alt="Open code in visual studio code"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 5: Edit index.html in www folder
&lt;/h2&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/instilllearning/7y08c4ed//embedded/html//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Edit index.js in www folder
&lt;/h2&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/instilllearning/7y08c4ed//embedded/js//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Edit index.css in www folder
&lt;/h2&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/instilllearning/7y08c4ed//embedded/css//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 8: Prepare the Cordova project
&lt;/h2&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;cordova prepare&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 9: Build Cordova Project
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;cordova build android&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 10: Run Cordova App in Android Emulator
&lt;/h2&gt;

&lt;p&gt;You have to run Android Emulator before running this command.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;cordova run android&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;How to run an Emulator&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 11: Up and Running Cordova App in Emulator
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fbivIcia--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/androidabcd.info/wp-content/uploads/2020/01/Screenshot-2020-01-26-at-4.06.34-PM.png%3Fresize%3D1536%252C1108%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fbivIcia--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/androidabcd.info/wp-content/uploads/2020/01/Screenshot-2020-01-26-at-4.06.34-PM.png%3Fresize%3D1536%252C1108%26ssl%3D1" alt="Device Info"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>ios</category>
      <category>cordova</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
