Building your first Apache Cordova App
Please follow the steps below in order to create an Apache Cordova App:
So first, go ahead and launch a visual studio.
Once visual studio is launched, it’s your start screen with lot of helpful links and news about what’s going on in the visual studio community. What we are gonna do is create a new project. So go ahead and click on the new project link from the start page.
Go to file, new and select the project link from the menu bar. Once you select new project a new project dialogue will appear.
Once you select the apache Cordova Apps category, it’s going to show you the templates that are used to build your first project. I am going to keep it simple. I am going to take a blank application template. I am going to give it a name. I am going to call this one "HelloWorld-ch9".
Once you have given your project a name, just go ahead and create it, by clicking the ok button.
Once you click ok visual studio takes some seconds to go ahead and create it.
Your start page gives you additional information on what our next steps can be. And in your Solution Explorer which gives you the tree view in the righthand side. You can overview your files and folders that make up where your projects currently are. These files and folders mimic the exact structure of the pages you would see if you build a Cordova project not using the visual studio, using the third party tools available. What we are going to do is to go ahead with this very simple Hello World app. I am gonna go ahead and open the folder index.html.
While opening the index.html file you see the primary view of the studio switched to the code editor, which in this case is colour, formatted and optimized to html content. And notice we have p tag in our html text and it says, “hello, your application is ready”. So we are gonna do is that we will modify this into “Hello World”. Check it if you spelt it correctly.
Let me go ahead and preview what are changes are. Now to preview application there is an area what we call a toolbar. In this area where you will be spending a lot of time on. But this is what controls for what platform and the target you will be building your app against. In this case, we will keep it at default, which is Android, and ripple the browser-based simulator, which quickly makes sure that my app works properly. And once I am ready I am going to hit the green button to go ahead and preview it.
So when I hit preview behind the scene, we do a lot of work to not only build the package but to also get everything ready to run your application.
So in this case, because ripples are browser based simulator you see it running in chrome and then you see the words “hello world” displayed.
So there you had a very quick overview of how to build an app using Apache Cordova in visual studio.