F5 Debug…

Building & Debugging the Technology!!!

Archive for February 6th, 2012

Brief Comparison between Windows Azure and Amazon Web Service

Posted by Karthikeyan Anbarasan on February 6, 2012

Today I was discussing about my first Windows Azure project and came to know some interesting things and some comparison between the Windows Azure and Amazon Web Services. Each has its own advantages and disadvantage, to my followers who frequently ask me about what Azure is and when to use the Azure cloud this comparison chart will give some insight on the things to consider. Below Comparison chart will provide with easy comparison between the Windows Azure and Amazon EC2 Web Services cloud terminologies.

Microsoft Windows Azure
windows-azure-logo
Amazon Web Services
aws
Free Trial https://www.windowsazure.com/en-us/pricing/free-trial/ http://aws.amazon.com/free/
Compute Instance ExtraSmall, Small, Medium, Large, Extra Large Micro, Small, Large, Extra Large
Compute VM VM Role Instance EC2 (Elastic Compute Cloud) Instance
Scaling Auto Scaling Blocks Auto Scaling
Identity Management AppFabric ACS (Access Control System) IAM
Messaging Service Bus SNS (Simple Notification Services)
Caching AppFabric Cache Elastic Cache
CND Azure CDN Cloud Front
Storage Blob Azure Blob S3
Storage Tables Azure Tables Simple DB
Storage Drive Azure Drives EBS (Elastic Block Storage)
Database SQL Azure MySQL, Oracle
Queues Azure Queues SQS (Simple Queue Services)
Connect Azure Connect VPC (Virtual Private Cloud)
Load Balancing Azure Load Balance Elastic Load Balance
Traffic Manager Azure Traffic Manager NA
Monitoring Tools AzureWatch(3rd Party) CloudWatch

This article is just a start on the comparison, we will see in depth on each of the topics on the go to get complete idea to proceed with the best options before start designing the cloud.

Hope this article will be useful, If you like my blog and if you are interested in getting the latest updates on new articles, kindly follow me through one of these options.

F5Debug FacebookF5debug LinkedInF5debug TwitterF5debug GooglePlusF5debug RSSFeed

Posted in Amazon WebService, Windows Azure | Tagged: , , , , , , , , , , , , | 5 Comments »

Learn Windows Phone 7 Development in 31 Days – Day 6 – Working with Contacts in WP7

Posted by Karthikeyan Anbarasan on February 6, 2012

01 Download ToolsDownload Source CodeDownload as PDF FileSubscribe to F5debugComplete Article Listing

Introduction:

In this article we are going to see how to work with inbuilt contacts data and use it across our requirement to manipulate the data. Windows Phone 7.1 provides a read only access to the data available locally across the device. We can query the data and select the users based on the search filters and also we can do multiple manipulations in order to perform some operation with the user contact information’s.

Let us see the step by step process on how to use the contacts for querying the data. To launch the contacts we need to use the AddressChooserTask which is used to select the contacts. The queried result can be collected in the AddressResult object and can be used to list it as per the requirement. Let us start with creating a new application and start using the AddressChooserTask.

Steps:

Open Visual Studio 2010 and create a new Silverlight for Windows Phone 7 project and provide a valid project name as shown in the screen below.

2012-01-17 21h06_35

Now we will add a button which triggers an event to query the data and get the contacts in a list. Add the below XAML code, or we can directly drag and drop the controls as shown in the screen below.


XAML Code:


<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Button Content="Get Contacts" Height="83" HorizontalAlignment="Left" Margin="30,16,0,0" Name="btnContacts" VerticalAlignment="Top" Width="402" Click="btnContacts_Click" />
<ListBox Name="lstcontacts" ItemsSource="{Binding}" Margin="47,188,36,52" >
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Name="txtResults" Text="{Binding Path=DisplayName, Mode=OneWay}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Height="41" HorizontalAlignment="Left" Margin="47,118,0,0" Name="txtResults" Text="List of Contacts" VerticalAlignment="Top" Width="373" />
</Grid>

2012-01-17 21h27_04

Now we will add some code to the code behind page for querying the data from the contacts database. To do that go to the button click event and write the code below. Basically the Windows Phone 7 Emulator has some default contacts which can be tested by pulling to the list in this article. We need to add the namespace in order to access the data.


using Microsoft.Phone.UserData;

Now in the button click event add the below code. From the code we can see the Contact class been used to query the details. Here we will be using the SearchAsyc method to do the search with the object and provide the result set to the list as shown in the code below.

C# Code:


private void btnContacts_Click(object sender, RoutedEventArgs e)
{
Contacts cContacts = new Contacts();
cContacts.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(ContactsSearch);
cContacts.SearchAsync(String.Empty, FilterKind.DisplayName, null);
}
void ContactsSearch(object sender, ContactsSearchEventArgs e)
{
try
{
lstcontacts.DataContext = e.Results;
}
catch (System.Exception)
{
txtResults.Text = "No Results Available";
}

if (lstcontacts.Items.Any())
{
txtResults.Text = "Below is the List of Contacts";
}
else
{
txtResults.Text = "No Results Available";
}
}

In the above code if we see we are querying the contacts class object and bind it to the list box using the data context and do some small user information with the message. In the SearchAsync method we provide different filters that can be used to access the data. Below is the list of filters that can be provided based on the requirement.

  • Search All Contacts – SearchAsync(String.Empty, FilterKind.None, null)
  • Get Pinned Contacts – SearchAsync(String.Empty, FilterKind.PinnedToStart, null)
  • Search by Display Name – SearchAsync(“Karthik”, FilterKind.DisplayName, null)
  • Search by Email ID – SearchAsync(“Karthik@f5debug.net”, FilterKind.EmailAddress, null)
  • Search by Phone No – SearchAsync(“123-456-7890″, FilterKind.PhoneNumber, null)

Now we are done with the application just to build and execute the application to check in the emulator press F5 or click on Build and execute the solution. We can see the end result by pressing the button once the application is loaded as shown in the screen below.

2012-01-17 21h36_19

The list of contacts which are shown in the above screen is the default contacts available with the Emulator for testing purposes. We can use these contacts to do the testing and add or delete it based on the requirement.

Conclusion:

So in this article we have seen how to use the contacts data search using the AddressChoosertask and list the data to the list view.

Thanks for reading my article. If you like my blog and if you are interested in getting the latest updates on new articles, kindly follow me through one of these options.

F5Debug FacebookF5debug LinkedInF5debug TwitterF5debug GooglePlusF5debug RSSFeed

Posted in Windows Phone 7 | Tagged: , , , , , , , , , , , , , , , , | 3 Comments »