Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Adding SDK Extension to the Project From a Specific Folder

From Wiki
Jump to: navigation, search

This article has the goal to expose a sample for adding a SDK Extension to a project from a specific folder.

WP Metro Icon WP8.png
Article Metadata
Tested with
SDK: Windows Phone 8.0 SDK
Devices(s): Nokia Lumia 920, 925, 625
Compatibility
Platform(s):
Windows Phone 8
Article
Created: saramgsilva (10 Aug 2014)
Last edited: saramgsilva (10 Aug 2014)

Contents

Introduction

This article has the goal to expose a sample for adding a SDK Extension to a project from a specific folder.

Motivation

Sometimes developers need to:

  • Manage the SDK Extension in their apps and in some cases they need to keep multiple versions for the same SDK Extension for a different version of the same app
  • Specify the SDK Extension folder for the build process in continuous integration
  • Share samples in the community and to help the users, add the SDK's extension to the project, this way the user doesn´t need to install it

In a real case, the team of Xamarin.Forms.Labs project, created a sample for Windows Phone 8.0. This sample uses the database SQLite and to help users run the sample, it was associated with the project with theSQLite SDK Extension. With this, the user doesn´t need to install the SQLite SDK Extension in the PC, only build and run the sample.

The solution

When we install the SQLite SDK Extension the installation doesn´t say where the SDK Extension is installed, but it is easy to get the path. For it open/create a Windows Phone project and then select Add reference > Windows Phone SDK 8.0 and with the mouse over the title of the SDK extension and then it is possible to see the complete path.

Sdkextension1.jpg

Then go to that path and you see something like it.


Sdkextension2.jpg

In the project you should create a folder for the SDK Extensions and inside it add a folder with the same tree as we saw before as in the following:

Windows Phone\v8.0\ExtensionsSDKs\SQLite.WP80

For help, we can see the result in the Xamarin.Forms.Labs project:

Sdkextension3.jpg

Note: The folder SDKs were created in the same root as the solution. And if you get the repository then you will see that there is a folder for samples and another for source code and the solution and SDKs folder are inside the src folder.

After the SDKs folder is created we need to add a configuration to the Windows Phone Project (the project that uses this SDK Extension). In the cproj file add:

<PropertyGroup>  
<SDKReferenceDirectoryRoot>$(SolutionDir)\Sdks;$(SDKReferenceDirectoryRoot)</SDKReferenceDirectoryRoot>
</PropertyGroup>

In Xamarin.Forms.Labs you can find this in the Xamarin.Forms.Labs.Sample.WP.csproj file.

With the solution opened, select the project then select Add reference -> Windows Phone SDK 8.0 and with mouse you can see the path for the SDK Extension.

Sdkextension4.jpg


Conclusion

In conclusion, adding a especific SDK Extension folder to a project, without installing the SDK Extension in the PC, is very simple and can help to manage the various versions of the SDK Extension and can be useful for building servers with continuous integration.

This page was last modified on 10 August 2014, at 11:38.
47 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×