F5 Debug…

Building & Debugging the Technology!!!

Archive for February 7th, 2012

Microsoft Beta Release on Amazon Web Services(AWS) SDK for Windows Phone 7

Posted by Karthikeyan Anbarasan on February 7, 2012

Microsoft has recently announced the BETA release of Amazon Web Service (AWS) SDK for Windows Phone 7 Development. Microsoft has provided this SDK as an open source, which provides developers to quick integrate the Microsoft Windows Phone 7 Application development with the Amazon Web Service. This SDK provides support with the 3 main component of the AWS (Simple DB, S3 and SQS Service) at present which will get enhanced in the future releases as well.

Terry Wise, Director of Business Development for Amazon Web Services says about the Microsoft Release on AWS SDK for Windows Phone 7

“Our approach with AWS is to provide developers with choice and flexibility to build applications the way they want and give them unlimited storage, bandwidth and computing resources, while paying only for what they use. We welcome Windows Phone developers to the AWS community and look forward to providing customers with new ways to build and deploy Windows Phone applications”.

Jean Paoli, General Manager of Interoperability Strategy at Microsoft says about the Microsoft Release on AWS SDK for Windows Phone 7

“The release of the Windows Phone Toolkit for AWS Beta proves that Microsoft’s goal of building a Cloud-friendly phone is true across vendor boundaries. It literally takes minutes to create a Cloud-ready application in C# with this toolkit. We look forward to this toolkit eventually resulting in many more great apps in the rapidly growing Windows Phone marketplace.”

Make use of the below links to download the SDK and get the high level tutorial on how to use the SDK to get the best out. Some of the requirements to be considered for using this SDK are

 

Downloads:

Amazon Web Service (AWS) SDK for Windows Phone 7 Download

Tutorials:

Article on Getting Started with Installing and developing AWS SDK for Windows Phone 7

Getting Started with the AWS SDK for Windows Phone

AWS SDK for Windows Phone – S3 sample walkthrough

AWS SDK for Windows Phone – SQS sample walkthrough

AWS SDK for Windows Phone – SimpleDB sample walkthrough

Leveraging your iPhone development expertise to build Windows Phone 7 applications

Leveraging your Android development expertise to build Windows Phone applications

 

Happy Programming!!!

Posted in Amazon WebService, Windows Azure, Windows Phone 7 | Tagged: , , , , , , , , , , | 2 Comments »

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

Posted by Karthikeyan Anbarasan on February 7, 2012

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

Introduction:

In this article we are going to see how to use the Calendar application  to access the calendar data and use it across the development as and when needed. In our earlier article we have seen how to use the contacts and access the contact data, we are going to use the same process of accessing the calendar objects.

In order to use the calendar object we are going to use the reference of the Appointments object and do an Async search to get the results and show it on to a collection of Appointment objects. The end result in the appointments object can be used in different ways as per the requirement by binding to different controls and to do some schedule. Appointment class is to interact with user appointment data and is inherited from the Microsoft.Phone.UserData namespace. Let us see the step by step process on how to use the calendar objects and list the appointments.

Steps:

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

2012-01-17 22h26_05

Now in order to fetch the details of the calendar appointments and show it to the end users, we will add controls from the tools as shown in the screen below. We can just drag and drop the controls from the tool box or write the XAML code as shown in the screen below or copy paste the XAML code.


XAML Code:


<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock x:Name="ApplicationTitle" Text="F5DEBUG WP7 TUTORIALS" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock x:Name="PageTitle" Text="calendar" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>

<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Button Content="Get Appointment" Height="83" HorizontalAlignment="Left" Margin="30,16,0,0" Name="btnAppointment" VerticalAlignment="Top" Width="402" Click="btnAppointment_Click" />
<ListBox Name="lstAppointment" 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="txtAppointments" Text="List of Appointments" VerticalAlignment="Top" Width="373" />
</Grid>
</Grid>

2012-01-17 22h35_08

Now we need to add code to do listing of the calendar appointments to the list view. First add the namespace


using Microsoft.Phone.UserData;

Now add the button click event code, here we are going to create an object of the Appointment class and do an AsyncSearch. We need to provide the start time and end time to fetch the appointment details and also should provide the maximum count. Copy and paste the below code to the code behind for the button click event.


C# Code:


private void btnAppointment_Click(object sender, RoutedEventArgs e)
{

Appointments aAppointment = new Appointments();

aAppointment.SearchCompleted += new EventHandler<AppointmentsSearchEventArgs>(GetAppointments);

DateTime starttime = DateTime.Now;
DateTime endtime = starttime.AddDays(10);
int maxAppointment = 20;

aAppointment.SearchAsync(starttime, endtime, maxAppointment, null);
}

void GetAppointments(object sender, AppointmentsSearchEventArgs e)
{
try
{
lstAppointment.DataContext = e.Results;
}
catch (System.Exception)
{
txtAppointments.Text = "No Appointments Found!!!";
}

if (lstAppointment.Items.Any())
{
txtAppointments.Text = "Below is the List of Appointments";
}
else
{
txtAppointments.Text = "No Appointments Found!!!";
}
}

Now the above code will pull the information from the appointments object and bind it to the data context of the list box. If there is no appointments available we can see an empty result as well. To check the application just run the application by pressing F5 directly from the keyboard or by selecting build and execute solution from the tool bar and we can see the screen as shown in the screen below.

2012-01-18 08h19_34

Since we are in the emulator and we don’t have any appointments saved the list is empty. If any appointments are saved in the physical device we will get the complete list of the next 10 days to be displayed here in the list box.

Conclusion:

So in this article we have seen how to use the calendar object to fetch the appointment details and list it out. We can customize to use the appointments object to bind to different data binding options as per the requirements.

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: , , , , , , , , , , , , , , , , , | 1 Comment »