{"componentChunkName":"component---src-templates-tag-js","path":"/tags/mobile/","result":{"data":{"site":{"siteMetadata":{"title":"LoginRadius Blog"}},"allMarkdownRemark":{"totalCount":1,"edges":[{"node":{"fields":{"slug":"/engineering/getting-started-phonegap/"},"html":"<p>PhoneGap now also known as Apache Cordova, is a powerful tool for mobile development which allows you to develop in HTML/JS markup and quickly generate out various mobile compatible apps. This prevents your developers from having to learn and understand multiple platform specific languages and instead use the PhoneGap framework which is based in HTML to create the app and then generate it into any one of the following platforms:</p>\n<ol>\n<li>iOS</li>\n<li>Android</li>\n<li>Windows Phone</li>\n<li>Windows</li>\n<li>Firefox OS</li>\n<li>Amazon Fire OS</li>\n<li>Blackberry</li>\n</ol>\n<p>With time saved on learning development languages for the above platforms your team can focus on the features of your app.</p>\n<h2 id=\"setting-up-your-environment\" style=\"position:relative;\"><a href=\"#setting-up-your-environment\" aria-label=\"setting up your environment permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Setting up your Environment</strong></h2>\n<ol>\n<li>Download and install <a href=\"http://nodejs.org/download/\">node.js</a>, This will be used to install the Cordova/PhoneGap framework.</li>\n<li>Download and install a <a href=\"http://git-scm.com/downloads\">Git Client</a>, This is used by the Cordova/PhoneGap framework when creating projects.</li>\n<li>Open command prompt and verify that both of the above systems have been installed by running <em>npm</em> and <em>git.</em></li>\n<li>Install the Cordova/PhoneGap system by running the following command in your command prompt (Note: this may take a few minutes)</li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;npm install -g cordova</span></code></pre>\n<p>Verify your installation of Cordova/PhoneGap by running <em>cordova</em> in command prompt. This should display a list of the available Cordova commands.</p>\n<h2 id=\"setting-up-your-project\" style=\"position:relative;\"><a href=\"#setting-up-your-project\" aria-label=\"setting up your project permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Setting up your Project</strong></h2>\n<ol>\n<li>Create a directory which will contain your PhoneGap/Cordova project code.</li>\n<li>Open the created directory in command line and create a project with the command <strong>cordova create &#x3C; sitename ></strong></li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;rootdir\\cordova create FirstSite</span></code></pre>\n<ol start=\"3\">\n<li>\n<p>This will create a project in the root folder with the specified site-name. This project will contain:</p>\n<ol>\n<li>\"hooks\" directory- Contains special scripts that can be used to customize Cordova commands.</li>\n<li>\"platforms\" directory- This contains the app specific projects that you will include below.</li>\n<li>\"plugins\" directory- Contains add-on code for interfacing with native features. You can create your own custom interface or use one of pre-compiled plugins.</li>\n<li>\"www\" directory- Contains the PhoneGap/Cordova structure and some standard js and css files.</li>\n<li>config.xml file- This file contains meta data for controlling common features of your apps like the app title, description and author.</li>\n</ol>\n</li>\n<li>\n<p>Add platforms to the project with the <em>cordova platform add <platform></em> command. <strong>Note:</strong> adding platforms requires that the relevant dependencies are installed in your system for example adding android requires that you have installed the Android SDK. Available platforms for a windows environment are:</p>\n<ul>\n<li>wp7</li>\n<li>wp8</li>\n<li>windows8</li>\n<li>amazon-fireos</li>\n<li>android</li>\n<li>blackberry10</li>\n<li>firefoxos</li>\n</ul>\n<p>And for Mac:</p>\n<ul>\n<li>ios</li>\n<li>amazon-fireos</li>\n<li>android</li>\n<li>blacberry10</li>\n<li>firefoxos</li>\n</ul>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;rootdir\\cordova platform add android</span></code></pre>\n</li>\n<li>\n<p> You can now get a list of the added platforms by running the following command:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;rootdir\\cordova platform ls</span></code></pre>\n</li>\n<li>\n<p>You can remove a specific platform from the list with the following command:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;rootdir\\cordova platform remove android</span></code></pre>\n</li>\n<li>Once you have added in the desired platforms build the platform specific apps by running the following command: </li>\n</ol>\n<p><strong>Note:</strong> Building platforms requires that the relevant dependencies are installed in your system for example building android requires that you have installed the Android SDK</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;rootdir\\cordova build</span></code></pre>\n<ol start=\"8\">\n<li>You can use these built projects found in the \"platforms\" directory in platform specific IDEs or emulate the projects directly with the following command:</li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">C:\\&gt;rootdir\\cordova emulate android</span></code></pre>\n<p>At this point you have a basic PhoneGap project configured and your desired platforms added and you can get started with adding or building out additional features and content in the \"www\" directory and run the command in step 7 above to create the platform specific projects. You can find detailed instructions on setting up additional features and implementing PhoneGap on the PhoneGap site.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"March 31, 2015","updated_date":null,"title":"Getting Started with Phonegap","tags":["Engineering","PhoneGap","Mobile"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1,"src":"/static/d8c820456aa3a57aa0a36aab4d27f8fc/40725/dev-sprites2.png","srcSet":"/static/d8c820456aa3a57aa0a36aab4d27f8fc/69585/dev-sprites2.png 200w,\n/static/d8c820456aa3a57aa0a36aab4d27f8fc/497c6/dev-sprites2.png 400w,\n/static/d8c820456aa3a57aa0a36aab4d27f8fc/40725/dev-sprites2.png 580w","sizes":"(max-width: 580px) 100vw, 580px"}}},"author":{"id":"Team LoginRadius","github":"LoginRadius","avatar":null}}}}]}},"pageContext":{"tag":"Mobile"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}