Introduction

Cloud computing (Cloud computing) has several advantages including using it for setting up databases in the cloud to offer Database-as-a-Service (DBaaS) and has several advantages over normal databases that we use in our applications. The databases that come with the application will have smaller boundaries since they are application-specific and cannot be changed centrally to reflect the changes in all apps that consume these databases. Client apps require internet to access the cloud database.

The mobile app platform named Parse (https://parse.com/) provides all facilities required for your mobile apps including analytics, DBaaS (Database), push notification and so on.

cloud computing

Figure 1:
The devices/machines running various operating systems connecting to the Parse Cloud and requesting data from the database setup on the Parse Cloud.

SDK

Figure 2: Indicates important facilities that come under Parse.

parse image

Figure 3: Available SDKs to work with Parse.

To access features provided by Parse in iOS, Parse provides iOS APIs using iOS SDK. OS X programmers can use OS X SDK to access features of Parse using OS X APIs. Similarly the Android SDK is available to provide Android APIs to Android developers, .NET SDK for .NET developers and JavaScript/PHP SDKs for Web developers to utilize them in their JavaScript/PHP based web applications. The .NET SDK supports Windows Phone 8 apps, Windows apps, Unity and Xamarin based applications.

Setting up Parse database

This section covers setting up a Parse Database and setting up your Windows 8 Apps/Metro Style Apps that makes use of this database.

The following is the procedure to work with Parse.

Step 1: Logon to www.parse.com.

parse

Step 2: Sign up to use Parse.

Sign Up

Click on the Sign Up option to proceed to the sign up page. The preceding screen shows the home page of Parse.

Sign Up to use Parse

The preceding screen is the place to sign up that is a necessary task before you start using Parse. Once you click on the sign up button, you will proceed to the Get Started screen where you need to fill in your application name and company details.

Get Started

I am currently considering the option to create an “Appointments” application. So, I will keep the app name as “Appointments” and I will select Individual Developer from the second drop down menu.

Appointments

The preceding screen shows the filled-in form from my side and you can try clicking on the “Start using Parse” button present there. When you sign up, you will receive a “Welcome to Parse” e-mail right into your mail box. Open it and see once!

Step 3: Directing to Parse's main product dashboard.

main product dashboard

The preceding screen shows the Parse's main feature page. It provides options that represent each of the features provided by Parse for app developers.

Step 4: Select an appropriate product.

appropriate product

Click on the “Data” option to proceed to the next screen.

Step 5: Select an appropriate environment of the target.

appropriate environment

As you see in the preceding screen, there are multiple selection options that include Mobile, Desktop, Web, Unity and PHP. You can choose the one that suits your requirements. Selecting the “Desktop” option will redirect you to a page consisting of the desktop based operating systems supported by Parse. Once you select the platform that you are targeting, all platforms under that specific environment will be displayed.

Step 6: Select a platform of your choice.

platform of your choice

Select the “Windows 8” option to proceed to the next screen. Here, you select the required SDK that you would like to work with. Once you select the platform, the appropriate SDKs linked to the programming languages will be enlisted. I have selected the Windows 8 platform since I will show the integration of Parse database into a Windows Store App.

Step 7: Select the appropriate programming language of your choice.

programming language

We know that Windows 8 (Windows Store) apps can be created using C# and can also be developed using JavaScript (Create your first Windows Runtime app using JavaScript). I am choosing the C# option since I am using C# to develop a sample Windows Store App.

Step 8: Select the type of project.

Select the type of project

I have selected the New Project option; you can select the Existing Project as well.

Step 9: Install the SDK to continue using Parse.

Install the SDK

Step 10: Download the Visual Studio solution to start building your application.

start building

As shown in the preceding screen, select the Download the Blank C# Visual Studio project option. This results in a download of the requested solution. Remember that the solution remains prepared for download and is prepared depending on the compatibility of the selection of your environment, target platform and coding language of your choice. Also remember that these were given as input in your previous steps. This solution is prepared by Parse automatically based on your previous selections.

Step 11: Open the solution to setup the environment required to facilitate building up of the app.

After downloading the solution, unzip it and open the solution file in either Visual Studio 2012 or in the preceding version. When opening the solution, you need to accept the license agreement. Then, the “Developer License” window will pop up post that you are requested to enter your Microsoft Account credentials for sign-in purpose. After logging in, you can get the developer license required to work further as illustrated below:

sign in

solution from Parse

The preceding screen shows the Solution Explorer of the download solution from Parse.

Step 12: See the references present in the solution.

references present

As shown in the preceding screen shot, “Parse” and “Parse.WinRT” references are already added to the solution provided to us by Parse. It indicates that Parse adds all references required by the project while you select the necessary platform of the target and the language of coding. So, our task of manually installing the Parse package using the NuGet Package Installer and adding the reference will be skipped at this point of time.

Step 13: Note down the Client ID and .NET key that appeared in Step 10's screen.

Client ID

In the preceding screen shot that is a part of the screen taken from Step 10, the two strings that are passed to the ParseClient.Initialize( ) function are your Application ID and the .NET Key respectively.

ParseClient.Initialize("O7XoERMnwIopZtqESg9gezP5Uzay9qtVEhtK078k", "JPdBFq383xdHpikd5JNufDmPxUWg69IJIQAEzHMZ");

Step 14: With respect to our application “Appointments”, O7XoERMnwIopZtqESg9gezP5Uzay9qtVEhtK078k is the Application ID and JPdBFq383xdHpikd5JNufDmPxUWg69IJIQAEzHMZ is the .NET Key. Both of these are passed as parameters to the ParseClient.Initialize( ) function since this function helps in initializing the client application.

The unique Application ID indicates the specific application that is set up on Parse so as to be helpful in dealing with a specific application in the client code for probable futuristic purposes. Place the Application ID and .NET Key into the code.

Key into the code

The preceding screen shows the code inside the App.xaml.cs. In the code above, you can see the function marked with Red rectangle. It is a function that takes two string arguments, namely the Application ID and the .NET Key parsed as strings.

parsed as strings

The code above shows a method to specify the Application ID and the .NET Key in the App.xaml.cs file by passing them as two string arguments to the ParseClient.Initialize(string, string) function. The Application ID and .NET Key specified above are specific to my application, in other words “Appointments”. So, it is obvious that the value of the Application ID changes from application to application.

Step 15: Getting all the application specific keys.

Application ID, Client Key, JavaScript Key, .NET Key, REST API Key and Master Key are some of the Application Keys available. We can reach a place in the parse.com where we can get all these keys together. The procedure involved in getting these keys are specified below.

Step 16: Creating the database on Parse.

Let's take the database table data used in my previous article Working With SQLite in Windows Store Apps to create a new table. Consider that our Windows Store App Appointments requires a table named “Appointments”. The appointments table is as given below:

appointments table

The preceding table represents an “Appointments” table that contains 4 columns, each of which could become properties of the class “Appointments”. appointmentId, appointmentDescription, appointmentPersonName and appointmentPlace are the four columns of the table.

Retrieving data from Parse DB

This section covers pulling or retrieving data from a Parse DB to use it and display it in Windows Store App controls. Here, for displaying the data, I have used ListView UI components. You can make use of FlipView as well.

Step 17: Pulling data from Parse and display it within the UI.

Here, let me show the pulling up of data from the cloud-based Parse DB and storing it in a local list that facilitates binding of this list to a UI component such as a ListView. Storing data to Parse DB

This section covers processes that involve taking necessary data using user input and saving it to the Parse DB table. Inputs are taken using UI controls (Textboxes). Therefore, this section also covers creating a new form that takes user inputs present within Windows Store Apps. Conclusion

In a similar way, I have demonstrated usage of Parse in Windows Store Apps. You can also make use of it in your Android, iOS and Windows Phone apps. The UI and coding syntaxes may differ from platform to platform but the procedure to use Parse will remain the same.