SharePoint 2013 App

What are SharePoint Hosted Apps ?

SharePoint Hosted Apps are those apps that contain pure client side code , in other words they donot have any C# or server side code.
They are lightweight single page applications deployed in SharePoint

Advantages
  • Made of pure html and javascript.
  • Limited access to server side components i.e code doesnt run in server
  • More Security
  • Best part of developing your code using SharePoint Hosted Apps is that you donot need to have access to Server ,also you donot need to have Visual Studio installed in same environment where we have SharePoint i.e you can work remotely from anywhere.
  • App code never runs within the SharePoint host environment.
SharePoint Hosted Apps Vs Farm Solutions


Creating your first SharePoint Hosted App

Open Visual Studio and Click on App for SharePoint


After you Click  you will see the below screen


Enter your SharePoint Site url if you are using SharePoint On Premise or login to Office 365 if you are using SharePoint Online.

Note : Remember to Select SharePoint Hosted App











In case of Office 365 enter office 365 credentials


















Visual Studio may take a few moments to create a the new project and once done expand the Pages folder in the Solution Explorer, and Double-click on the Default.aspx page to begin looking for the contents in the default project template:

Here you can see the two important files sp.js and App.js
sp.js conatins all sharepoint client side code and App.js is the place where we write our code.



App.js




Now click on deploy to deploy the app to Sharepoint , Once done you can see the App in App Library
You can debug using  browser debugger.














Comments