Windows 8.1 app Go again-create my first app

Source: Internet
Author: User

Original: Windows 8.1 app Go again-create my first app

In the blink of an eye Windows 8.1 has been released for four months, before because of the development needs of Windows 8.1 new features of the fragmented learning and use, has not been quiet to learn the system. Recently, several new colleagues in the department have joined the Windows Store application development training, so take this opportunity to re-comb the Windows 8.1 app development knowledge. Gossip doesn't speak much, then start the first station and create the first app.

First, let's look at the development environment requirements: Windows 8.1 + Visual Studio 2013

And then we create a new Windows 8.1 store app, named HelloWorld (well, that might be the most used name), to look at the composition of the project

    • General information about the AssemblyInfo.cs file control set in the properties directory, such as the assembly title, description, company, copyright, and version;
    • References are a directory that everyone is familiar with, and our references to other assemblies are listed here, and we can add references or delete references;
    • The assets directory contains image files related to the app icon and the splash screen;
    • The App.xaml contains the resources required for the application, and App.xaml.cs provides an entry point for the application;
    • HELLOWORLD_TEMPORARYKEY.PFX is the application of the digital certificate file;
    • MainPage.xaml is the first interface that appears after the application is launched;
    • Package.appxmainfest is the application's manifest file, which allows you to set app names, icons, portals, features, and so on in a file.

Next we'll elaborate on the manifest file:

1. Application

The main settings are the name of the app, language, support rotation, supported notification methods, and so on. The big difference with Windows 8 is that you can set the minimum width, the snapped state of Windows 8 has a fixed width of 320px, and users in Windows 8.1 can drag and drop to change the width of the snapped state app. Developers can also set a minimum width of 320px, 500px, or a default value.

2. Visible assets

The main settings of the app's various icons and splash screen, the pictures are stored in the assets directory mentioned earlier, unlike Windows 8, you can set the default size of the app, you can also set the app's 310 * 310 logo.

3. function

Mainly specify the system functions that the application can use, such as we need to get the user location coordinates, we need to tick the "location" function.

4. Disclaimer

The main additions to the app's available claims, such as the need to implement the search protocol, are to add a "search" claim and then fill in the relevant attributes.

5. Content URI

Primarily adds an HTTPS URI that can send an Scriptnotify event to an application. Allowedscriptnotifyuris, Anyscriptnotifyuri, and Allowedscriptnotifyurisproperty for WebView controls are not supported in Windows 8.1. So the URI that allows the Scriptnotify event to be raised needs to be listed here.

6. Packaging

primarily specifies the property information for the installation package

Then we make some changes to mainpage and try to debug the application. We add a text control to the page:

<Pagex:class= "Helloworld.mainpage"xmlns= "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x= "Http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local= "Using:helloworld"xmlns:d= "http://schemas.microsoft.com/expression/blend/2008"XMLNS:MC= "http://schemas.openxmlformats.org/markup-compatibility/2006"mc:ignorable= "D">    <GridBackground="{ThemeResource Applicationpagebackgroundthemebrush}">        <TextBlockText= "My first App, Hello world."HorizontalAlignment= "Center"VerticalAlignment= "Center"FontSize= " the"/>    </Grid></Page>

Then we can debug the application, before debugging, let's take a look at the debugging method. The debugging methods for Windows store apps are: Emulator, local computer, and remote computer. The emulator and the local computer, as the name implies, are debugging in the native boot emulator and debugging in the native, while the remote computer is used for debugging on a tablet connected to this machine. Here we choose to debug in the simulator, running effects such as:

After running, the application interface of the simulator shows the text box we added. The creation and commissioning of our first application here is complete, thank you.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.