다음을 통해 공유


Declarations in Package App Manifest


Introduction

This Article is about the Declaration in Package App manifest file for Universal Apps. The Package app manifest file contains the properties of the deployment package for your app and you can design or change the properties by the app Manifest designers. The Package App manifest is a XML file which you can modify the properties in Xml Editor.

Explanation

In this section the declaration in Package App Manifest has two part the contract and Extensions. The contracts are the declarations in which the application has to implement certain behaviors to interact with the windows runtime with the other applications. I-e if we have to add the Search contract , if the search contract is implemented it will allow the user to perform searches within the application or if we add Share Target contract, then our application is capable to receive the data from the other applications.

Whereas extensions are the interaction between Application and the OS that is to extend the Standardized feature of Windows RT. I-e If we are going to add the Account Picture Provider then the Background Task will be running the code during its suspend State and User is able to change it profile picture.

Opening the Package App Manifest File:

  • Step 1:

**1.     **Open Visual Studio, Create a Universal app. On the Top Right Corner, there will be a Solution Explorer. i-e

  • **    Step 2:**

   Double click on the Package.appxmanifest File under the Windows 8.1 or Windows phone 8.1 here I am using Windows 8.1. The Package.appxmanifest file is like this.

After opening the Package App manifest file Click on the Declaration Tab. To discuss the Declaration of Properties that is using on windows runtime environment or if you want to see the code, Right Click on the Package.appxmanifest file and Click on view code it will provide a Code like this, where you can change the Code Manually.

////////////////////////////////CODE/////////////////////////////////////////

<?XML version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
  <Identity Name="47098edf-895e-4993-8b44-aeeedsfvfdcd52" Publisher="CN=Zax" Version="1.0.0.0" />
  <Properties>
    <DisplayName>Demo Project.Windows</DisplayName>
    <PublisherDisplayName>Ashman</PublisherDisplayName>
    <Logo>Assets\StoreLogo.png</Logo>
  </Properties>
  <Prerequisites>
    <OSMinVersion>6.3.0</OSMinVersion>
    <OSMaxVersionTested>6.3.0</OSMaxVersionTested>
  </Prerequisites>
  <Resources>
    <Resource Language="x-generate" />
  </Resources>
  <Applications>
    <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Demo_Project.Windows.App">
      <m2:VisualElements DisplayName="Demo Project.Windows" Square150x150Logo="Assets\Logo.png" Square30x30Logo="Assets\SmallLogo.png" Description="Demo Project.Windows" ForegroundText="light" BackgroundColor="#464646">
        <m2:SplashScreen Image="Assets\SplashScreen.png" />
      </m2:VisualElements>
      <Extensions>
        <Extension Category="windows.shareTarget">
          <ShareTarget m2:Description="asdads">
            <SupportedFileTypes>
              <SupportsAnyFileType />
            </SupportedFileTypes>
            <DataFormat>.jpg</DataFormat>
          </ShareTarget>
        </Extension>
      </Extensions>
    </Application>
  </Applications>
  <Capabilities>
    <Capability Name="internetClient" />
  </Capabilities>
</Package>

///////////////////////////////////////////////////////////////////////////////

  • Step 3:

1.     In the Declaration Tab we have a list of the available declarations to implement on the app to interact with other devices.


There are some declarations which are supported in windows store apps and some are supported in windows phone app .It is not mandatory that all the declarations that we are using in the windows 8.1 apps will work on the phone 8.1 apps.

**1.   **

  • Step 4:

**  **Let suppose we are creating an app for Sharing content then we must have to add the declaration of share Target to notify the application in the windows runtime environment.

Share Target is added with the Share description and you can also set the other app settings. Declarations are the services for the better integration of the applications to interact with other devices. You can add for Both Package app manifest file the share target declaration and make appropriate settings.

  • Step 5:

1.     Consider the Data transfer manager where we can Share the data by mean to different Social media like Facebook, twitter etc.


  • Step 6:

**1.    ** After Adding share Target You can See After launching the application you are able to have a share Target like this.


If you have any questions Feel free to contact me at ashman.malik@outlook.com. Follow me @Ashman_malik