Dilemma in choosing technology to create App for Windows Store?

 

image

 

When one start creating Applications for Windows Store, the first question come to mind is what technology should be used to create applications. In this post, I am trying to ease that decision to some extent. If you creating application form scratch then as of me you should rely on your existing skills. However for migrating application, you may want to take decision on basis of type of application need to be migrated. Below is the flowchart I would follow while taking decision for technology path

 

image

 

Some of the points you need to keep in mind while deciding are as follows

  • Know your existing skills and decide on that. If you are good at JavaScript and have worked with patterns then you may find WinJS very similar. Whereas if you have created Windows Phone App or WPF applications before then combination of C Sharp and XAML will make more sense to you .

 

  • You need to be more cognizant when deciding for the migration of application. In this scenario rather than relying on your existing skills, you should decide on the factor of what type of application you are going to migrate. For example if you are migrating Windows Phone application then you must choose combination of C Sharp and XAML such that you may reuse codes and functionalities. Imagine if your Windows Phone application is created using patterns like MVVM then you may able to use View and Model View.

 

  • So far what I have experienced that majority of the WinJS controls are created as Metro Controls. So you do not need to write any extra code to make WinJS controls as metro a control. So it may be wise to use HTML and WinJS combination if you skill set contains both web and CSharp XAML.

 

  • If you are creating high end Gaming applications then you may want to consider combination of C++ and XAML

 

  • >If you are a .NET developer and your skill set contains HTML and JavaScript as well. In that case I would recommend C Sharp and XAML. You will find development process very familiar as of .NET development. For example you may create application adhering same patterns like MVVM etc.

 

In this way you can decide on the combinations of technology for the development of applications for Windows Store.

<I hope you find these quick points useful. Thanks for reading.

 

Working with github on Windows

In this post we will see step by step to configure github for windows and the way to sync the project from windows to github repository. To start with very first you need to create a repository on github. To create repository login to github and click on New repository option

image

Once you click on New repository button you will get prompted to fill many information’s like repository name, description etc. You can make repository public or private by selecting respective radio button. If you are starting new then it is always good to initialize the repository with a README. It allows git to clone the repository immediately. Please refer below image for more on creating new repository

image

Once repository is created you will be navigated to repository page and can find all the information about repository as following image

image

At this point you have created repository in github and now you need to download and configure Windows Client of github on your machine. On the github page in the bottom you will find link to download windows client for github

 

image

After downloading and installing github windows client you will find icon on your desktop. Click that icon. Github windows client will be launched. In the left side you see local and github account. When you click on github account you will find all the repositories from the github.

 

image

To start working with github repositories, first you need to clone that. You will get clone button next to repository.

image

After successful cloning you will find button changed as shown in following image.

 

image

Double click on the repository to open it. After opening the repository you can notice in top a tool menu. From there you got option

  • Open in explorer
  • Open a shell here
  • View on github

image

To work with project select open in explorer. It will open the repository in windows explorer. Now suppose you have a visual studio solution you want to push on github, you need to follow below steps

Open VS project in window explorer and copy the solution.

image

You need to copy all files from VS solution open in windows explorer to github repository open in windows explorer.

image

After copying files to github repository open in windows explorer go to github for windows client and click on the refresh button

image

After refreshing double click on testproject repository. You may notice that a blue array next to repository name saying this repository has been modified. Click on the blue arrow or double click on the repository to navigate to detail repository page. On this screen you will find

  • Details of files to be committed
  • Option to commit the changes with comment

image

After providing comment you need to click on the commit button to commit the changes locally. After committing you will get message that one change committed locally though it is not synced.

image

To sync changes with github you need to click on sync button in top. If there is any locally committed change available then you will find sync button in blue else it would be in gray color. Once you click on sync button changes will get committed to github

image

You can verify sync in two ways. Either navigate to github and you will find all changes with comment there.

image

The other way is that you will see on github windows client in sync displayed.

image

The approach should be to put working files in local repository or cloned repository such that whenever you do any changes github for windows will detect that and you can locally commit and eventually sync with the github. In this way you can work with github and windows. I hope you find it useful. Thanks for reading.

 

Build your application using PhoneGap:Build

In this walkthrough I will show you the way to build your application in PhoneGap build. Very first create your application using any of the technology choices like jQuery mobile or KendoUI Mobile. PhoneGap allows you to create hybrid application.

Navigate to Phonegap Build and register yourself by clicking on the Register button

image

You can either login using Adobe account or Github account.

image

I am login using Github. You will be prompted to authorize the Application. Click on the Allow button to authorize the application

image

Check both the check box and click on Complete My Registration.

image

After completing registeration you need to upload the application to complie. There are three option you can submit your application

  1. Create new Repisotry in GIT for your application
  2. Pull application from GIT. In this case you are already having your application in GIT repository.
  3. Uplaod the application as zip file

image

I am pulling application from GIT repository here. After that you need to click on the Create button to create the build for the application. On next screen you can see that build for the entire platform is available for download.

image

Point worth saying here is that for build for ios you need to register your application and need a signing key for the same. In this way you can build your application for different platform. I hope you find this post useful. Thanks for reading

 

Share Text in between Windows 8 Metro Application using Share Contract

Two Metro applications can shared the content between them using Share Charm. Content can be as simple as text or may be image or a file. In content sharing, the application that shares content is called as Source Application and the application that receives content is called as Target Application. Source Application and Target Application need to declare the type of content; they are intent to share in a Declaration.

Declaration can be configured in the package.appmanifest file. Click on package.appmanifest file and then select Declaration tab. From the Available Declarations drop down select Share target and check SupportedAnyFile Type in Supported File Types. See the image below.

image

Source Application

After configuring the declaration we need to write the code to share relevant text. Let us put a button and click event of that button we will share the text.

image

In code behind attach click event to button and call bellow function

image

Function to share text is as following. User can share the text from the Share Charm. Note that in the code below, we have explicitly displayed the Share charm by calling function showShareUI.


function ShowandShareContract() {

Windows.ApplicationModel.DataTransfer.DataTransferManager.showShareUI();
 var dataTransferManager = Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView();
 dataTransferManager.addEventListener("datarequested", function (e) {
 var request = e.request;
 request.data.properties.title = "Debugmode";
 request.data.properties.description = "Debugmode Share App";
 request.data.setText("Hello from DebugMode App");
 });
 }

The actual data sharing happens in the datarequested event handler. We are sharing the text “Hello from DebugMode App “

Target Application

Now let us create an application, which can consume the shared text. An application can be launched in multiple ways; we need to first check whether the application was launched as Share Target or not before accepting any data.

image

We also need to check whether shared operation is containing text or not. That can be check as following

image

Below is the code required to read the text shared and display in an output div.

 if (args.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.shareTarget) {

 var shareOperation = args.detail.shareOperation;
 if (shareOperation.data.contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.text)) {
 var SharedText = " Title : " + shareOperation.data.properties.title;
 SharedText = SharedText + " Description : " + shareOperation.data.properties.description;
 document.getElementById("outputDiv").innerText = SharedText;

 }

}

In this way text can be shared between source application and target application using shared contracts. When you run the source application, you will get a ShareContent button. On clicking of the button Share Charm will get displayed. You will get list of all applications can act as Target Application. For example Mail application can also act as Target Application.

image

Let us choose target application we created. Click on ShareContreactTarget application. You can see two applications can run side by side and text from source application is displayed in output div of target application.

image

In this way we can share Text between two metro applications. I hope you find this post useful. Thanks for reading.

AdventureWorks database for SQL Azure

 

In this post we will walkthrough step by step to create AdventureWorks database for SQL Azure. We will use AdventureWorks database for SQL Azure from codeplex. To create follow the step as below,

Step 1

Go to http://msftdbprodsamples.codeplex.com/

Step 2

Download SQL Azure OLTP from the codeplex site

image

Step 3

After downloading unzip the file in a folder. After unzipping file open command prompt and change directory to unzipped folder. I have unzipped the file in folder names SQLAzurePortal.

image

Step 4

Cross check that your machine IP address is in range of the firewall rules.

image

Step 5

Run the command as following

image

In case you wonder what is yours SQL Azure Server name, you can check that as following. Log in to SQL Azure portal and right panel you can get information about username and server name

image

Your command should be as following

image

After successful installation with data in SQL Azure, you should get following successful message.

image

Now to verify that whether AdventureWorks database got installed successfully, open SQL Azure portal and in database you should able to see that database has been listed there

image

In this way you have successfully installed AdventureWorks database on SQL Azure. I hope this post was useful. Thanks for reading