Archives For windows phone

Today I was fortunate enought to speak on using Windows Azure Notification Hubs to deliver push notifications to millions of devices at the Mobile March conference in Minneapolis, MN. The purpose of this post is to provide resources to those who attended the talk or who are otherwise interested or curious about using Windows Azure Notification Hubs to deliver push notifications to iOS, Android, Windows, and Windows Phone devices. So, without further ado, here you go:

Presentation Specific Resources

Exploring Notification Hubs

Developing with Notification Hubs

Managing Notification Hubs

app-studio

Last night I was working with students at North Dakota State University to building apps for Windows Phone using AppStudio. After we built several apps I wanted to show them how they could easily download the source code for their apps and use Visual Studio to modify it. After the source code was downloaded a number of people, including myself ran into the following problem when trying to build the code in Visual Studio.

00-failed-build

In this post I’ll show you how to correct these issues so that your source code generated by AppStudio builds successfully on your machine. Big thanks to Tyler Roberg, an NDSU student, who wouldn’t go to sleep until this problem was solved!

The first thing you’ll need to do is long into AppStudio, go to your Dashboard and select the app you want to download source code for.

01-dashboard

Then click the Download Source Code link.

02-download-source

Read the guidance provided for publishing your app, then click Download.

03-download

This will download a zip file containing your source code. Before extracting the zip file, right-click on the zip file and select Properties. In the properties dialog that displays click Unblock, then click OK.

04-unblock

Extract the zip file, navigate the src folder and open the Solution file using Visual Studio.

05-solution

In Visual Studio, go to the TOOLS menu and select Options.

06-tools-options

In the Options find Package Manager and make sure the following options are checked

  • Allow NuGet to download missing packages
  • Automatically check for missing packages during build in Visual Studio

07-package-manager

Now, build the solution by either press Ctrl+Shift+B or using the BUILD menu.

08-build

Your solution should now build successfully!

09-build-output

If you’re solution does not build, try cleaning the solution by going to the BUILD and selecting Clean Solution.

clean

Once the clean is complete, build the solution again. You should be able to build without errors.

Day 1 at Build

June 26, 2013
//build/

//build/

//Update: I decided to remove my raw notes and just keep the TL;DR recap

I’m at the Microsoft //build/ conference this week and thought I’d take the time to share my daily notes with you. These notes are pretty raw, but I hope they help.

TL;DR

  • It’s all Windows, all the time
  • Improve user efficiency and productivity by new multi-monitor options for Windows Store and desktop apps
  • Bringing the power of Bing to Windows
    • Bing has been integrated into the Windows shell experience to provide a unified search across the desktop, apps, store and web
    • Bing powers the Windows Store to provide customized app recommendations, suggested search queries, and suggested search results
  • The Windows Store has been completely redesigned
    • Makes it easier for users to find the apps they want and keeps those apps up to date automatically
    • Gives developers flexibility when it comes to monetizing apps from supporting stored value and gift cards, providing support for Alipay for once of the largest markets in the world (China), and enable consumables for purchase within an app
  • Windows 8.1 has also made great improvements for the enterprise
    • Empowers the mobile professional with improvements in reliability and power efficiency, mobile broadband for anywhere connectivity, and making printing safe and secure from any device.
    • Enables great security with workplace join, web application proxy, work folders, selective wipe, and biometric integration.

Over the past several weeks I’ve been posting about how to build your first Windows Phone 8 application if you’re an Android developer. I want to wrap this series by providing some useful links:

All Posts in this Series

  1. Setting up the Development Environment
  2. Creating Your First Windows Phone Project
  3. Exploring the Windows Phone Project
  4. Running the Windows Phone Application
  5. Building a Simple User Interface
  6. Adding a Second Page

If you would prefer a pdf of all seven posts you can get it here: http://aka.ms/AndroidToWindowsPhone8

Additional Windows Phone 8 Development Resources

Over the past several weeks I’ve been working on some content I’m excited to finally share with you through a series of blog posts. This series will introduce you to Windows Phone 8 development from an Android developer’s perspective. Through the course of the series you’ll create your first app. It won’t be anything pretty, but you’ll learn the ins and outs of the development environment, how to create a simple user interface, and how to perform navigation. Along the way you’ll see some Android Hints that will help make it easier for you to transition your existing skills to the Windows Phone platform. You’ll also see some Visual Studio Tips to make you more productive in your development environment. Good luck!

In the previous lesson you created a simple UI that accepts text from a user. In this lesson you’ll create a second page in your application to display the user’s input.

Create the Second Page

Right-click the project in Solution Explorer, click Add, and click New Item.

In the Add New Item dialog, select Windows Phone under Visual C#.

Select the Windows Phone Portrait Page template, give the page a name of SecondPage.xaml, and click Add.

You should now see SecondPage.xaml in Solution Explorer.

If SecondPage.xaml is not open, double-click it.

Remove the content from the outermost <Grid> element. You should end up with something that looks like this:


<!–LayoutRoot is the root grid where all page content is placed–>


<Grid x:Name=”LayoutRoot” Background=”Transparent”>

 


</Grid>

Add a <TextBlock> element to the grid:

<Grid x:Name=”LayoutRoot” Background=”Transparent”>


<TextBlock x:Name=”messageFromUser” />


</Grid>

 

Respond to the Send Button

You now need to get the message from the first page to the second page. Start by opening up MaingPage.xaml.

To respond to the <Button> element’s Click attribute to the element

<Grid x:Name=”LayoutRoot” Background=”Transparent”>

<StackPanel x:Name=”theStackPanel”

Orientation=”Vertical”>

<TextBlock x:Name=”theLabel”

Text=”{Binding Path=LocalizedResources.MessageLabelText,

Source={StaticResource LocalizedStrings}}” />

<TextBox x:Name=”theMessage” />

<Button x:Name=”sendButton”

Content=”{Binding Path=LocalizedResources.SendButtonText,

Source={StaticResource LocalizedStrings}}”


Click=”sendButton_Click”/>

</StackPanel>

</Grid>

ANDROID HINT

The Click attribute is similar to the android:onClick attribute of the Android <Button> element.

 

Open the code-behind file for MainPage.xaml (MainPage.xaml.cs) and add the following method:

private
void sendButton_Click(object sender, RoutedEventArgs e)

{

 

}

VISUAL STUDIO TIP

You can open a code-behind file for a file you’re working with in design view by pressing F7.

 

Now you need to do three things.

  1. Get the text the user entered.
  2. Create a URI to navigate to SecondPage.xaml that includes the text entered by the user. This is done by including the text as a query string parameter.
  3. Navigate to SecondPage.xaml.

All three can be accomplished by adding the following to the sendButton_Click method:

private void sendButton_Click(object sender, RoutedEventArgs e)

{


//Get the message from the <TextBox> element


var message = this.theMessage.Text;

 


//Use a default message if none is provide


if (string.IsNullOrEmpty(message))

message = “Hello World!”;

 


//Create the uri to navigate to SecondPage.xaml, passing


//the message through in the query string


var uri = new Uri(string.Format(“/SecondPage.xaml?message={0}”, message),

UriKind.Relative);

 


//Perform the navigation


this.NavigationService.Navigate(uri);

}

 

ANDROID HINT

In Android you would create an Intent and call the startActivity method to navigate to the second page with code similar to the following:

 

public void sendButton_Click(View view) {

Intent intent = new Intent(this, SecondPageActivity.class);

startActivity(intent);

}

 

If you run your app now (F5) and press the button, you’ll notice that you go to the second page. We’ll work on displaying the message in the last part of this lesson.

Display the Message

Now that you’re able to navigate to SecondPage.xaml from MainPage.xaml you need to display the message the user entered.

Open SecondPage.xaml.cs (the code-behind file for SecondPage.xaml).

Add an override for the OnNavigatedTo method


protected
override
void OnNavigatedTo(NavigationEventArgs e)

{


base.OnNavigatedTo(e);

}

 

Finally retrieve the query string parameter from the page’s NavigationContext property and display in the <TextBlock> element with the following code:

protected override void OnNavigatedTo(NavigationEventArgs e)

{

base.OnNavigatedTo(e);

 


//Check that the query string contains the message parameter


//and display on the page if found


if (this.NavigationContext.QueryString.ContainsKey(“message”))


this.messageFromUser.Text =


this.NavigationContext.QueryString["message"];

}

Run the app (F5) to see the results!

Conclusion

Congratulations! You just build your first Windows Phone application. To learn more about building Windows Store apps, continue to follow this series. The next installment is Working with Data.

Previous Posts in this Series

  • Setting up the Development Environment
  • Creating Your First Windows Phone Project
  • Exploring the Windows Phone Project
  • Running the Windows Phone Application
  • Building a Simple User Interface

Additional Resources


 

Over the past several weeks I’ve been working on some content I’m excited to finally share with you through a series of blog posts. This series will introduce you to Windows Phone 8 development from an Android developer’s perspective. Through the course of the series you’ll create your first app. It won’t be anything pretty, but you’ll learn the ins and outs of the development environment, how to create a simple user interface, and how to perform navigation. Along the way you’ll see some Android Hints that will help make it easier for you to transition your existing skills to the Windows Phone platform. You’ll also see some Visual Studio Tips to make you more productive in your development environment. Good luck!

A Windows Phone application is simply a collection of pages. A page is the interface seen by the end user.

ANDROID HINT

A page is similar to an Activity in Android development

 

Each page is designed for the end user to interact with the application. A page is composed of layout controls and various widgets. Only one page can be seen by the end user at a time.

ANDROID HINT

Like Android there is a system level “Back” button in Windows Phone.

 

To better familiarize yourself with the user interface components of a Windows Phone application the following table maps Android widgets to their Windows Store counterparts:

Purpose

Android

Windows Store

Display Text

TextView

TextBlock

Edit Text

EditText

TextBox

Radio Button

RadioButton

RadioButton

Check Box

CheckBox

CheckBox

Submit

Button

Button

Show Progress

ProgressBar

ProgressBar

Display a List of Components

LinearLayout

StackPanel

Vertical List of Components

ListView

ListView

2-Dimensionl Grid

GridView

Grid

Display an Image

ImageView

Image

 

This is by no means an extensive list. As with many development technologies there are a number of ways to perform the same task. For example, instead of using a ListView to display a vertical list in a Windows Phone app I could simply use a StackPanel and set its orientation property accordingly.

In this lesson you’ll learn how to create a simple interface for your Windows Phone application.

Add a Text Field

For your UI you’ll want a label to tell the user what to do, a field where users can input text, and a button. You’ll start by adding the text field.

Open the MainPage.xaml file in the root directory of your project.

VISUAL STUDIO TIP

When you open a *.xaml file you’ll first see a split view. The left view contains a visual designer. This lets you build layouts using WYSIWYG tools. The right view contains the markup generated by the designer. For this lesson, you’re going to work directly with the XAML. To give yourself more screenspace you can go to a “XAML only” view using the following steps.

  1. Click the button on the toolbar between the designer and the markup view. This will move the markup view to the left and designer view to the right.
  2. Click the button on the toolbar between the two views. This will minimize the designer.

 

You’ll notice that Visual Studio adds quite a bit to the markup for a page when it is created. For simplicity we’re going to delete most of it. Delete everything within the outermost <Grid> element of the page. You should end up with something that looks like this:


<Grid x:Name=”LayoutRoot” Background=”Transparent”>

 


</Grid>

Add a <StackPanel> element to the <Grid> element:


<Grid x:Name=”LayoutRoot” Background=”Transparent”>


<StackPanel x:Name=”theStackPanel”


Orientation=”Vertical”>


</StackPanel>

</Grid>

ANDROID HINT

A StackPanel is equivalent to a LinearLayout in Android development. It allows you to lay out child elements in either a verity or horizontal orientation.

 

The x:Name attribute is similar to the android:id attribute. However, you are not required to provide a x:Name attribute for your visual elements.

 

The Orientation attribute is identical to the android:Orientation attribute of the LinearLayout in Android. The default value for the Orientation attribute is Vertical.

 

Now add a <TextBox> element inside of the <StackPanel> element you just created. Be sure to provide a x:Name attribute for it. You should end up with something like this:

<Grid x:Name=”LayoutRoot” Background=”Transparent”>

<StackPanel x:Name=”theStackPanel”

Orientation=”Vertical”>


<TextBox x:Name=”theMessage” />

</StackPanel>

<Grid>

 

Add String Resources

Next you’ll want to add a label to your page to instruct the user on what to do. You might be tempted to add a <TextBlock> element and sent its Text attribute to the text you want displayed. While this will work, it goes against best practices for localization.

Start by opening the AppResources.resx file by double clicking it in Solution Explorer.

You’ll see several resources were defined when Visual Studio create the project. To add an additional resource, simply enter it on the last line of the editor. You should end up with something like this:

Add a Label

With the Resource file in place you’re now ready to add the label to your page.

Open MainPage.xaml if not’s not already open and add a <TextBlock> element above the <TextBox> element in the <StackPanel> like this:

<Grid x:Name=”LayoutRoot” Background=”Transparent”>

<StackPanel x:Name=”theStackPanel”

Orientation=”Vertical”>


<TextBlock x:Name=”theLabel”


Text=”{Binding Path=LocalizedResources.MessageLabelText,


Source={StaticResource LocalizedStrings}}” />

<TextBox x:Name=”theMessage” />

</StackPanel>

</Grid>

The Text attribute specifies the text the element will display. You need to do two things:

  1. Specify where the string resides (Source={StaticResource LocalizedStrings}).
  2. Specify the name of the specific string you want to use (Binding Path=LocalizedResources.MessageLabelText).

Add a Button

The last thing you’ll need to do as part of this lesson is to add a <Button> element to the page so you can send the message the user enters to a second page.

Before you add the <Button> be sure to add a string resource for its Content property in the AppResources.resx file.

Now add a <Button> element under the <TextBox> element in MainPage.xaml, being sure to specify the appropriate Content attribute for localization.

<Grid x:Name=”LayoutRoot” Background=”Transparent”>

<StackPanel x:Name=”theStackPanel”

Orientation=”Vertical”>

<TextBlock x:Name=”theLabel”

Text=”{Binding Path=LocalizedResources.MessageLabelText,

Source={StaticResource LocalizedStrings}}” />

<TextBox x:Name=”theMessage” />


<Button x:Name=”sendButton”


Content=”{Binding Path=LocalizedResources.SendButtonText,


Source={StaticResource LocalizedStrings}}” />

</StackPanel>

</Grid>

Congratulations! You just created your first Windows Store UI. It might not be pretty, but it works. You can run your app now (press F5 or F6 to see the results).

Previous Posts in this Series

  • Setting up the Development Environment
  • Creating Your First Windows Phone Project
  • Exploring the Windows Phone Project
  • Running the Windows Phone Application

Additional Resources

Over the past several weeks I’ve been working on some content I’m excited to finally share with you through a series of blog posts. This series will introduce you to Windows Phone 8 development from an Android developer’s perspective. Through the course of the series you’ll create your first app. It won’t be anything pretty, but you’ll learn the ins and outs of the development environment, how to create a simple user interface, and how to perform navigation. Along the way you’ll see some Android Hints that will help make it easier for you to transition your existing skills to the Windows Phone platform. You’ll also see some Visual Studio Tips to make you more productive in your development environment. Good luck!

In the last lesson you explored the Windows Phone project Visual Studio created for you. Now it’s time to run and see what it looks like. There are two different ways you can run the application:

  1. In an emulator
  2. On a device

In this lesson you’ll learn how to run the application in both of these ways.

Emulator

Windows Phone Emulator is a desktop application that emulates a Windows Phone device. It provides a virtualized environment in which you can debug and test Windows Phone apps without a physical device. It also provides an isolated environment for your application prototypes.

Windows Phone Emulator is designed to provide comparable performance to an actual device. Before you publish your app to the Windows Phone Store, however, it is recommended that you test your app on a physical device.

You can test your app on a unique emulator image for each of the OS versions and screen resolutions supported by Windows Phone. The default emulator image in Visual Studio is Emulator WVGA 512MB, which emulates a memory-constrained Windows Phone 8 phone. This default selection encourages you to target the largest possible market for your Windows Phone 8 app.

To run the application in the emulator, simply click the button in the toolbar. This will do the following:

  1. Build your app.
  2. Package your app.
  3. Start the emulator (if it isn’t already running).
  4. Deploy (install) your app in the emulator.
  5. Start the app.

Of course, there’s not much to see yet, but at least your app is running!

Device

The emulator is designed to provide comparable performance to an actual device. Before you publish your app to the Windows Phone Store, however, it is recommended that you test your app on a physical device.

There are three prerequisites to running your app on a device from Visual Studio:

  1. Register with the Windows Phone Dev Center at http://bit.ly/StpJhE. When you set up your development environment this was an optional step. To run your app on a device this is required.
  2. Acquire a Windows Phone device. This might seem obvious, but you never can tell.
  3. Unlock the device using the Windows Phone Developer Registration tool that was installed on your machine when you installed Visual Studio. After you unlock your device you should see a screen like this:

 

After you have unlocked your Windows Phone running your app on the device is simple.

  1. Click the arrow on the right hand side of the button in the toolbar.
  2. Select Device from the dropdown.
  3. Click the button in the toolbar.

This will do the following:

  1. Build your app.
  2. Package your app.
  3. Deploy (install) your app to the device.
  4. Start the app on the device.

VISUAL STUDIO TIP

You don’t have to press the toolbar button to run your app. After you’ve selected where you want your app to run (Emulator or Device) you can press F6 to simply run the app or press F5 to run the app in debug mode to step through code.

 

That’s how you run your first Windows Phone app! Of course there isn’t much to see yet. In the next lesson you’ll start building out the user interface.

Previous Posts in this Series

  • Setting up the Development Environment
  • Creating Your First Windows Phone Project
  • Exploring the Windows Phone Project

Additional Resources

 

Over the past several weeks I’ve been working on some content I’m excited to finally share with you through a series of blog posts. This series will introduce you to Windows Phone 8 development from an Android developer’s perspective. Through the course of the series you’ll create your first app. It won’t be anything pretty, but you’ll learn the ins and outs of the development environment, how to create a simple user interface, and how to perform navigation. Along the way you’ll see some Android Hints that will help make it easier for you to transition your existing skills to the Windows Phone platform. You’ll also see some Visual Studio Tips to make you more productive in your development environment. Good luck!

In the last lesson you created your first Windows Phone project. In this lesson you’ll spend some time exploring the project and learning about some key files and directories.

WMAppManifest.xml


This is the application’s manifest. It is an XML document that contains details about the app, such as the App ID and the capabilities the app uses.

ANDROID HINT

WMAppManifest.xmal is similar to the AndroidManifest.xml file used by Android applications.

 

Here is some additional information about the manifest:

  • When you submit your apps to the Windows Phone Store, info from the manifest file is used in the certification process, to filter your app correctly in the Store, and to deploy and run your app on the device.
  • The info from the manifest file is stored as metadata in the app database.

If you double-click the manifest in the solution explorer you’ll get a UI you can use to edit the various properties of the manifest. For this app we’ll leave everything as is.

ANDROID HINT

In the generic Android app example I mentioned earlier, you set the default activity for the app in AndroidManifest.xml. Typically it looks something like this:

If you open up WMAppManifest.xml you’ll see an option for Navigation Page this is where you set the default page for the app to open when it starts.

 

MainPage.xaml and MainPage.xaml.cs


As mentioned in the last lesson XAML (eXtensible Application Markup Language) is the declarative language used to create the UI for Windows Phone applications. MainPage.xaml is the default page for your application. This is where you’ll create your simple UI (in the next lesson). MainPage.xaml.cs is the associated C# code that goes along with your UI.

VISUAL STUDIO TIP

The *.xaml.cs file that is associated with a *.xaml file is called the code-behind file.

 

ANDROID HINT

The relationship between *.xaml and *.xaml.cs files is similar to the relationship between layouts and activities in Android development. When you create a generic Android app, you’ll get an activity_main.xml file in the res > layout
directory. This is where you define the UI for your Android app. You also get a MainActivity.java file in your src directory. This is where you write the code that goes along with the UI. In our app MainPage.xaml corresponds to activity_main.xml, and MainPage.xaml.cs corresponds to MainActivity.java

 

App.xaml and App.xaml.cs


App.xaml can be used to store information about application wide resources. By default a reference is added to a file used to store localized string values.

App.xaml.cs provides application-specific behavior to supplement the default application class. This is also where you can tie into the following events of the application lifecycle:

  • Launching – when the application is initially launched.
  • Activated – when the application is brought to the foreground after being in the background.
  • Deactivated – when the application is sent to the background due to a system event (i.e. phone call).
  • Closing – when the user presses the hardware Back button.

ANDROID HINT

The following table maps the appropriate Android method to its Windows Phone event counterpart:

Android Method

Windows Phone Event

onCreate()

Launching

onStart()

Launching

onResume()

Launching or Activated

onPause()

Deactivated

onStop()

Closing

onDestroy()

Closing

 

The Windows Phone application lifecycle will be covered in depth in another installment of this series.

Assets Directory

The Assets directory contains default artwork used by the application.

ANDROID HINT

The items contained in the Assets directory are similar to those found in the res/drawable-* directories of your Android projects.

 

Resources and LocalizedStrings.cs

The Resources directory contains resources used across the application. By default it contains one file, AppResources.resx. This file is where you store strings displayed in the UI for localization.

ANDROID HINT

AppResources.resx is similar to the res/values/strings.xml file used in Android projects.

 

The LocalizedStrings.cs file wraps access to the AppResources.resx file and gives your app programmatic access to the string resources it contains.

As you can see, Visual Studio gives you a lot for free so you can get started on your app. You should continue to explore your project set up as well as the files and directories that get created with the of the other project templates as Visual Studio does a lot of heavy lifting for you.

In the next lesson you’ll learn how to run your application.

Previous Posts in this Series

  • Setting up the Development Environment
  • Creating Your First Windows Phone Project

Additional Resources


 

Windows Phone 8 offers up some exciting new features and opportunities for developers. The customer base is getting larger with new form factors and low-memory devices. Is your app ready? Are you ready to add the new Windows Phone 8 features to your existing 7.x app? Do you understand the key scenarios to make your app shine on Windows Phone 8 and bring nothing but 5-star reviews? The Windows Phone Evangelism team at Microsoft is hosting a Windows Phone 7.x Upgrade Lab to help you make your app shine on Windows Phone 8.

What is a Windows Phone Upgrade Lab?

The Windows Phone Upgrade Lab is a free, fun, no-fluff workshop for Windows Phone Developers by Windows Phone Developers. Our Technical Evangelist team will introduce you to the new features in Windows Phone 8 and what you, as a Windows Phone Developer, need to do to take advantage as these features. We will also guide you along the path of making your app work great across the new form factors and low memory devices coming from the many Windows Phone manufactures. Below are the locations and dates of our upcoming labs:


Location Date
Houston, TX 4/11
Irving, TX 4/15
Southfield, MI 4/16
Columbus, OH 5/3
Chicago, IL 5/7
Edina, MN 5/7
Indianapolis, IN 5/9

What can I expect?

The Windows Phone Upgrade Lab is a working lab. This means, bring your development machine and your source code and be ready to submit your Windows Phone 8 updates by the end of the day. We will start off the day by discussing the new developer features of the Windows Phone 8 SDK. Following this, our technical experts will be on-hand to assist you in bringing some of these features to life in your app. We will help identify what features would be best utilized in your app, help you implement those features, and assist you in submitting your app into the store by days end. We will cap off the day by introducing you to strategies for bringing your app to Windows 8 and opening up your app to a whole new world of new customers!

Some of the features we’ll be discussing, include…

  • New Windows Phone 8 Features
  • What is the Windows Phone Runtime?
  • What’s new in Tiles and Notifications
  • Handling Multiple Resolutions
  • Understanding the required artwork
  • New Proximity Scenarios with Bluetooth and NFC
  • New Mapping technology from Nokia
  • Lock Screen integration
  • How to start thinking of bringing your app to Windows

Notes:
1. Download and Install the Windows Phone 8 SDK at http://aka.ms/Phone8Tools

2. The Windows Phone 8 SDK Emulator requires your machine to support SLAT (Second Level Address Translation). You can verify if your machine supports SLAT by running the CoreInfo tool. More information can be found at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj863509(v=vs.105).aspx.

If your machine does not support SLAT, you can still use the SDK and test against a physical Windows Phone Device. If you don’t have a Windows Phone 8 device, we will have some on hand during the workshop to test with.

3. You can get a jump start on the workshop by working through the tutorials in the Windows Phone 8 Training Kit or playing around with the many Windows Phone Code Samples.

In addition to registering for this Workshop, be sure to take advantage of great resources such as access to free expert guidance, app and game frameworks, as well as free storage and tools with Generation App! Sign up at http://aka.ms/AppFor8.

Over the past several weeks I’ve been working on some content I’m excited to finally share with you through a series of blog posts. This series will introduce you to Windows Phone 8 development from an Android developer’s perspective. Through the course of the series you’ll create your first app. It won’t be anything pretty, but you’ll learn the ins and outs of the development environment, how to create a simple user interface, and how to perform navigation. Along the way you’ll see some Android Hints that will help make it easier for you to transition your existing skills to the Windows Phone platform. You’ll also see some Visual Studio Tips to make you more productive in your development environment. Good luck!

In the last lesson you set up your development environment which included installing Visual Studio. In Visual Studio, you create apps for Windows Phone by creating a Windows Phone project. The Windows Phone project contains all the files that comprise the source code for your app. Visual Studio makes it incredibly easy to start a new project with a set of default files and directories.

ANDROID HINT

The Windows Phone project template in Visual Studio is similar to the Android Application Project template that is added to Eclipse when you install the ADT Plugin.

 

In this lesson you’ll learn how to create your first Windows Phone project.

  1. Open Visual Studio 2012 Express for Windows Phone.
  2. Click New
    in the toolbar.
  3. In the window that appears select Installed > Templates > Visual C# > Windows Phone.

  4. Select the Windows Phone App template.
  5. Enter a Name for your project. This is the name of your project directory and the name visible in Visual Studio’s Solution Explorer.

ANDROID HINT

Solution Explorer is similar to Package Explorer in Eclipse.

 

  1. Select a Location for your project. This is where your source files will be stored on your local disk.

ANDROID HINT

This is similar to a Workspace used by Eclipse.

 

  1. Enter a Solution name. Solutions are how Visual Studio organizes multiple projects. Be default Visual Studio will use your project’s name as the solution name.
  2. Click OK.
  3. You’ll then be prompted to select which Windows Phone platform you want to target.

    Select Windows Phone OS 8.0 and click OK.

 

You may have noticed that Visual Studio has quite a few project templates for you to select from. Here’s a brief description of each template:

  • Windows Phone App – A project for creating a Windows Phone application.
  • Windows Phone Databound App – A project for creating a Windows Phone application using List and Navigation controls with a basic Model-View-ViewModel architecture.
  • Windows Phone Class Library – A reusable library for Windows Phone applications.
  • Windows Phone Panorama App – A project for creating a Windows Phone application using the Panorama control.
  • Windows Phone Pivot App – A project for creating a Windows Phone application using the Pivot control.
  • Windows Phone XAML and Direct3D App – A project for creating a Windows Phone managed application with native components.
  • Windows Phone XAML and XNA App – A project for creating a Windows Phone XAML application capable of rendering graphics using the XNA Framework.
  • Windows Phone HTML5 App – A project for creating a Windows Phone app that uses primarily HTML content.
  • Windows Phone Audio Playback Agent – A class library project for creating a background agent to play audio.
  • Windows Phone Audio Streaming Agent – A class library project for creating a background agent to stream audio.
  • Windows Phone Scheduled Task Agent – A class library project for creating a background agent to perform a periodic or resource intensive task.

     

For the sake of this walkthrough you’ll be using a combination of XAML and C# to create your first Windows Phone app. XAML (eXtensible Application Markup Language) is nothing more than a declarative language used to create the UI for Windows Phone apps. If you’ve done any Android UI development you’ll be very comfortable with XAML as it is simply an xml file. Just to be clear you are not limited to XAML and C# for your apps. You could use a combination of XAML and Visual Basic, XAML and Visual C++, or HTML and JavaScript to create your app.

Your Windows Phone project is now set up with some default files and you’re ready to being building your app. In the next lesson you’ll spend some time exploring the project you just created.

 

Previous Posts in this Series

  • Setting up the Development Environment

Additional Resources