Creating your first Windows Store app: a tutorial for Android developers

Applies to Windows and Windows Phone

This tutorial shows you how to create, build, and run your first Windows Store app with Visual Studio 2013. Although all developers can benefit from this tutorial, this info is presented specifically from an Android developer's perspective.

Lesson 1: Set up your app development environment

Before you can start creating your first Windows Store app, set up your app development environment.

Step 1: Install Windows 8.1

To install Windows 8.1, do one of the following.

  • We recommend either creating a separate disk partition and installing Windows 8.1 on it, or creating a bootable virtual hard disk (VHD) file with Windows 8.1 installed on it.
  • If you're running Mac OS X, you can use Boot Camp to create a separate disk partition and install Windows 8.1 on it for dual booting. Or you can use apps like Parallels Desktop, VirtualBox, or VMware Fusion to run Windows 8.1 on a virtual machine inside of Mac OS X. See Setting up your Mac.

To get Windows 8.1, go to the Windows 8.1 for Developers page.

Step 2: Install Visual Studio 2013

Microsoft Visual Studio is the IDE, similar to Eclipse, that you can use to create Windows Store apps. To get an edition of Visual Studio that's specially designed for creating Windows Store apps—Visual Studio 2013—go to the "Essential downloads" section of the Windows 8.1 for Developers page.

Note  Visual Studio 2013 only creates Windows Store apps for Windows 8.1.

Step 3: Get a developer license

A developer license lets you install, develop, test, and evaluate Windows Store apps before you submit them to the Windows Store for further testing and certification. These licenses are free. The first time you run Visual Studio 2013, it will automatically help you get a developer license. Although these licenses expire every few months, Visual Studio will automatically help you renew any expired developer licenses as needed.

In the next lesson, you'll learn how to create your first Windows Store app project.

Top

Lesson 2: Create your first project

In the previous lesson, you set up your development environment, which included installing a special edition of Visual Studio. In Visual Studio, you start creating an app for Windows 8.1 by creating a Windows Store app project. This project contains all of the files that make up your app's source code.

Eclipse Tip

The Windows Store app project template in Visual Studio is similar to the Android Application Project template that is included in the Android Development Tools (ADT) Bundle or that is added to Eclipse after you install the Android Development Tools (ADT) plugin.

 

In this lesson, you'll create your first Windows Store app project. If you want to create a Windows Phone 8.1 app, you can start with a different project and the steps will be almost exactly the same. If you want to create a project for both desktop/tablet and phone devices, create a universal Windows app. Again, the steps will be almost identical.

  1. Open Visual Studio 2013.
  2. Click File > New Project.
  3. Blank App (XAML) should already be selected. If not, expand Installed > Templates > Visual C# > Windows Store > Windows Apps and click Blank App (Windows), as shown in the following screen shot.

    Visual Studio New Project dialog box
  4. In the Name box, you can type a name for your project, for example MyFirstApp. This will be the project's directory name and the name that will appear in the Visual Studio Solution Explorer window for the project.
    Eclipse Tips

    A Visual Studio project's directory is similar to an Eclipse Workspace.

    The Visual Studio Solution Explorer window is similar to Eclipse's Package Explorer.

     

  5. In the Locaton box, you can type or browse to a location to store the project's files, or leave the default location.
  6. In the Solution name box, you can type a name for the project's containing solution name. For this tutorial, leave the default solution name (for example, MyFirstApp). You can use solutions to organize multiple related projects.
  7. Click OK.

You may have noticed that Visual Studio offers several project templates to choose from. Here are some of these project templates described.

  • Blank App (XAML): A single page that has no predefined controls or layout.
  • Grid App (XAML): Three pages that navigate among grouped items arranged in a grid. Dedicated pages display group and item details.
  • Split App (XAML): Two pages that navigate among grouped items. The first page allows group selection, while the second page displays an item list next to details for the selected item.
  • Class Library (Windows Store apps): A managed class library for Windows Store apps or Windows Runtime components.
  • Windows Runtime Component: A Windows Runtime component that can be used by Windows Store apps, regardless of the supported programming languages in which the apps are written.
  • Unit Test Library (Windows Store apps): A set of unit tests that can be used to test Windows Store apps, Windows Runtime components, or class libraries for Windows Store apps.

For this tutorial, you'll be using a combination of Extensible Application Markup Language (XAML) and C# to create your first Windows Store app. XAML (pronounced "zammel") is a declarative language that is used to create the UI for Windows Store apps. If you've done any Android UI development, you'll be comfortable with XAML, as it's an XML file. You're not limited to XAML and C# for your Windows Store apps. You can also use a combination of XAML and Microsoft Visual Basic, XAML and Microsoft Visual C++, or HTML and JavaScript.

In the next lesson, you'll explore the project that you just created.

Top

Lesson 3: Explore the project

In the previous lesson, you created your first Windows Store app project. In this lesson, you'll explore the project and learn about some of its core files and directories. You can find these files and directories in the Visual Studio Solution Explorer window for your project, as shown in the following screen shot.

Solution Explorer window

Package.appxmanifest file

This is the app's manifest. It is an XML document containing info that the system needs to deploy, display, and update a Windows Store app.

Android Tip

The Package.appxmanifest file in a Windows Store app project is similar to the AndroidManifest.xml file that's used by Android apps.

 

Here are some key points about the manifest file.

  • It includes package identity, package dependencies, required capabilities, visual elements, and extensibility points.
  • Every app package must include one package manifest file.
  • The manifest file is digitally signed as part of signing the app's package.
  • After signing, you can't modify the manifest file without invalidating the package's signature.
  • After the package has been installed, the package manifest file appears in the directory for the installed package.

If you double-click the manifest file in the Solution Explorer window, you'll see a UI that you can use to edit the manifest file's various properties. However, we won't be editing the manifest file in this tutorial.

MainPage.xaml and MainPage.xaml.cs files

XAML is the declarative language that is used to create the UI for Windows Store apps. MainPage.xaml is the default page for your app. This is where you'll create your app's UI. 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 a code-behind file.

 

Eclipse Tip

The relationship between *.xaml and *.xaml.cs files in Windows Store app development is similar to the relationship between layouts and activities in Android app development. When you create a generic Android app, an activity_main.xml file is created in the \res\layout\ directory. This is where you define the UI for your Android app. Also, a MainActivity.java file is created in the \src\ directory. This is where you write the code that goes along with the UI. In our Windows Store app project, the MainPage.xaml file corresponds to the activity_main.xml file in Android, and the MainPage.xaml.cs file corresponds to the MainActivity.java file, respectively.

 

App.xaml and App.xaml.cs files

The App.xaml file can be used to store info about app-wide resources, for example the StandardStyle.xaml file in the project's \Common\ directory. The App.xaml.cs file provides app-specific behavior; in fact, this is where the connection to the MainPage.xaml file is specified as the app's default page.

Android Tip

To set the default activity for an Android app in the AndroidManifest.xml file, the markup typically looks something like this.

<activity
    android:name="com.example.myfirstapp.MainActivity"
    android:label="@string/app_name" >
      <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
</activity>

If you open the App.xaml.cs file in Visual Studio and browse toward the end of the OnLaunched method, you'll see code that looks something like this.


 rootFrame.Navigate(typeof(MainPage), e.Arguments);

This code displays the MainPage.xaml file's UI after the app starts.

 

Assets directory

The \Assets\ directory contains default artwork used for things like the app's tiles and splash screen.

Eclipse Tip

The items in the \Assets\ directory in a Windows Store app project are similar to items in the \res\drawable-* directories of Android projects.

 

In the next lesson, you'll learn how to run your app.

Top

Lesson 4: Run the app

In the previous lesson, you explored the Windows Store app project that Visual Studio created. Now run the project's app to see what happens. There are three different ways to run the app: on the local machine, in the simulator, or on a remote machine. In this lesson, you'll learn how to run an app in each of these ways.

Local machine

To run the app on your local development machine, in Visual Studio, on the Standard toolbar, click the Local Machine button (Local Machine button). Here's what Visual Studio does.

  1. Builds the app.
  2. Packages the app.
  3. Deploys and installs the app on the local machine.
  4. Starts the app.

Of course, there's nothing much to see yet, but the app is indeed running. If you're curious, you can go to the Windows Start screen and verify that the app is indeed installed.

Simulator

If you don't want to deploy your app to your local machine, one alternative is to use the simulator that's included with Visual Studio. The simulator is like the emulator you can use with Eclipse and Android. However, unlike the Android emulator, you don't have to create something like an Android Virtual Device (AVD). Visual Studio does this for you automatically. To run your app in the simulator, do this.

  1. In Visual Studio, on the Standard toolbar, next to the Local Machine button, click the drop-down arrow (Local Machine button).
  2. Click Simulator.
  3. Click the Simulator button (Simulator button).

Visual Studio does this.

  1. Builds the app.
  2. Packages the app.
  3. Starts the simulator.
  4. Deploys and installs the app on the simulator.
  5. Starts the app in the simulator.

There are several reasons why you may want to run your app in the simulator instead of on your local machine.

  • The simulator enables you to simulate touch events, which is helpful if your local machine's monitor doesn't support touch.
  • The simulator enables you to change rotation from portrait to landscape modes, so that you can see how your app looks in various screen orientations.
  • You won't clutter your local computer's Start screen with the apps that you're testing.

Remote machine

Another alternative is to deploy your app to a remote machine that is on the same network as your local development machine.

Android Tip

In Visual Studio, deploying an app to a remote machine is similar in Android to using a real device for testing.

 

Setting up app deployment to a remote machine involves several steps. But it is worth the effort, especially if you want to test your apps on devices like Microsoft Surface Pro. Here's how to set it up.

  1. From the remote machine, download and install the Remote Tools for Visual Studio. Make sure to download and install the tools that match the remote machine's operating system architecture: x86, x64, or ARM. To get the tools, go to the "Related SDKs" section of the Windows 8.1 for Developers page.
  2. On the remote machine, run Remote Debugger. When you start the remote debugger for the first time, the Remote Debugging Configuration dialog box appears.
  3. If the Windows Web Services API is not installed, click the install button.
  4. Select the types of networks that you want the remote debugger to communicate with (for example, Domain networks, such as a workplace network). You must select at least one network type.
  5. Click Configure remote debugging to configure the remote machine's firewall and start the Remote Debugging Monitor.
  6. Once the Remote Debugging Monitor is running, you'll see it on the remote machine's desktop.

After the Remote Debugger is running, you can deploy your app to the remote machine. Do this in Visual Studio from the local machine.

  1. On the Standard toolbar, next to the Local Machine (or Simulator) button, click the drop-down arrow.
  2. Click Remote Machine.
  3. In the Remote Debug Connections dialog box, browse to and click the remote machine entry, and click Select.
  4. On the Standard toolbar, click the Remote Machine button (Remote Machine button).

Here's what Visual Studio does.

  1. Builds the app.
  2. Packages the app.
  3. Connects to the remote machine.
  4. Deploys and installs the app on the remote machine.
  5. Starts the app on the remote machine.

If this is the first time you've connected to the remote machine from Visual Studio, a dialog box may appear, prompting you to check the remote machine's console to get a developer license. Just as you need a developer license on a local development machine to run apps from Visual Studio, you also need a developer license on the remote machine to run apps from Visual Studio. Simply follow the on-screen steps on the remote machine's console.

Visual Studio Tip

After you've chosen where you want your app to run (local machine, simulator, or remote machine), you can now use the Visual Studio Debug menu to run the app in debug mode, step through the code, and so on.

 

In the next lesson, you'll start building the app's UI.

Top

Lesson 5: Build a user interface

A Windows Store app is a collection of pages that make up the app's UI. Each page is designed for the end user to interact with the app. A page is composed of layout controls and various widgets. The end user can see only one page at a time.

Android Tips

A Windows Store app page is similar to an Android activity.

Unlike Android, in Windows Store apps there are no system-level "back" or app-level "up" buttons. However, developers can implement navigation within their Windows Store apps through similar "back" or "up" button patterns. You'll explore this later in Lesson 7.

 

This table maps Android widgets to their Windows Store counterparts. For more info, see Task mappings from Android to Windows.

PurposeAndroidWindows Store

Display text

TextView

TextBlock

Edit text

EditText

TextBox

Radio button

RadioButton

RadioButton

Check box

CheckBox

CheckBox

Time input

TimePicker

TimePicker

Date input

DatePicker

DatePicker

Submit button

Button

Button

Show progress

ProgressBar

ProgressBar

Display a list of components

LinearLayout

StackPanel

Vertical list of components

ListView

ListView

2-dimensional grid

GridView

Grid

Display an image

ImageView

Image

 

There are of course many more of these. As with many app development platforms, there are many ways to perform the same task. For example, instead of using a ListView to display a vertical list in a Windows Store app, you could also use a StackPanel and set its orientation property accordingly. Also, you could use a ProgressRing instead of a ProgressBar to display progress changes in a different way.

In this lesson, you'll learn how to create a UI for your Windows Store app.

Step 1: Add a text field

For your UI, you'll want a label that tells the user what to do, a box where the user can type some text, and a button. In Visual Studio, start by adding the text field to the app, like this.

  1. In the Solution Explorer window, open the MainPage.xaml file.
    Visual Studio Tip

    When you open a *.xaml file, you'll see a split Design/XAML view by default. By default, the top view contains a visual designer, and the bottom view contains the markup that's generated by the designer. If you want to modify the XAML directly and you need more screen space in the XAML view, either click the up/down arrow button (Up down arrow button) between the Design and XAML views to show more of the XAML view, or click the double-chevron button (Double chevron button) between the Design and XAML views to minimize the Design view completely.

     

  2. Add a <StackPanel> element to the <Grid> element that Visual Studio added to the page when it was first created. Set its x:Name attribute to "theStackPanel" and its Orientation attribute to "Vertical". Your markup should look like this.
    
    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <StackPanel x:Name="theStackPanel" Orientation="Vertical"></StackPanel>
    </Grid>
    
    
    Visual Studio Tip

    You can also drag a StackPanel control from the Toolbox window onto the visual designer and then change the accompanying default XAML code that Visual Studio generates to match the preceding markup. However, sometimes you'll find that it's easier to type out XAML code when you want to get the controls initially positioned and nested just the way you want. Also, note that one of the characteristics of a StackPanel control is that it automatically positions any of its child controls. Dragging controls to different locations inside of a StackPanel just rearranges the accompanying XAML code to match their relationships visually.

     

    Android Tips

    The StackPanel class in Windows Store apps is equivalent to the LinearLayout class in Android apps. It enables you to lay out child elements in either a vertical or horizontal orientation.

    The x:Name attribute in Windows Store apps is similar to the android:id attribute in Android apps. However, you don't have to provide an x:Name attribute for purely visual elements.

    The Orientation attribute in Windows Store apps is identical to the android:Orientation attribute of the LinearLayout class in Android apps. The default value for the Orientation attribute is "Vertical".

     

  3. Now add a <TextBox> element inside of the <StackPanel> element. Be sure to provide an x:Name attribute for it ("theMessage") so that you can refer to it later in code. Your markup should look like this.
    
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <StackPanel x:Name="theStackPanel" Orientation="Vertical">
            <TextBox x:Name="theMessage"></TextBox>
        </StackPanel>
    </Grid>
    
    

Step 2: Add string resources

Next, you'll be adding a label to your page to tell the user what to do. While you might add a <TextBlock> element and set its Text attribute to the instructional text that you want to display, it goes against best practices for localization. Before you add the label to the page, add a resource file to your project to store the text that you want to display in the UI.

To add a resource file, do this.

  1. Right-click the project in the Solution Explorer window, and click Add > New Folder, as shown in the following screen shot. Name the folder Strings.

    Visual Studio Add New Folder menu command

  2. Right-click the Strings folder, and click Add > New Folder. Name the folder en-US.
  3. Right-click the en-US folder, and click Add > New Item.
  4. In the middle pane, click Resources File (.resw), and click Add, as shown in the following screen shot.Visual Studio Add New Item dialog box

    Android Tip

    A resources (*.resw) file in Windows Store apps is similar to the \res\values\strings.xml file in Android projects.

     

    Your Solution Explorer window should now look like the following screen shot.

    Visual Studio Solution Explorer window with Resources file showing
  5. If the Resources.resw file did not open automatically, double-click it in the Solution Explorer window to open it.
  6. In the Name field, type "messageLabel.Text". In the Value field, type "Enter a message". Your results should look like the following screen shot.

    Resources file with messageLabel entry showing

The string resource's name is important. The first part is the name of the visual element that the resource will be used for (in this case, messageLabel). The second part is the name of the property of the visual element that you want to use the resource for (in this case, the Text property).

Step 3: Add a label

Now that you have a resources file, you're ready to add the label to your page. Open the MainPage.xaml file, and add a <TextBlock> element before the <TextBox> element. Set its x:Name attribute to "messageLabel", and set its Text attribute to a blank string. To use the correct string resource, set the label's x:Uid attribute to the matching resource name ("messageLabel"). Your markup should now look like this.


<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <StackPanel x:Name="theStackPanel" Orientation="Vertical">
        <TextBlock x:Uid="messageLabel" x:Name="messageLabel" Text=""></TextBlock>
        <TextBox x:Name="theMessage"></TextBox>
    </StackPanel>
</Grid>

Step 4: Add a button

Finally, add a button to this page so that you can send the text that the user types to a second page. Before you add the button, be sure to add an entry in the Resources.resw file. Set the entry's Name field to sendButton.Content, and set the Value field to Send. Your results should look like the following screen shot.

Resources file with sendButton entry showing

Now, add a <Button> element after the <TextBox> element. Set its x:Name attribute to "sendButton", and set its Content attribute to a blank string. Also, set its x:Uid attribute to "sendButton" for localization. Your markup should now look like this.


<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <StackPanel x:Name="theStackPanel" Orientation="Vertical">
        <TextBlock x:Uid="messageLabel" x:Name="messageLabel" Text=""></TextBlock>
        <TextBox x:Name="theMessage"></TextBox>
        <Button x:Uid="sendButton" x:Name="sendButton" Content=""></Button>
    </StackPanel>
</Grid>

Now try running your app to see what happens: in Visual Studio, on the Debug menu, click Start Debugging. To stop the app, on the Debug menu, click Stop Debugging. You'll notice that clicking the Send button doesn't do anything yet. We'll take care of that in the next lesson.

Top

Lesson 6: Create a second page

In the previous lesson, you created a UI that accepts text input from a user. In this lesson, you'll create a second page in your app to display the user's text input after the user clicks the Send button.

Step 1: Create the second page

  1. In the Solution Explorer window, right-click the project, and click Add > New Item. In the middle pane, click Blank Page. Name it SecondPage.xaml, and click Add, as shown in the following screen shot.

    Visual Studio Add New Item dialog box with Blank Page selected
  2. If the SecondPage.xaml file did not open automatically, double-click it in the Solution Explorer window to open it.
  3. Add a <TextBlock> element to the <Grid> element. Set its x:Name attribute to "messageFromUser". Your markup should look like this.
    
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <TextBlock x:Name="messageFromUser"></TextBlock>
    </Grid>
    
    

Step 2: Respond to the Send button

Now you can display the user's text input from MainPage onto SecondPage, like this.

  1. Open the MainPage.xaml file.
  2. Add a Click attribute to the <Button> element, and set it to "sendButton_Click". You'll code the implementation for this in a moment. Your markup should now look like this.
    
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <StackPanel x:Name="theStackPanel" Orientation="Vertical">
            <TextBlock x:Uid="messageLabel" x:Name="messageLabel" Text=""></TextBlock>
            <TextBox x:Name="theMessage"></TextBox>
            <Button x:Uid="sendButton" x:Name="sendButton" Content="" Click="sendButton_Click"></Button>
        </StackPanel>
    </Grid>
    
    

    Android Tip

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

     

  3. Open the MainPage.xaml.cs file (the code-behind file for the MainPage.xaml file), and add a definition for the sendButton_Click method.
    Visual Studio Tip

    If you don't see the MainPage.xaml.cs file in the Solution Explorer window, expand the MainPage.xaml file to show the MainPage.xaml.cs code-behind file. Then double-click the MainPage.xaml.cs file to see its code, as shown in the following screen shot.

    Solution Explorer window

     

    Your code should look like this.

    
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
        }
    
        private void sendButton_Click(object sender, RoutedEventArgs e)
        {
        
        }
    }
    
    
  4. Add code to the sendButton_Click method to navigate to SecondPage to display the user's text input. Your code should look like this.
    
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
        }
    
    
        private void sendButton_Click(object sender, RoutedEventArgs e)
        {
            // Get the user's text from the <TextBox> element.
            var message = this.theMessage.Text;
    
            // If there is no text, provide some default text.
            if (string.IsNullOrEmpty(message))
            {
                message = "Hello, World!";
            }
            
            // Show SecondPage.xaml.
            this.Frame.Navigate(typeof(SecondPage), message);
        }
    }
    
    
    Android Tip

    In Android you would create an instance of the Intent class and call the startActivity method to go to the second page, with code like this.

    public void sendButton_Click(View view) {
        Intent intent = new Intent(this, SecondPageActivity.class);
        startActivity(intent);
    }

     

If you run the app now, clicking the Send button shows SecondPage. However, it doesn't yet display the user's text from MainPage. We'll code this in the next step.

Step 3: Display the text input

  1. Open the SecondPage.xaml.cs file (the code-behind file for the SecondPage.xaml file).
  2. Add the OnNavigatedTo method, and this code.
    
    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        // Get the user's text that was sent from MainPage.xaml.
        var message = (string)e.Parameter;
    
        // Show the user's text in the <TextBlock> element.
        this.messageFromUser.Text = message;
    }
    
    

Run the app, and click the Send button. SecondPage appears with the user's text showing. Notice though that there's no way to get back to MainPage from SecondPage. You'll solve this problem in the next lesson.

Top

Lesson 7: Add "back" navigation

There is no hardware "back" button for Windows 8 devices. However, you can add "back" navigation with a UI component and some code. In this lesson, you'll learn how to go back to MainPage from SecondPage.

  1. Open the SecondPage.xaml file. Wrap the <TextBlock> element in a <StackPanel> element, and change the <StackPanel> element's orientation to vertical. Your markup should look like this.
    
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <StackPanel Orientation="Vertical">
            <TextBlock x:Name="messageFromUser"></TextBlock>
        </StackPanel>
    </Grid>
    
    
  2. Open the Resources.resw file, and add a new entry. Set the entry's Name field to goBack.Content, and set the Value field to Go back.
  3. Open the SecondPage.xaml file. Add a <Button> element after the <TextBlock> element, specifying the x:Name, x:Uid, Content, and Click attributes to "goBack", "goBack", a blank string, and "goBack_Click", respectively. Your markup should now look like this.
    
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <StackPanel Orientation="Vertical">
            <TextBlock x:Name="messageFromUser"></TextBlock>
            <Button x:Name="goBack" x:Uid="goBack" Content="" Click="goBack_Click"></Button>
        </StackPanel>
    </Grid>
    
    
  4. Open the SecondPage.xaml.cs file, and add an implementation of the goBack_Click method. Your code should look like this.
    
    public sealed partial class SecondPage : Page
    {
        public SecondPage()
        {
            this.InitializeComponent();
        }
    
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Get the user's text that was sent from MainPage.xaml.
            var message = (string)e.Parameter;
    
            // Show the user's text in the <TextBlock> element.
            this.messageFromUser.Text = message;
        }
    
        private void goBack_Click(object sender, RoutedEventArgs e)
        {
            // Go back to MainPage.xaml, if the page allows.
            if (this.Frame.CanGoBack)
            {
                this.Frame.GoBack();
            }
        }
    }
    
    
    Android Tip

    To do something similar in Android, you would enable "up" in the action bar in your activity's onCreate method, with code that looks something like this.

    @Override
    public void onCreate(Bundle savedInstanceState) {
        ...
        getActionBar().setDisplayHomeAsUpEnabled(true);
        ...
    }

     

Now run the app, click the Send button, and click the Go back button.

Top

Next steps

You have just created, designed, coded, and ran your first Windows Store app. To learn more about building Windows Store apps, see these resources, created specifically for Android developers.

Top

 

 

Show:
© 2014 Microsoft