<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>NicolBlog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/nicold/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/nicold/feed.xml</link>
    <description>Nicola Delfino&amp;#039;s blog</description>
    <lastBuildDate>Mon, 02 Jul 2018 10:55:38 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How to set ImageView ScaleType to TOPCROP</title>
      <link>https://docs.microsoft.com/archive/blogs/nicold/how-to-set-imageview-scaletype-to-topcrop</link>
      <pubDate>Mon, 02 Jul 2018 11:55:37 GMT</pubDate>
      <dc:creator><![CDATA[Nico LD]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/nicold/?p=1145</guid>
      <description><![CDATA[Yesterday I have had the need to align TopCrop an image inside an Android ImageView. Unfortunally...]]></description>
      <content:encoded><![CDATA[<span style="float: none;background-color: transparent;color: #494e52;font-family: -apple-system,BlinkMacSystemFont,'Roboto','Segoe UI','Helvetica Neue','Lucida Grande',Arial,sans-serif;font-size: 22px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: left;text-decoration: none;text-indent: 0px">Yesterday I have had the need to align TopCrop an image inside an Android ImageView. Unfortunally Android ImageView doesn’t allow this crop style, so I have implemented it by my own starting from a java sample. you can find the source code here: <a href="https://nicolgit.github.io/xamarin-how-set-imageview-scaletype-to-topcrop/">https://nicolgit.github.io/xamarin-how-set-imageview-scaletype-to-topcrop/</a> </span>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>OAUTH 2.0 protocol support level for ADFS 2012R2 vs ADFS 2016</title>
      <link>https://docs.microsoft.com/archive/blogs/nicold/oauth-2-0-protocol-support-level-for-adfs-2012r2-vs-adfs-2016</link>
      <pubDate>Fri, 23 Mar 2018 20:00:56 GMT</pubDate>
      <dc:creator><![CDATA[Nico LD]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/nicold/?p=1125</guid>
      <description><![CDATA[Active Directory Federation Services (ADFS) is a software component developed by Microsoft that can...]]></description>
      <content:encoded><![CDATA[Active Directory Federation Services (ADFS) is a software component developed by Microsoft that can be installed on Windows Server operating systems to provide users with single sign-on access to systems and applications located across organizational boundaries. It uses a claims-based access control authorization model to maintain application security and implement federated identity.

OAuth 2.0 is an open standard created by the IETF for authorization and is documented by RFC 6749 (https://tools.ietf.org/html/rfc6749). Generally, OAuth provides to clients a "secure delegated access" to server resources on behalf of a resource owner. It specifies a process for resource owners to authorize third-party access to their server resources without sharing their credentials. Designed specifically to work with Hypertext Transfer Protocol (HTTP), OAuth essentially allows access tokens to be issued to third-party clients by an authorization server, with the approval of the resource owner. The third party then uses the access token to access the protected resources hosted by the resource server.

Starting from Windows Server 2012 R2 ADFS (Version 3.0) supports OAUTH 2.0 authorization protocol, and this post tries to clarify what this means. OAUTH 2.0 define various authorization grants, client and token types. ADFS started with the support of a subset of these, and  increased this support over time with Windows Server 2016 and his ADFS Version 4.0.
<h1>Authorization Grants</h1>
<table style="border-spacing: 24px;border-collapse: separate">
<tbody>
<tr>
<th>authorization grant type</th>
<th>ADFS 2012R2</th>
<th>ADFS 2016</th>
</tr>
<tr>
<td><a href="https://tools.ietf.org/html/rfc6749#section-4.1">Authorization code grant</a>

<span>used to obtain both access tokens and refresh tokens and is optimized for clients (i.e. mobile apps) able to interact with the resource owner's user-agent (typically a web browser) and capable of receiving incoming requests (via redirection) from the authorization server.

</span></td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td><a href="https://tools.ietf.org/html/rfc6749#section-4.2">Implicit Grant</a>

<span>is used to obtain access tokens (it does not support the issuance of refresh tokens) and is optimized for public clients known to operate a particular redirection URI.  These clients are typically implemented in a browser using a scripting language such as JavaScript.
</span></td>
<td>no</td>
<td>yes</td>
</tr>
<tr>
<td><a href="https://tools.ietf.org/html/rfc6749#section-4.3">Resource owner password credential</a></td>
<td>no</td>
<td>yes</td>
</tr>
<tr>
<td><a href="https://tools.ietf.org/html/rfc6749#section-4.4">Client credential grant</a></td>
<td>no</td>
<td><a href="https://blogs.technet.microsoft.com/cloudpfe/2017/10/16/oauth-2-0-confidential-clients-and-active-directory-federation-services-on-windows-server-2016/">yes</a></td>
</tr>
</tbody>
</table>
<h1>Client Types</h1>
<table style="border-spacing: 24px;border-collapse: separate">
<tbody>
<tr>
<th>Client Types</th>
<th>ADFS 2012R2</th>
<th>ADFS 2016</th>
</tr>
<tr>
<td><a href="https://tools.ietf.org/html/rfc6749#section-2.1">Public Client</a></td>
<td>Yes</td>
<td>Yes</td>
</tr>
<tr>
<td><a href="https://tools.ietf.org/html/rfc6749#section-2.1">Confidential Client</a></td>
<td>No</td>
<td>Yes</td>
</tr>
</tbody>
</table>
Oauth confidential client authentication methods:
<ul class="unordered">
 	<li>Symmetric (shared secret / password)</li>
 	<li>Asymmetric keys</li>
 	<li>Windows Integrated Authentication (WIA)</li>
</ul>
<h1>Token Types</h1>
<table style="border-spacing: 24px;border-collapse: separate">
<tbody>
<tr>
<th>Token Type</th>
<th>ADFS 2012 R2</th>
<th>ADFS 2016</th>
</tr>
<tr>
<td><b><span style="font-family: Segoe UI Bold">id_token</span></b>

<span> A JWT token used to represent the identity of the user. The 'aud' or audience claim of the id_token matches the client ID of the native or server application</span></td>
<td>no</td>
<td><a href="https://blogs.technet.microsoft.com/piameruo/2017/10/22/custom_idtoken/">yes</a></td>
</tr>
<tr>
<td><a href="https://tools.ietf.org/html/rfc6749#page-10"><b><span style="font-family: Segoe UI Bold">access_token</span></b></a>

<span>A JWT token used in Oauth and OpenID connect scenarios and intended to be consumed by the resource. The 'aud' or audience claim of this token must match the identifier of the resource or Web API.</span></td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td><a href="https://tools.ietf.org/html/rfc6749#page-10"><b><span style="font-family: Segoe UI Bold">refresh_token</span></b></a>

<span>This token is submitted in place of collecting user credentials to provide a single sign on experience. This token is both issued and consumed by AD FS, and is not readable by clients or resources.</span></td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<span style="float: none;background-color: transparent;color: #333333;font-family: 'Segoe UI',Tahoma,Arial,'Helvetica Neue',Helvetica,Sans-Serif;font-size: 14px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: justify;text-decoration: none;text-indent: 0px">ADFS issues access tokens and refresh tokens in the JWT (JSON Web Token) format in response to successful authorization requests using the OAuth 2.0 protocol. ADFS does not issue SAML tokens over the OAuth 2.0 authorization protocol.</span>
<h1>Further information</h1>
<ul>
 	<li> <a href="https://technet.microsoft.com/ru-ru/library/mt617220(v=ws.11)">https://technet.microsoft.com/ru-ru/library/mt617220(v=ws.11)</a></li>
 	<li> <a href="https://blogs.technet.microsoft.com/maheshu/2015/04/28/oauth-2-0-support-in-adfs-on-windows-server-2012-r2/">https://blogs.technet.microsoft.com/maheshu/2015/04/28/oauth-2-0-support-in-adfs-on-windows-server-2012-r2/</a></li>
 	<li> <a href="https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/overview/ad-fs-scenarios-for-developers">https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/overview/ad-fs-scenarios-for-developers</a></li>
 	<li> <a href="https://medium.com/@robert.broeckelmann/saml2-vs-jwt-understanding-oauth2-4abde9e7ec8b">https://medium.com/@robert.broeckelmann/saml2-vs-jwt-understanding-oauth2-4abde9e7ec8b</a></li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>#HOWTO - Continuous delivery from GitHub to Azure AppService</title>
      <link>https://docs.microsoft.com/archive/blogs/nicold/howto-continuous-delivery-from-github-to-azure-appservice</link>
      <pubDate>Mon, 12 Mar 2018 15:01:40 GMT</pubDate>
      <dc:creator><![CDATA[Nico LD]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/nicold/?p=1035</guid>
      <description><![CDATA[Few months ago I have spent a couple of evening in implementing an AppService able to delivery...]]></description>
      <content:encoded><![CDATA[<p lang="en-US"><a href="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-process.png"><img width="511" height="503" class="aligncenter size-full wp-image-1105" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-process.png" /></a></p>
<p lang="en-US">Few months ago I have spent a couple of evening in implementing an AppService able to delivery events from <a href="https://blogs.msdn.microsoft.com/nicold/2017/10/13/from-visual-studio-to-lametrictime-clock/">Visual Studio Online to a Lametric smart clock</a>. I have also <a href="https://github.com/nicolgit/visualstudio-lametric">shared all the solution code on GitHub</a>.</p>
<p lang="en-US">Well, yesterday, while I was working on other stuff on a customer's AppService, the following icon have grabbed my attention:</p>
<p lang="en-US"><a href="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-button.png"><img width="202" height="213" class="aligncenter size-full wp-image-1045" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-button.png" /></a></p>
<p lang="en-US">It allows to enable a continuous deployment from various sources to the AppService.</p>
<p lang="en-US">In the list of available sources I have found also GitHub... 2 seconds and I have quickly realized that I already have a perfect playground where to test this <em>automagic</em> workflow!</p>
<p lang="en-US"><a href="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-source.png"><img width="629" height="429" class="aligncenter wp-image-1055 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-source.png" /></a>so I went back on my subscription &gt; Lametric AppService and after a click on [deployment options] &gt; [GitHub] and the corresponding authorization workflow, I has been able to select my GitHub solution and preferred branch<a href="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-button.png"></a> to use for the deploy.</p>
<p lang="en-US"><a href="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-github.png"><img width="318" height="419" class="aligncenter size-full wp-image-1065" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-github.png" /></a></p>
<strong><span lang="en-US">Important note</span></strong><span lang="en-US">: in order to work the Visual Studio Solution file (</span><span lang="it">.sln) <strong>MUST BE</strong> the GitHub repository root folder!!</span>

Aftes a click on [OK] everything is <strong>DONE:</strong> AppService connects to GitHub, download the solution code, build it and deploy in <strong>PRODUCTION </strong>in a couple of minutes!
<p lang="en-US">When the deploy finishes an active deployment is shown under [Deployment Options] so you know what you have live.</p>
<p lang="en-US"><a href="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-log.png"><img width="794" height="567" class="aligncenter wp-image-1075 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-log.png" /></a></p>
<p lang="en-US">...and if you click on it you can also see what Azure have done under the hood:</p>
<p lang="en-US"><a href="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-log2.png"><img width="1024" height="729" class="aligncenter wp-image-1085 size-large" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-log2-1024x729.png" /></a></p>
<p lang="en-US">Interesting and <strong>USEFUL</strong> when you have to troubleshoot the process in case of an error.</p>
<p lang="en-US">From now every time I push an update to GitHub, well, the magic happen… in a couple of minutes a new version of the app is globally available :-) Yes, <em><strong>scary as it looks...</strong></em></p>
<p lang="en-US">Luckily I can<strong> easily rollback</strong> to a previous version if I need: I just have to select a previous deployment and click on [redeploy].</p>
<p lang="en-US"><a href="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-recovery.png"><img width="1024" height="335" class="aligncenter size-large wp-image-1095" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/deployment-recovery-1024x335.png" /></a></p>]]></content:encoded>
    </item>
    <item>
      <title>#CasualFriday - From Visual Studio Online to Lametric time® smart clock</title>
      <link>https://docs.microsoft.com/archive/blogs/nicold/from-visual-studio-to-lametrictime-clock</link>
      <pubDate>Fri, 13 Oct 2017 09:00:39 GMT</pubDate>
      <dc:creator><![CDATA[Nico LD]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/nicold/?p=987</guid>
      <description><![CDATA[The number of new smart devices to play with grows day after day. The baseline to work with them is...]]></description>
      <content:encoded><![CDATA[The number of new smart devices to play with grows day after day. The baseline to work with them is essentially always the same set of technologies: federated authentication, OAuth2, REST, AngularJS, Typescript, cloud services... and to operate with a Lametric time (<a href="https://www.lametric.com">www.lametric.com</a>) makes no difference. To build a system that delivers relevant information from a cloud-based Microsoft service like Visual Studio Online (VSO) to Lametric, allows you to have a reference architecture to use as starting point to implement more creative plug-ins for both Lametric and tons of other smart devices available nowadays. In this post, I describe how I have designed and implemented <a href="https://lametric-visualstudio.azurewebsites.net/">https://lametric-visualstudio.azurewebsites.net/</a> an Azure-based sample service that allows to show on your Lametric, check-in information from a TFS project hosted on VSO.
<h1>What's Lametric time?</h1>
LaMetric Time is a smart desktop toy that tracks time, weather, emails, calendar events, tweets, followers, news, deadlines and any other metric needed for your home or business, and displays them almost in real-time! It works as an always-on display for the whole family by showing notifications from smart home devices and allowing anyone to control them with the click of a button. LaMetric Time eliminates the need to check multiple apps or news sites for the information you need. Instead, you receive key information at a glance, all in one place. The possibilities are endless. It also shows real-time notifications from IFTTT-connected services. LaMetric Time is standalone Wi-Fi device, iPhone or Android smartphone is needed for setting it up and configuration only. The interface is easy to use: left and right buttons for navigation between the apps, middle button for taking related actions. The form factor is sized to fit well on a table, shelf, shop-front or a counter.

(more info on their website or on their Kickstarter campaign <a href="https://www.kickstarter.com/projects/smartatoms/lametric-customizable-smart-ticker-for-life-and-bu">https://www.kickstarter.com/projects/smartatoms/lametric-customizable-smart-ticker-for-life-and-bu</a>)

[caption id="" align="aligncenter" width="700"]<img width="700" height="525" class="size-full" src="https://ksr-ugc.imgix.net/assets/017/725/340/3686df9d49eafc631a43198a07b9e6cf_original.png?w=700&amp;fit=max&amp;v=1501512898&amp;auto=format&amp;q=92&amp;s=49b3f50cb3b34dcfcbd420219b1642c1" /> Lametric-Kickstarter[/caption]
<h1>How to deliver information to a Lametric Clock</h1>
Lametric time allows 3 types of interaction:
<ul>
 	<li><strong>Indicator app</strong>: allows to show information coming from "everywhere" in real time (push) or near real-time (periodic polling)</li>
 	<li><strong>Button app</strong>: allows triggering an action (call an external API) with the click of a button</li>
 	<li><strong>Notification app</strong> shows notifications on the clock coming from the local network.</li>
</ul>
Because Visual Studio Online is a SAAS hosted on Azure datacenters, I have opted for an indicator app.

An indicator app can show text and graphs with information coming from an external system. The trick here is to provide a REST endpoint with a specific format that maps 1-1 with the information shown on the clock. In my scenario, I want to show 2 pages, the first with the name of the repository, and the second with a check-in information (check-in username, check-in description, and check-in date). So, the REST data required (as defined on Lametric SDK) must be something like the following:
<pre>{ "frames": [
{ "text": "My Project Repository", "icon": "i9672" },
{ "text": "nicold have checked in 'fixed settings labels' 12 hours ago", "icon": "i9672" }
] }</pre>
Obviously Visual Studio Online have all these information, but they aren't available in this format, so our job is to build a middleware system that does the dirty job to convert VOS information in this format. Both Visual Studio Online and Lametric have the concept of "app". For Visual Studio an app can work on behalf of a specific user and interact with Visual Studio API. The app can be authorized via the classic OAuth 2.0 protocol:

[caption id="" align="aligncenter" width="540"]<img width="540" height="347" class="size-full" src="https://docs.microsoft.com/en-us/vsts/integrate/get-started/authentication/_img/oauth-overview.png" /> Visual Studio online OAuth flow[/caption]

To start, you have to go to [<a href="https://app.vssps.visualstudio.com/app/register">https://app.vssps.visualstudio.com/app/register</a>] and create an app. When you create an app, you need to specify also the scopes the app is authorized to access. VSO provides a huge amount of API, and make no sense to authorize all applications to access to all APIs, so all these are grouped in Scopes. In our scenario, we want to show the last check-in done on a project, so the "<strong>Code (read)</strong>" is where we need to access.

Other information required during the app registration is a name, a description, and an application callback URL app have to call at the end of the authorization flow (in VSO, HTTPS is required). Once created, an App-Id, App-Secret, and Client-Secret are available for you.

For more information on how to implement OAuth 2 authorization flow on visual studio, see <a href="https://docs.microsoft.com/en-us/vsts/integrate/get-started/authentication/oauth">https://docs.microsoft.com/en-us/vsts/integrate/get-started/authentication/oauth</a>

On the other side, a Lametric app is an application that can be installed by the user on the clock via the dedicated app store available via web or mobile app. Here, after you have defined a name, an icon, and a description, you need to define the type of message to show, the endpoint to call and the polling interval. In this sample I have implemented a polling scenario, but a notification implementation is also possible (VSO can send a notification to subscribed apps on check-in events - <a href="https://docs.microsoft.com/en-us/vsts/service-hooks/create-subscription?toc=/vsts/integrate/toc.json&amp;bc=/vsts/integrate/breadcrumb/toc.json">https://docs.microsoft.com/en-us/vsts/service-hooks/create-subscription?toc=/vsts/integrate/toc.json&amp;bc=/vsts/integrate/breadcrumb/toc.json</a> and also Lametric can receive notifications as well).
<h1>Logical Architecture</h1>
In the following schema, you can see the logical architecture for the solution.

<a href="https://msdnshared.blob.core.windows.net/media/2017/10/lametric-visualstudio.png"><img width="898" height="662" class="alignnone size-full wp-image-995" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/lametric-visualstudio.png" /></a>

After the login flow, the user is authorized to Visual Studio Online. A user can authenticate to Visual Studio Online via a Microsoft account or Azure Active Directory (Azure AD). Once authorized, all relevant user information is stored in an Azure table storage. We keep username, email, OAuth token, OAuth refresh token, and few other stuff.

From a user perspective, he has to go to <a target="_blank" href="https://lametric-visualstudio.azurewebsites.net/" rel="noopener noreferrer">https://lametric-visualstudio.azurewebsites.net/</a> and click on [Access to Visual Studio]. Once authenticated, the app requires permission to access to code scope.

&nbsp;

Once authorized, back on the app, the user has to select the Visual Studio Online TFS project to monitor typing the correct URL and pressing the SAVE button.

After this setup, via the Lametric app store, you have to install the app on the clock and provide the email used above as email parameter: this allows to connect the clock to the correct endpoint. Behind the scene, the clock will pool the following URL: <a href="https://lametric-visualstudio.azurewebsites.net/home/lametric?email=%3cyour-email-address%3e">https://lametric-visualstudio.azurewebsites.net/home/lametric?email=&lt;your-email-address&gt;</a>  The URL is anonymous so you can test it easily in the browser.
<h1>Solution Implementation</h1>
I wanted to implement the solution using the latest generation of Microsoft technologies so I decided to go to a Single Page Application (SPA) hosted on Azure with dot net core API and Azure Table Storage as backend. Luckily there is a fantastic template to use as starting point provided by Microsoft [ <a href="https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/">https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/</a> ]:  it does all the boring job of preparing a working project with all these technologies for you. It creates a starting solution with dot net core backend, node, Angular 2 and Typescript client side.

To install the Single Page Application (SPA) templates on your PC, run the following command:
<pre>dotnet new --install Microsoft.AspNetCore.SpaTemplates::*</pre>
Once this is installed, you'll see that '<strong>dotnet new</strong>' now can produce projects based on Angular, Aurelia, Knockout, React, and React + Redux.
<pre><a href="https://msdnshared.blob.core.windows.net/media/2017/10/lametric-dotnet-new.png"><img width="880" height="558" class="alignnone size-full wp-image-1006" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/lametric-dotnet-new.png" /></a></pre>
Using the highlighted template, we have Client Side Navigation, Server Side pre-rendering, web pack dev middleware, hot module replacement and efficient production builds. More information here [ <a href="https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/">https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/</a> ].

Once cleaned the sample from all not required-to-really-work-stuff, the next step is to integrate the authentication. In a perfect world, the best way to proceed is to integrate ASP.NET identity to the solution and connect the ASP.NET identity user to the Visual Studio Online user. This will give you the better and most scalable approach allowing you to have:
<ul>
 	<li>A dedicated user profile database</li>
 	<li>The possibility to add more Visual Studio connected account to a single ASP identity</li>
 	<li>The possibility to add more authentication services</li>
 	<li>Reset password, two-factor authentications, and much more</li>
</ul>
This comes to the cost of setup for the infrastructure, including a storage to keep everything (SQL Azure, SQLite or Azure Tables). In this sample, I decided to not overcomplicate the solution: because this service works only if authenticated from a Visual Studio Online account and I just need to store information for <strong>one</strong> Visual Studio Project, I have decided to implement a "custom" authentication fully based on Visual Studio Online access tokens.

Once authenticated and then authorized by Visual Studio, we have an access_token to Visual Studio APIs. I keep this access code client side and use it in all authenticated post to dot-net core backend. The authenticated calls are just 2: Test-URL and Save-URL. Both calls require in input the URL and the access_token. Checking the validity of the access_token, and so the user identity is verified with a call to a VSO API.

Following the Parameters used on both APIs.

[code language="csharp"]
    public class UrlParameter
    {
        public string url { get; set; }
        public string auth_token { get; set; }
    }
[/code]

The API /Home/Test, is called by the "Test" UI button and its implementation is shown below. It gives a result only if auth_token is not expired and Url is a valid Visual Studio TFS project accessible by the user.

[code language="csharp"]
        [HttpPost]
        async public Task&lt;string&gt; Test([FromBody]UrlParameter input)
        {
            _visualstudio.access_token = input.auth_token;
            var result = await _visualstudio.GetLatestChangesets(input.url);

            if (string.IsNullOrEmpty(result.Error) &amp;&amp; string.IsNullOrEmpty(result.message))
            {
                var output = $&quot;OK, working! query returned {result.count} items.&quot;;
                if (result.count&gt;0)
                {
                    output += $&quot;last check-in by {result.value[0].author.uniqueName}&quot;;
                }

                return output;
            }
            else
            {
                return $&quot;Error {result.Error} - {result.ErrorDescription} - {result.message}&quot;;
            }
        }
[/code]

The API /Home/UpdateURL is called by the "Save" UI button, and it is responsible to save on the Table Storage the project URL. Also here, a call to VSO is done to verify that the user is authorized. After this, the information is stored on the table storage.

[code language="csharp"]
 [HttpPost]
        async public Task&lt;string&gt; UpdateURL([FromBody]UrlParameter input)
        {
            _visualstudio.access_token = input.auth_token;
            var profile = await _visualstudio.GetUserProfileAsync();

            if (string.IsNullOrEmpty(profile.Error) &amp;&amp; string.IsNullOrEmpty(profile.message))
            {
                return await _azureTableManager.UpdateUrl(profile.emailAddress, input.url) ? &quot;OK&quot;: &quot;Error&quot;;
            }
            else
            {
                return $&quot;Error {profile.Error} - {profile.ErrorDescription}&quot;;
            }
        }
[/code]

The 3rd API available from the Home Controller is "Lametric" and is used by the clock to retrieve information to show. ( <a href="https://lametric-visualstudio.azurewebsites.net/home/lametric?email=%3cyour-email-address%3e">https://lametric-visualstudio.azurewebsites.net/home/lametric?email=&lt;your-email-address&gt;</a> ) during this call, the row corresponding to the user email is loaded from the Table Storage, the authentication token to access VSO is refreshed, and then GetLatestChangesets is called.

[code language="csharp"]
        [HttpGet]
        async public Task&lt;LametricMessage&gt; Lametric([FromQuery] string email)
        {
            LametricMessage result = new LametricMessage();

            try
            {
                var infos = await _azureTableManager.GetRow(email);

                var token = await _visualstudio.RefreshAccessCode(infos.RefreshToken);

                if (string.IsNullOrEmpty(token.Error))
                {
                    infos.AccessToken = token.access_token;
                    infos.RefreshToken = token.refresh_token;

                    var repositoryName = infos.VSO_Url.Substring(1 + infos.VSO_Url.LastIndexOf('/'));

                    await _azureTableManager.UpdateRow(infos);

                    _visualstudio.access_token = infos.AccessToken;
                    var changeset = await _visualstudio.GetLatestChangesets(infos.VSO_Url);

                    if (changeset != null &amp;&amp; changeset.count &gt; 0)
                    {
                    /// more stuff here
                    }
                }
            return result;
        }
[/code]

<h1>Conclusions</h1>
Even if this is just a sample, the end 2 end solution is 100% working and shows a reusable approach in integrating different cloud services using dot net core, OAuth, AngularJS and Azure App Service.

All the solution source code is available on GitHub [ <a href="https://github.com/nicolgit/visualstudio-lametric">https://github.com/nicolgit/visualstudio-lametric  </a>], the application is currently hosted on Azure [<a href="https://lametric-visualstudio.azurewebsites.net/">https://lametric-visualstudio.azurewebsites.net/</a>], and the corresponding app is available on Lametric app store [<a href="https://apps.lametric.com/apps/visual_studio_online_checkins/4358">https://apps.lametric.com/apps/visual_studio_online_checkins/4358</a>].

Happy check-ins:-D

[embed]https://lametric-visualstudio.azurewebsites.net/lametric-visualstudio-final.mp4[/embed]

&nbsp;

&nbsp;

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Engineering Caledos Runner - Code Reuse Metrics</title>
      <link>https://docs.microsoft.com/archive/blogs/nicold/engineering-caledos-runner-code-reuse-metrics</link>
      <pubDate>Thu, 27 Jul 2017 17:07:29 GMT</pubDate>
      <dc:creator><![CDATA[Nico LD]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/nicold/?p=875</guid>
      <description><![CDATA[This post is the first of a series with the objective to share the experience on multiplatform...]]></description>
      <content:encoded><![CDATA[<span>This post is the first of a series with the objective to share the experience on multiplatform development I've collected working on <a href="https://api.caledos.com">Caledos Runner</a>'s: a medium-sized fitness app currently publicly available on the <a href="https://play.google.com/store/apps/details?id=com.caledoslab.runner">Google Play Store</a>. The app is part of a side project on which I and <a href="https://it.linkedin.com/in/domenico-dell-olio-66257417">Domenico</a> have been working for some time, and that it is proving to be a great gym for the study of multiplatform development in general and <a href="https://www.xamarin.com/">Xamarin </a>in particular.</span>
<h1>Background</h1>
<a href="https://www.microsoft.com/en-us/store/p/caledos-runner/9wzdncrfhzwl">Caledos Runner is a fitness tracking application initially developed for Windows Phone (Silverlight)</a>. With over 1 million downloads, it has an Azure-based backend, and uses many of the device's capabilities, such as motion sensors, gyroscope, Bluetooth devices, and GPS, in a very pushy way. Caledos Runner for Android is developed using Xamarin, and it is born as a refactoring and evolution of the code developed for Windows, with the focus on portability and reuse.

<a href="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-device.jpg"><img width="1500" height="1500" class="aligncenter wp-image-975 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-device.jpg" /></a>
<h1>Code Reuse</h1>
Xamarin's distinctive element is the code reuse: in this post I will try to evaluate the amount of code reused between the different platforms. Although we have released only the <a href="https://play.google.com/store/apps/details?id=com.caledoslab.runner">android version</a>, the code refactoring started on Silverlight version, had the goal to maintain the broadest common code base, despite all the interactions with various platform components (Bluetooth, device sensors, GPS etc. ). As "consumer" solution, one of the main features was to have <strong>total control</strong> over the UI.

With these constraints, we have decided to use a native UI (so no <a href="https://www.xamarin.com/forms">Xamarin Forms</a>), <a href="https://en.wikipedia.org/wiki/Model–view–viewmodel">Model-View-ViewModel</a> as an architectural pattern, and <a href="https://www.mvvmcross.com/">MvvmCross</a> as a reference library, as it seemed to be the one that best interacts with a native UI. On Android it also allows the <a href="https://www.mvvmcross.com/documentation/fundamentals/data-binding">binding from XML</a>, in a way very similar to the XAML binding we have used for years in WPF and Windows Phone.

Having said that, in order to "force us" to the order, we have separated in different projects the components:
<ul>
 	<li>Model</li>
 	<li>ViewModel</li>
 	<li>View (platform specific)</li>
</ul>
for all "non view" platform specific components (sensors, text2speech and so on...), we have used the Inversion of Control (IoC) Pattern and in particular the <a href="https://www.mvvmcross.com/documentation/fundamentals/inversion-of-control-ioc">MvvmCross specific approach</a>. So we have declared in a common PCL all the interfaces and implemented them in a platform specific project.

For all Model components, instead, we have used the <a href="https://msdn.microsoft.com/en-us/library/ff650316.aspx">singleton pattern</a>.

[caption id="attachment_885" align="aligncenter" width="667"]<a href="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-solution-01.png"><img width="667" height="270" class="wp-image-885 size-full" alt="Caledos Runner Solution with platform specific code " src="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-solution-01.png" /></a> Caledos Runner Solution with platform specific code[/caption]

&nbsp;

Caledos Runner has also another characteristic: it is to have a backend developed in .Net, <a href="https://api.caledos.com">hosted on Azure</a>. We have quickly realized that the most logic thing to do was to share more code possible also with the cloud. Infact there are many functions that are used by both devices and cloud, so we have also defined a portion of Model and libraries, strictly PCL, in common with the cloud.

[caption id="attachment_895" align="aligncenter" width="667"]<a href="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-solution-02.png"><img width="667" height="270" class="wp-image-895 size-full" alt="Caledos Runner solution with PCL shared with cloud" src="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-solution-02.png" /></a> Caledos Runner solution with PCL shared with cloud[/caption]

Initially, the refactoring started in parallel on PCL components, Android specific views and the corresponding UWP. With Microsoft's slowdown on Windows Mobile platform, we also have slowdown our developments on the specific UI for that operating system (after all we already have a <a href="https://www.microsoft.com/en-us/store/p/caledos-runner/9wzdncrfhzwl">fully working silverlight version</a>), and we have focused our efforts on Android, using UWP as tester to verify how the core components work on more than one platform.

[caption id="attachment_896" align="aligncenter" width="500"]<a href="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-multiplatform.png"><img width="500" height="460" class="wp-image-896 size-full" alt="Caledos Runner silverlight, android, UWP (on mobile) UWP (on desktop)" src="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-multiplatform.png" /></a> Caledos Runner silverlight, android, UWP (on mobile) UWP (on desktop)[/caption]
<h1>Some Metric</h1>
Visual Studio, thanks to "calculate code metrics" tool, allows to analyze some <a href="https://docs.microsoft.com/en-us/visualstudio/code-quality/code-metrics-values">interesting software metrics</a>.

[caption id="attachment_897" align="aligncenter" width="923"]<a href="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-code-metrics.png"><img width="923" height="251" class="wp-image-897 size-full" alt="Visual Studio Code Metrics" src="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-code-metrics.png" /></a> Visual Studio Code Metrics[/caption]

With this tool I have measured the number of c# lines of code for each project, and in this way I could measure the actual amount of reusable (and reused!) code. Obviously the tool measures only the c# lines of code, not the xml and graphic part, which in this type of solution has a non-negligible dimension.

&nbsp;
<p style="text-align: center">total number of lines of code</p>

<h1 style="text-align: center"><strong>10679</strong></h1>
<p style="text-align: center">(July 2017 - Shared + Android)</p>
&nbsp;

The following chart shows the relationship between "PCL Shared" code lines vs. Android specific code lines. The solution has &gt;10K lines of code (July 2017)
<p style="text-align: center"><a href="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-shared-vs-android-011.png"><img width="570" height="407" class="alignnone size-full wp-image-965" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-shared-vs-android-011.png" /></a></p>

<h1 style="text-align: center"><strong>74%</strong></h1>
<p style="text-align: center">of lines of code are not device specific</p>
Moving to the "shared" part, the following chart shows the relationship between the code shared with the server, and the code in common only between the various clients (droid, UWP).

<a href="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-server-vs-client-01.png"><img width="521" height="400" class="size-full wp-image-977 aligncenter" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-server-vs-client-01.png" /></a>
<h1 style="text-align: center"><strong>42%</strong></h1>
<p style="text-align: center">of lines of code shared with server</p>
&nbsp;

the following chart shows instead the relationship between Model, ViewModel, View and Native parts. View and Native are device specific, but while "View" is code related to UI interaction, "Native" is the code needed to interact with device specific components not related with the UI (text 2 speech, sensors, Bluetooth and so on...)

<a href="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-model-viewmodel-view.png"><img width="566" height="372" class="size-full wp-image-955 aligncenter" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/07/caledos-runner-model-viewmodel-view.png" /></a>
<h1 style="text-align: center"><strong>46% vs 28%</strong></h1>
<p style="text-align: center">Model vs ViewModel lines of code</p>
As mentioned above, since the UWP version is a prototype at the moment, at least in terms of the UI and device specific code, in this evaluation, the number of code lines for that operating system has not been taken into account. If Caledos Runner continues to have the interest received on Windows Phone||Mobile, even on Android, the next step will be to implement the iOS UI, then we will probably have still more interesting metrics...

Okay, that's all for now, hope these info are valuable in evaluating the cost/benefit in using Xamarin on a real world consumer app!

I'm going for a run:-)]]></content:encoded>
    </item>
    <item>
      <title>Read heart rate from BLE device using Xamarin on Android</title>
      <link>https://docs.microsoft.com/archive/blogs/nicold/read-heart-rate-from-ble-device-using-xamarin-on-android</link>
      <pubDate>Mon, 24 Oct 2016 23:30:50 GMT</pubDate>
      <dc:creator><![CDATA[Nico LD]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/nicold/?p=855</guid>
      <description><![CDATA[in this sample I use the library found in xamarin-bluetooth-le to read heart rate and battery level...]]></description>
      <content:encoded><![CDATA[in this sample I use the library found in <a href="https://github.com/xabre/xamarin-bluetooth-le">xamarin-bluetooth-le</a> to read heart rate and battery level from a Polar H7. I have used this sample to test the integration of BLE Heart Rate Characteristics reading for <a href="https://api.caledos.com/">Caledos Runner</a> for android. Hope you enjoy reading it as much as I have enjoyed writing it:-)
<p style="text-align: center"><a href="https://msdnshared.blob.core.windows.net/media/2016/10/HR-ble-xamarin-sample.jpg"><img width="300" height="300" class="alignnone size-medium wp-image-865" alt="HR-ble-xamarin-sample" src="https://msdnshared.blob.core.windows.net/media/2016/10/HR-ble-xamarin-sample-300x300.jpg" /></a></p>
<p style="text-align: center">All the source code is available here on <a href="https://github.com/nicolgit/demo-xamarin-heartrate-ble">GitHub</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Demo Xamarin PebbleSport integration app</title>
      <link>https://docs.microsoft.com/archive/blogs/nicold/demo-xamarin-pebblesport-integration-app</link>
      <pubDate>Mon, 10 Oct 2016 16:34:41 GMT</pubDate>
      <dc:creator><![CDATA[Nico LD]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/nicold/?p=845</guid>
      <description><![CDATA[If you are looking for a Xamarin Android sample that show how to manage the Pebble Sport app from a...]]></description>
      <content:encoded><![CDATA[<p style="text-align: left">If you are looking for a Xamarin Android sample that show how to manage the Pebble Sport app from a Xamarin Project, I have just released on github a sample for you!:-)</p>
<p style="text-align: center">
<a href="https://msdnshared.blob.core.windows.net/media/2016/10/pebble-xamarin-sample-e1475883363790.jpg"><img width="300" height="298" class="alignnone size-medium wp-image-846" alt="pebble-xamarin-sample" src="https://msdnshared.blob.core.windows.net/media/2016/10/pebble-xamarin-sample-300x298.jpg" /></a></p>
<p align="center"><a href="https://github.com/nicolgit/demo-xamarin-pebblesport" title="https://github.com/nicolgit/demo-xamarin-pebblesport">https://github.com/nicolgit/demo-xamarin-pebblesport</a></p>
&nbsp;

Because I haven't found out there any sample that shows to use Pebble SDK from Xamarin, I decided to write this one.

In order to use latest Pebble aar libary available, go to: <a href="https://oss.sonatype.org/">https://oss.sonatype.org</a> and look for "<strong>com.getpebble</strong>". Download the aar file and use it in a xamarin binding library as shown here.

&nbsp;
<h1>for more information</h1>
<ul>
 	<li><a href="https://developer.xamarin.com/guides/android/advanced_topics/binding-a-java-library/binding-an-aar/" title="https://developer.xamarin.com/guides/android/advanced_topics/binding-a-java-library/binding-an-aar/">https://developer.xamarin.com/guides/android/advanced_topics/binding-a-java-library/binding-an-aar/</a></li>
 	<li><a href="https://developer.pebble.com/guides/communication/using-the-sports-api/" title="https://developer.pebble.com/guides/communication/using-the-sports-api/">https://developer.pebble.com/guides/communication/using-the-sports-api/</a></li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>How to remove Android partition from a Teclast x98 PRO “dual boot” - K9C6</title>
      <link>https://docs.microsoft.com/archive/blogs/nicold/how-to-remove-android-partition-from-a-teclast-x98-pro-dual-boot-k9c6</link>
      <pubDate>Tue, 15 Dec 2015 10:17:00 GMT</pubDate>
      <dc:creator><![CDATA[Nico LD]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/nicold/2015/12/15/how-to-remove-android-partition-from-a-teclast-x98-pro-dual-boot-k9c6/</guid>
      <description><![CDATA[The Teclast X98 Pro (a good review here) is the third iteration of the popular Teclast X98 series of...]]></description>
      <content:encoded><![CDATA[<p>The Teclast X98 Pro (a <a href="https://techtablets.com/teclast-x98-pro/review/" target="_blank">good review</a> here) is the third iteration of the popular Teclast X98 series of tablets. This latest 2015 version features an updated chipset with Intel’s latest Atom SoC the 14nm Cherry Trail and double the Ram of it’s predecessors. The X98 Pro currently comes with Windows 10 and no dual boot or 3G/4G options yet. Because the dual boot device reduce to less than 32Gb the space available for Windows 10, I’ve decided to remove the Android partition.</p>  <p>After various searches over internet and tests I’ve used the following procedure that have worked for my tablet.</p>  <h1>&#160;</h1>  <h1>What you need</h1>  <ul>   <li>Teclast x98 PRO – K9C6 </li>    <li><a href="https://www.ebay.com/sch/i.html?_trksid=p2050601.m570.l1311.R1.TR2.TRC0.A0.H1.Xhub+usb+otg+power+charging.TRS0&amp;_nkw=4+port+micro+usb+power+charging+otg" target="_blank">HUB USB OTG with power charging host</a> </li>    <li>USB Keyboard </li>    <li>USB mouse </li>    <li>8Gb USB flash drive </li> </ul>  <h1>Backup Windows 10 product key</h1>  <p>You can download the full guide and powershell script on <a href="https://winaero.com/blog/how-to-get-the-windows-product-key-without-using-third-party-software/" target="_blank">how backup window product key via PowerShell here</a>. Windows 10 should be able to automatically download the product key and re-activate itself on the same hardware, but just in case the procedure doesn’t work, here you have a backup of your product key.</p>  <ul>   <li>Open Powershell and “run as Administrator” </li>    <li>Type “Set-ExecutionPolicy RemoteSigned” </li>    <li>Type “.\GetProductKey.ps1” </li>    <li>Save the product key somewhere </li> </ul>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/0511.GetProductKey2_3E816C52.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/0511.GetProductKey2_5F00_3E816C52.png"><img title="GetProductKey2" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="GetProductKey2" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/3225.GetProductKey2_thumb_68204354.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/3225.GetProductKey2_5F00_thumb_5F00_68204354.png" width="244" height="186" /></a></p>  <hr />  <blockquote>   <p><span style="font-family: courier new">function Get-WindowsKey {        <br />&#160;&#160;&#160; ## function to retrieve the Windows Product Key from any PC         <br />&#160;&#160;&#160; ## by Jakob Bindslet (jakob@bindslet.dk)         <br />&#160;&#160;&#160; param ($targets = &quot;.&quot;)         <br />&#160;&#160;&#160; $hklm = 2147483650         <br />&#160;&#160;&#160; $regPath = &quot;Software\Microsoft\Windows NT\CurrentVersion&quot;         <br />&#160;&#160;&#160; $regValue = &quot;DigitalProductId&quot;         <br />&#160;&#160;&#160; Foreach ($target in $targets) {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $productKey = $null         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $win32os = $null         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $wmi = [WMIClass]&quot;\\$target\root\default:stdRegProv&quot;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $data = $wmi.GetBinaryValue($hklm,$regPath,$regValue)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $binArray = ($data.uValue)[52..66]         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $charsArray = &quot;B&quot;,&quot;C&quot;,&quot;D&quot;,&quot;F&quot;,&quot;G&quot;,&quot;H&quot;,&quot;J&quot;,&quot;K&quot;,&quot;M&quot;,&quot;P&quot;,&quot;Q&quot;,&quot;R&quot;,&quot;T&quot;,&quot;V&quot;,&quot;W&quot;,&quot;X&quot;,&quot;Y&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ## decrypt base24 encoded binary data         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; For ($i = 24; $i -ge 0; $i--) {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $k = 0         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; For ($j = 14; $j -ge 0; $j--) {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $k = $k * 256 -bxor $binArray[$j]         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $binArray[$j] = [math]::truncate($k / 24)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $k = $k % 24         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $productKey = $charsArray[$k] + $productKey         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; If (($i % 5 -eq 0) -and ($i -ne 0)) {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $productKey = &quot;-&quot; + $productKey         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $win32os = Get-WmiObject Win32_OperatingSystem -computer $target         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $obj = New-Object Object         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $obj | Add-Member Noteproperty Computer -value $target         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $obj | Add-Member Noteproperty Caption -value $win32os.Caption         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $obj | Add-Member Noteproperty CSDVersion -value $win32os.CSDVersion         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $obj | Add-Member Noteproperty OSArch -value $win32os.OSArchitecture         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $obj | Add-Member Noteproperty BuildNumber -value $win32os.BuildNumber         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $obj | Add-Member Noteproperty RegisteredTo -value $win32os.RegisteredUser         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $obj | Add-Member Noteproperty ProductID -value $win32os.SerialNumber         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $obj | Add-Member Noteproperty ProductKey -value $productkey         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $obj         <br />&#160;&#160;&#160; }         <br />}</span></p>    <p><span style="font-family: courier new">Get-WindowsKey</span></p> </blockquote>  <hr />  <h1>Prepare the USB drive</h1>  <ul>   <li>Download <a href="https://msdn.microsoft.com/en-gb/subscriptions/downloads/#searchTerm=windows%2010%20(multiple%20editions)&amp;ProductFamilyId=0&amp;Languages=en&amp;PageSize=10&amp;PageIndex=0&amp;FileId=0" target="_blank">latest Windows 10 ISO</a> – look for “Windows 10 (Multiple Editions) (x64) - DVD (English)” </li>    <li>Download <a href="https://techtablets.com/teclast-x98-pro/downloads/" target="_blank">Latest Techlast W10 drivers</a> (22 October 2015) </li> </ul>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/0407.image_7BCFBD99.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/0407.image_5F00_7BCFBD99.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/5040.image_thumb_48FFB725.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/5040.image_5F00_thumb_5F00_48FFB725.png" width="244" height="136" /></a></p>  <ul>   <li>Prepare the USB flash drive. Insert your usb drive in your USB port, open command prompt and type: </li> </ul>  <blockquote>   <p><span style="font-family: courier new">diskpart        <br />&#160; list disk         <br />&#160; select disk <span style="background-color: #ffff00">&lt;disk number&gt;</span>         <br />&#160; clean         <br />&#160; create partition primary         <br />&#160; format quick fs=fat32 label=&quot;<strong>WINPE</strong>&quot;         <br />&#160; exit</span></p> </blockquote>  <ul>   <li><span style="background-color: #ffff00"><strong>VERY IMPORTANT</strong></span><span style="background-color: #ffffff"> do not change the label name</span> </li>    <li>Copy windows 10 setup files from the .iso to the usb flash drive </li>    <li>Extract files downloaded from Teclast (see above) in a folder on the USB flash drive </li> </ul>  <p align="center"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/2158.image_19449F57.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/2158.image_5F00_19449F57.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/2746.image_thumb_78BD5FA4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/2746.image_5F00_thumb_5F00_78BD5FA4.png" width="244" height="84" /></a></p>  <h1>Setup Windows</h1>  <p>Plug keyboard, mouse and USB flash drive in the USB HUB</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/2043.WP_20151213_10_24_04_Pro_6D27A265.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/2043.WP_5F00_20151213_5F00_10_5F00_24_5F00_04_5F00_Pro_5F00_6D27A265.jpg"><img title="WP_20151213_10_24_04_Pro" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="WP_20151213_10_24_04_Pro" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/4237.WP_20151213_10_24_04_Pro_thumb_63CE6DE2.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/4237.WP_5F00_20151213_5F00_10_5F00_24_5F00_04_5F00_Pro_5F00_thumb_5F00_63CE6DE2.jpg" width="244" height="139" /></a></p>  <p>Turn on the tablet while repeatedly press <strong><span style="background-color: #ffff00">F7 key</span></strong></p>  <p>Select USB key as boot device</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/6266.WP_20151213_14_01_20_Pro_7F06C6E3.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/6266.WP_5F00_20151213_5F00_14_5F00_01_5F00_20_5F00_Pro_5F00_7F06C6E3.jpg"><img title="WP_20151213_14_01_20_Pro" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="WP_20151213_14_01_20_Pro" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/1258.WP_20151213_14_01_20_Pro_thumb_39EDF9AD.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/1258.WP_5F00_20151213_5F00_14_5F00_01_5F00_20_5F00_Pro_5F00_thumb_5F00_39EDF9AD.jpg" width="139" height="244" /></a></p>  <p>Select Language/Keyboard</p>  <p>Click “Install Now”</p>  <p>Select “Custom Install”</p>  <p>You should see many partitions…</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/2553.WP_20151213_14_06_44_Pro_5C458F26.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/2553.WP_5F00_20151213_5F00_14_5F00_06_5F00_44_5F00_Pro_5F00_5C458F26.jpg"><img title="WP_20151213_14_06_44_Pro" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="WP_20151213_14_06_44_Pro" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/3581.WP_20151213_14_06_44_Pro_thumb_6BE82AE8.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/3581.WP_5F00_20151213_5F00_14_5F00_06_5F00_44_5F00_Pro_5F00_thumb_5F00_6BE82AE8.jpg" width="244" height="244" /></a></p>  <p>Remove them all</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/2211.WP_20151213_14_10_51_Pro_273B90A7.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/2211.WP_5F00_20151213_5F00_14_5F00_10_5F00_51_5F00_Pro_5F00_273B90A7.jpg"><img title="WP_20151213_14_10_51_Pro" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="WP_20151213_14_10_51_Pro" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/0755.WP_20151213_14_10_51_Pro_thumb_21ECA9F6.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/0755.WP_5F00_20151213_5F00_14_5F00_10_5F00_51_5F00_Pro_5F00_thumb_5F00_21ECA9F6.jpg" width="244" height="244" /></a></p>  <p>Create new partition</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/7457.WP_20151213_14_11_44_Pro_1656ECB7.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/7457.WP_5F00_20151213_5F00_14_5F00_11_5F00_44_5F00_Pro_5F00_1656ECB7.jpg"><img title="WP_20151213_14_11_44_Pro" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="WP_20151213_14_11_44_Pro" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/5126.WP_20151213_14_11_44_Pro_thumb_34380169.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/5126.WP_5F00_20151213_5F00_14_5F00_11_5F00_44_5F00_Pro_5F00_thumb_5F00_34380169.jpg" width="244" height="244" /></a></p>  <p>Start installation</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/0654.WP_20151213_14_12_01_Pro_13B0C1B7.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/0654.WP_5F00_20151213_5F00_14_5F00_12_5F00_01_5F00_Pro_5F00_13B0C1B7.jpg"><img title="WP_20151213_14_12_01_Pro" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="WP_20151213_14_12_01_Pro" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/1682.WP_20151213_14_12_01_Pro_thumb_3844DFEC.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/1682.WP_5F00_20151213_5F00_14_5F00_12_5F00_01_5F00_Pro_5F00_thumb_5F00_3844DFEC.jpg" width="244" height="244" /></a></p>  <h1>Setup Teclast Drivers</h1>  <p>Once finished the installation, the tablet is still a “poor pc with a super high resolution display”:-) this means, no wifi, no bluetooth, no motions sensor, no TOUCH and so on.</p>  <p>Thanks to Keyboard and Mouse, you can right click on start button, and open Device Manager.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/0728.WP_20151213_14_40_37_Pro_739845AA.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/0728.WP_5F00_20151213_5F00_14_5F00_40_5F00_37_5F00_Pro_5F00_739845AA.jpg"><img title="WP_20151213_14_40_37_Pro" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="WP_20151213_14_40_37_Pro" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/3276.WP_20151213_14_40_37_Pro_thumb_67965576.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/3276.WP_5F00_20151213_5F00_14_5F00_40_5F00_37_5F00_Pro_5F00_thumb_5F00_67965576.jpg" width="139" height="244" /></a></p>  <p>&#160;</p>  <p>You will find tons of “unknown devices”. No problem, <strong>for each</strong> of those, Right click and select “update driver software…”:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/7624.WP_20151213_14_43_46_Pro_2E13457F.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/7624.WP_5F00_20151213_5F00_14_5F00_43_5F00_46_5F00_Pro_5F00_2E13457F.jpg"><img title="WP_20151213_14_43_46_Pro" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="WP_20151213_14_43_46_Pro" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/4186.WP_20151213_14_43_46_Pro_thumb_049F043F.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/4186.WP_5F00_20151213_5F00_14_5F00_43_5F00_46_5F00_Pro_5F00_thumb_5F00_049F043F.jpg" width="244" height="244" /></a></p>  <p>Select “Browse my computer for driver software”</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/1031.WP_20151213_14_44_07_Pro_0DFAC973.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/1031.WP_5F00_20151213_5F00_14_5F00_44_5F00_07_5F00_Pro_5F00_0DFAC973.jpg"><img title="WP_20151213_14_44_07_Pro" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="WP_20151213_14_44_07_Pro" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/2772.WP_20151213_14_44_07_Pro_thumb_446B7B75.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/2772.WP_5F00_20151213_5F00_14_5F00_44_5F00_07_5F00_Pro_5F00_thumb_5F00_446B7B75.jpg" width="240" height="240" /></a></p>  <p>Select the forder, on the USB flash drive where you have pied Teclast’s software</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/3487.WP_20151213_14_44_13_Pro_23E43BC3.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/3487.WP_5F00_20151213_5F00_14_5F00_44_5F00_13_5F00_Pro_5F00_23E43BC3.jpg"><img title="WP_20151213_14_44_13_Pro" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="WP_20151213_14_44_13_Pro" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/7245.WP_20151213_14_44_13_Pro_thumb_6C9DB487.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/7245.WP_5F00_20151213_5F00_14_5F00_44_5F00_13_5F00_Pro_5F00_thumb_5F00_6C9DB487.jpg" width="244" height="244" /></a></p>  <p>&#160;</p>  <h1>Fix Touch</h1>  <p>At the end of drivers installation, the touch still will not work.</p>  <p>You must copy the file <strong>touchsetting.gt</strong> (from root of the Teclast driver’s folder) to <strong>c:\windows\inf </strong></p>  <p>Restart the laptop and the all should work.</p>  <h1>UPDATE: Camera Touch driver problem</h1>  <p>If the Camera Driver included in teclast’s zip file doesn’t install, try with the one you find here: <a href="https://drive.google.com/file/d/0BzbYIaUEtrV7aVJkdGYwb3lGdUk/view?usp=sharing">https://drive.google.com/file/d/0BzbYIaUEtrV7aVJkdGYwb3lGdUk/view?usp=sharing</a>&#160;</p>  <p>more information in the following thread: <a title="https://techtablets.com/forum/topic/help-isp-camera-device-missing-driver/#post-14097" href="https://techtablets.com/forum/topic/help-isp-camera-device-missing-driver/#post-14097">https://techtablets.com/forum/topic/help-isp-camera-device-missing-driver/#post-14097</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Analyze User Behavior in Your Windows/Windows Phone App with Google Analytics</title>
      <link>https://docs.microsoft.com/archive/blogs/nicold/analyze-user-behavior-in-your-windowswindows-phone-app-with-google-analytics</link>
      <pubDate>Tue, 14 Jul 2015 08:17:26 GMT</pubDate>
      <dc:creator><![CDATA[Nico LD]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/nicold/2015/07/14/analyze-user-behavior-in-your-windowswindows-phone-app-with-google-analytics/</guid>
      <description><![CDATA[&#160;  My article on MSDN Magazine is out!  “App development is by definition an iterative process,...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>My article on MSDN Magazine is out!</p>  <p>“<em>App development is by definition an iterative process, so you’ll want to understand, in the shortest possible time, how your app is used and how a new version or feature may impact user behavior. How much is a feature really used? What is the user behavior on a specific page? How much time does a user spend to accomplish a specific task? What are the most common hardware configurations? What’s going on when a crash happens? How successful are trial versions and in-app purchases? Do your users run the app offline? These are only some of the questions a telemetry system can answer.</em></p> <em></em>  <p><em>In this article, I’ll focus on Google Analytics, because it’s one of the most widely used providers on other platforms, including the Web, and it’s a great choice if you’ve already instrumented a Web site with Google and want to use the same account for apps. I’ll describe how to collect telemetry information with Google Analytics, and analyze the collected data, such as installed app versions, geographic distribution, and user behaviors, and how to perform an A/B Testing.</em>”</p>  <p><a title="https://msdn.microsoft.com/en-us/magazine/mt238405" href="https://msdn.microsoft.com/en-us/magazine/mt238405">https://msdn.microsoft.com/en-us/magazine/mt238405</a></p>]]></content:encoded>
    </item>
    <item>
      <title>NicolTIP#031: Toggle Internet Explorer proxy via powershell</title>
      <link>https://docs.microsoft.com/archive/blogs/nicold/nicoltip031-toggle-internet-explorer-proxy-via-powershell</link>
      <pubDate>Thu, 14 Nov 2013 02:05:25 GMT</pubDate>
      <dc:creator><![CDATA[Nico LD]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/nicold/2013/11/14/nicoltip031-toggle-internet-explorer-proxy-via-powershell/</guid>
      <description><![CDATA[The following powershell script toggles the Internet Explorer proxy status between the following...]]></description>
      <content:encoded><![CDATA[<p>The following powershell script toggles the Internet Explorer proxy status between the following values:</p>  <ul>   <li>Automatically detect settings</li>    <li>Explicit Proxy Server</li> </ul>  <p>as shown in the following screenshots:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/3603.image_6E465471.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/3603.image_5F00_6E465471.png"><img title="image" style="display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/7774.image_thumb_58818D76.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/7774.image_5F00_thumb_5F00_58818D76.png" width="244" height="218" /></a>&#160;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/5164.image_1E94DB3B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/5164.image_5F00_1E94DB3B.png"><img title="image" style="margin: 0px; display: inline; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/49/62/metablogapi/1727.image_thumb_3C09BCF8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-49-62-metablogapi/1727.image_5F00_thumb_5F00_3C09BCF8.png" width="244" height="215" /></a></p>  <p>remember that after executing the script, Internet Explorer must be <strong>restarted</strong>.</p>  <p>this script is a widely based on the work of the following guys (thank you!):</p>  <ul>   <li><a href="https://blogs.msdn.com/b/aymerics_blog/archive/2013/05/18/scripting-toggle-proxy-server-in-ie-settings-with-powershell.aspx">Aymeric Mouillé</a></li>    <li><a href="https://gist.github.com/ReubenBond/1387620">ReubenBond</a></li> </ul>  <p>I tested this script with Internet Explorer 11 on Windows 8.1, but I think that is shoud work with previous versions too…</p>    <p><font face="Courier New"># This function toggle between the following Internet Explorer Settings     <br /> # Explicit Proxy Disabled and automatically detect proxy set to ON      <br /> # Explicit proxy Enabled and automatically detect proxy set to OFF</font></p> <font face="Courier New"></font>  <p><font face="Courier New">#provide your proxy here     <br /></font><font face="Courier New">$proxyServerToDefine = <strong><font style="background-color: rgb(255, 255, 0);">&quot;99.99.99.99:80&quot;</font></strong></font></p> <font face="Courier New"></font>  <p><font face="Courier New">function Set-AutomaticallyDetectProxySettings ($enable)     <br /> {      <br />&#160;&#160;&#160; # Read connection settings from Internet Explorer.      <br />&#160;&#160;&#160; $regKeyPath = &quot;HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\&quot;      <br />&#160;&#160;&#160; $conSet = $(Get-ItemProperty $regKeyPath).DefaultConnectionSettings      <br />&#160; <br />&#160;&#160;&#160; # Index into DefaultConnectionSettings where the relevant flag resides.      <br />&#160;&#160;&#160; $flagIndex = 8      <br />&#160; <br />&#160;&#160;&#160; # Bit inside the relevant flag which indicates whether or not to enable automatically detect proxy settings.      <br />&#160;&#160;&#160; $autoProxyFlag = 8      <br />&#160; <br />&#160;&#160;&#160; if ($enable)      <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($($conSet[$flagIndex] -band $autoProxyFlag) -eq $autoProxyFlag)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; else      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Write-Host &quot;Enabling 'Automatically detect proxy settings'.&quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $conSet[$flagIndex] = $conSet[$flagIndex] -bor $autoProxyFlag      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $conSet[4]++      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Set-ItemProperty -Path $regKeyPath -Name DefaultConnectionSettings -Value $conSet      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160; }      <br />&#160;&#160;&#160; else      <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($($conSet[$flagIndex] -band $autoProxyFlag) -eq $autoProxyFlag)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; # 'Automatically detect proxy settings' was enabled, adding one disables it.      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Write-Host &quot;Disabling 'Automatically detect proxy settings'.&quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $mask = -bnot $autoProxyFlag      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $conSet[$flagIndex] = $conSet[$flagIndex] -band $mask      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $conSet[4]++      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Set-ItemProperty -Path $regKeyPath -Name DefaultConnectionSettings -Value $conSet      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160; }</font></p> <font face="Courier New"></font>  <p><font face="Courier New">&#160;&#160;&#160;&#160; $conSet = $(Get-ItemProperty $regKeyPath).DefaultConnectionSettings     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($($conSet[$flagIndex] -band $autoProxyFlag) -ne $autoProxyFlag)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Write-Host &quot;'Automatically detect proxy settings' is disabled.&quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Write-Host &quot;'Automatically detect proxy settings' is enabled.&quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br /> }</font></p> <font face="Courier New"></font>  <p><font face="Courier New">$regKey=&quot;HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings&quot;     <br /> $proxyServer = &quot;&quot;      <br /> Write-Host &quot;Retrieve the proxy server ...&quot;      <br /> $proxyServer = Get-ItemProperty -path $regKey ProxyServer -ErrorAction SilentlyContinue      <br /> Write-Host $proxyServer      <br />if([string]::IsNullOrEmpty($proxyServer))      <br /> {      <br />&#160;&#160;&#160; Write-Host &quot;Proxy is actually disabled&quot;      <br />&#160;&#160;&#160; Set-AutomaticallyDetectProxySettings ($false)      <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; Set-ItemProperty -path $regKey ProxyEnable -value 1      <br />&#160;&#160;&#160; Set-ItemProperty -path $regKey ProxyServer -value $proxyServerToDefine      <br />&#160;&#160;&#160; Write-Host &quot;Proxy is now enabled&quot;      <br /> }      <br /> else      <br /> {      <br />&#160;&#160;&#160; Write-Host &quot;Proxy is actually enabled&quot;      <br />&#160;&#160;&#160; Set-AutomaticallyDetectProxySettings ($true)</font></p> <font face="Courier New"></font>  <p><font face="Courier New">&#160;&#160;&#160; Set-ItemProperty -path $regKey ProxyEnable -value 0     <br />&#160;&#160;&#160; Remove-ItemProperty -path $regKey -name ProxyServer      <br />&#160;&#160;&#160; Write-Host &quot;Proxy is now disabled&quot;      <br /> }</font></p>]]></content:encoded>
    </item>
  </channel>
</rss>