Showing posts with label App Development. Show all posts
Showing posts with label App Development. Show all posts

AdSenseAccountStats App Reborn As AdsAccountStats - Finally

Is there a Windows app that can quickly show you the key metrics for your Google AdSense account?



Ah yes, wait a minute, there was this app called AdSenseAccountStats...  what happened to it again?Just kidding, check this post from a while back for an explanation why I had to pull it from the Microsoft Store.

AdSenseAccountStats Is Back - With A New Name


As mentioned in the previous post, I ended up simply renaming the app.  There is a bit of a process to step through, but luckily one can always find decent Microsoft knowledge articles on the interweb. If you are interested, check this blog post from the Windows App Consult Team.

In simple terms, follow these high level steps:

  1. Reserve new app name in the developer dashboard
  2. Update your manifest and app package, logos etc
  3. Create new store packages
  4. Create new submission and upload new packages
  5. Update your store listing details in the new submission
  6. Submit to store
  7. When approved and published, delete old app name
Refer to the above mentioned blog post for exact steps.  They all worked as described, although the 3rd step - creating new store packages - gave me some grief.   I experienced errors when building the release packages, complaining about the Display Name in the appxmanifest file.

The solution in the end was to re-create the package.xml file and re-associate the app with the Store, picking the new name (it eventually was visible and selectable in Visual Studio).  It did take a few attempts to get this right, but eventually came good.

Goodbye AdSenseAccountStats - Hello AdsAccountStats


Following this process should ensure that you don't lose the linkage of your app/packages and your app install base.  It is important to increment your version so that older packages will be deleted and apps updated to reflect the name name.

What next?  Go and get the app from the Microsoft Store of course 😀 if you don't have it already.  For now, there is no new or additional functionality, but when time permits there are a couple of improvements I would like to make and features to add.

Until then, enjoy the app once again as it stands.

MB.

AdSense Account Stats App Temporarily Unavailable in Microsoft Store


What happened to the AdSense Account Stats App in the Microsoft Store?


A couple of weeks ago I was notified by Microsoft that a third party agent working on behalf of Google has lodged a claim that the title of my AdSense Account Stats App in the Microsoft Store is infringing on a Google owned trademark.

The actual app title is AdSenseAccountStats, and I guess that has the word AdSense in it.  AdSense of course is indeed a Google owned trademark registered in the US, and quite possibly in many other countries.  Doing the right thing, I immediately removed the app from the store listing and download.

Now, I am neither a lawyer nor an expert with regard to trademarks, but one of the main aspects when it comes to trademark infringements is about potential consumer confusion.  Meaning that consumers might reasonably but incorrectly assume that a product or service is provided by the trademark owner when in reality that is not the case. Another aspect is about commerciality of the product or services infringing on a trademark.

You be the judge - is AdSenseAccountStats confusing?


Certainly a very interesting situation.  My app is of course available for free so there is no commercial benefit.  Additionally, Google do not have their own app in the Microsoft Store that one could use to access one's AdSense account.  On Android and Apple iOS such an official Google AdSense app exists, but not for Windows mobiles. Which incidentally was the key reason I put together the app in the first place.  I wanted an easy way to access my AdSense account from my Windows mobile.

As far as trademark infringement defenses go, there may be three interesting aspects here:
  • No real confusion of customers - title is simply describing what the app's purpose is
  • No commercial gain - the app is available free of charge and currently not ad supported
  • Abandonment of the Windows mobile platform - Google not providing its own app

Either way - Stand by for re-launch


Never mind, I have neither the time nor inclination to have an argument with the third party agent, so I guess I'll just rename the app and re-publish it with a more generic name.  In some ways, it is almost flattering that there is this much interest in an app I created.  It makes for a good story at the pub 😀

It is going to take a little while to relaunch the app however, so don't hold your breath.  There is a specific process to step through before the app can be re-enabled in the store.  Legal forms to submit, authorisation to be obtained, repackaging of the app with a new title (how does AdsAccountStats sound - generic enough?), submission update to the store and ultimately making the app available for download again.

Now if only I had a little spare time to do all the above...   I'll post again once the app is back and available.

'til then, have a great day.

MB

Heads Or Tails UWP App Update 1.2.2 Released



Just a quick post tonight to spruik 😀 the latest release of this handy little app.  In this release I have added a feature to track lifetime stats for heads and tails, as well as the longest streaks for both options.

As silly as it sounds, it is actually quite intriguing to keep tossing that virtual coin and see how over time the numbers for heads and tails even out as they should.  While at other times you can get really long streaks of just heads or just tails, skewing the total number one way or the other.

I can't post with just useless information though, so I will share one tidbit I recently observed that may be of interest to anyone looking to monetize their apps using the Microsoft Advertising Framework.

Low ad fill rates?  There may be a reason...

When I created the new Lifetime Stats page in the app and added a new ad unit, I accidentally selected a COPPA (Children's Online Privacy Protection Act) compliance rating that indicated the app was directed at children under 13 years of age.  This of course is not the case - it is for general consumption for young and old.

However, the learning is that the COPPA compliance rating for the one ad actually applies to all ads for the one app.  This then changes the ad serving algorithms that Microsoft applies for the app and all its ad units. In return, my ad fill rate went south...

By way of explanation Microsoft will only serve non-targeted ads to apps that are directed at Children under 13 years of age.

At this point I need to stress that you absolutely must select the appropriate COPPA compliance setting for your app.  At no point should ad fill rate considerations influence your declaration.  Just do the right thing, okay?

What's next for this app?

It was initially just a learning piece for myself as to how the Microsoft Advertising Framework actually works.  See this recent post if you want to read about it a bit more.

But now I'm actually thinking of putting in a feature that will aggregate data from all users across the world, by country, and then display it back in the app as a sort of "World Cup of Coin Toss" ladder.  Why, you ask?  Just for fun really.  And it could be an interesting learning on how to create the web APIs and database backend required for such a feature.

Anyway, feel free to comment if you like the idea.  Not much spare time at the moment but with enough encouragement it might just happen one day 😀

Get it from Microsoft

Hope you enjoyed the post

MB



Heads Or Tails UWP App - Sample For Using Microsoft Advertising AdUnits To Monetize Your Apps

A Quick Sample App For Monetizing Apps With Microsoft Advertising AdUnits


Just a quick post in case anyone is wondering how to monetize their UWP apps using Microsoft's Advertising framework.

The good news? I found it to be very simple and straight forward, although there are a couple of caveats to be aware of.

It's Easy - Let's get started


First, log into your Windows Dev Center account. On the left hand navigation bar click on Monetize - In-app ads.  Then click on the Create ad unit button.  Fill in a handful of self explanatory parameters for your new ad unit, and click the Create ad unit button to save.  Congratulation, you have just created your first live AdUnit.



Download and install the Microsoft Advertising SDK for XAML


Grab the SDK from the Microsoft web site, and run the installer.  Once done, open up your app's project in Visual Studio and add a Reference to the Microsoft Advertising SDK for XAML. To do this right click References - Add Reference - Universal Windows - Extensions.  Tick the box for the SDK and click OK.

Bake your shiny new ad unit into your UWP XAML App


This step is easy.  But don't be tempted to embed your live ad unit while still developing/debugging your app.  It is against Microsoft policy to run live ad units in the debugger and I am pretty sure they would not be pleased - so just don't do it.

Instead, use a test ad unit. Microsoft thankfully provide such a test ad unit with generic IDs.  So the XAML will look something like this:

  xmlns:UI="using:Microsoft.Advertising.WinRT.UI"

  <!-- Test AdControl -->
  <UI:AdControl
      ApplicationId="3f83fe91-d6be-434d-a0ae-7351c5a997f1"
      AdUnitId="test"
      Height="50"
      Width="320"
      Margin="0,20,0,20"/>

The key pieces here are the using: statement referencing Microsoft.Advertising.WinRT.UI, and the ApplicationId and AdUnitId tags. The values here are the generic test ones which you can use exactly as they are. These will tell the Microsoft Advertising framework to serve up test ads so you can ensure it all works.

For mobile apps, there are a couple of banner sizes that are recommended specifically, as they work best.  I am relatively sure you can use any of the approved sizes, but maybe best stick to the recommended ones for Windows Phone apps.

Voila, you are ready to earn money with your App - Almost, anyway


Pretty close...   A couple of extra steps are required first. Once you are happy with your app and you are ready to submit it to the Microsoft Store, change the XAML for your AdControl to use live ApplicationID and AdUnitId tags.  Where do you get these from you might ask?  Aha, since you paid attention to this post, you know that you can get the live Id tags from your Windows Dev Center, right?

Put the live Id tags into your app, and then follow the standard processes to package and submit the app to the Microsoft Store.  Visual Studio makes this very easy, and there is excellent documentation available from Microsoft on the whole end to end process.

Once your submission is fully approved, your app will be available to customers for download, ready for you to start making money.

Wrapping Up - Grab Heads-Or-Tails app from the Microsoft Store


Hope you enjoyed this post.  Any questions just leave a comment or send me an email.

Oh, and if you feel like it, go grab the app from the Store and use it to help you make those tricky decisions in life - after all, it's a tricky, age old question:   Heads Or Tails?

Cheers

MB


Further Information


Monetize your App with Ads - Windows Developer Documentation




To Splunk or not to Splunk - Either Way Listen to Your Machine Data


Listen to your Machine Data. Yes, Do.

Machine data and log analytics is all the rage these days, but should it be, and why should you invest to gather, centralise and analyse something as boring and mundane as machine data and logs?

Structured, Semi-Structured and Unstructured

We are used to structured data, and storing such in relational databases and more recently in file and blob based data stores. This kind of data has always been interesting, and used in a business and application context. However, today we are starting to latch on to the power inherent in semi-structured and unstructured data. There are a number of innovative things we can do if we index, store, correlate and analyse all kinds of machine generated data. This will only get more interesting with the proliferation of IoT devices gathering telemetry data.

So what can you do with Machine Data and Logs?

Well, there is no definitive list, and really it's quite open to imagination. Data rules the world. Data driven businesses with new business models are popping up everywhere. In short, data has currency.

For the purpose of this post, let's focus on a common and popular use case in Digital/IT making use of machine and log data in an IT Operations context. Leveraging and mining data to improve IT service delivery, availability and performance makes sense, and adds to an IT department's capability and service offering.

Drivers for IT Ops Analytics

Through correlation and analysis of all our machine data we may be able to
  • proactively identify issues
  • predict time and point of potential future failures
  • pinpoint root cause and reduce mean time to restore
  • reduce cost through smarter delivery of services
  • gain insights into environments in new ways to drive digital innovation
to name just a few key points.

So this sounds good, right? We want a piece of that for sure. But how do we go about it, and what kind of tools would we need to deliver such new capabilities for IT Operations Management?

Tools that can help us meet the IT Operations Analytics challenge

The good news is that there are a number of mature products and solutions out there. There are both commercial and open source options readily available. The following table lists a few popular options that are worth looking into in my opinion. It is in no particular order nor an exhaustive list.


Products
Commercial / Open Source
On Premise / Cloud
Commercial
Both
Commercial
Cloud
Commercial
Cloud
Open Source
On Premise
Commercial
Both
Commercial
On Premise


On Premise vs Cloud

Depending on what is important to you and/or your organisation, there is no definite answer on what is the best delivery model for a log analytics solution - on premise or cloud.

Some of the reasons as to why you would go on premise are:
  • Retain full control of your data
  • Flexibility of customisation
  • Data sovereignty, data security and backup concerns
  • Unreliable or low bandwidth links to cloud providers
  • Frequent need to bring back data on premise, egress costs
On the other hand, most of the above cloud log analytics providers are pretty mature, highly available and secure by design these days. In other words, they are Enterprise ready. And of course there is the promise of infinite capacity, so you can ingest data to your heart's content and not have to worry about investing into costly, capital intensive on premise infrastructure.

So unless you are facing major regulatory or compliance hurdles, I'd suggest to give the cloud a go. But do your homework on your projected data volumes and associated costs to avoid bill shock and make sure going into the cloud is indeed the most cost effective path for your business. Major organisations may be able to build their own infrastructure and run at lesser cost than cloud providers.

The Wrap

Hopefully the above thoughts have provided some hints and pointers to get you started on your log analytics journey. Personally, I think the potential is significant, and investing in this space is the right thing to do.

Make sure you have people who are interested in using the technology creatively. Define your use cases, then actively get answers to your burning questions by driving value through analysis and visualisation of your existing log and machine data.

Ah yes, to Splunk or not to Splunk…


Cheers

MB

AdSense Account Stats UWP App Released

Introducing AdSenseAccountStats App

For all those AdSense account owners with Windows mobiles or tablets out there, I recently released a new UWP app that may come in handy. This simple app will allow you to quickly and easily check up on your AdSense performance.

Watch your monetization efforts pay off and your earnings grow

After logging in with your AdSense account and authorising the app for read-only access, you can easily see metrics such as:
  • Earnings Clicks, Cost Per Click
  • Page Views, Click Through Rate and RPM
  • Coverage

Code components that make it work

The app simply leverages Google APIs, specifically the AdSense Management API v1.4, and Google OAuth v2 for authentication of the user.  Basically, all calls to the AdSense APIs have to be authenticated or else they won't work.

So the first problem was to tackle Google OAuth v2 for a UWP app.  There are complexities around the Google provided libraries and support for UWP, and I have touched on these in another blog post.

OAuth v2 Authentication

The following code snippet deals with authentication successfully:

            UserCredential credential;
            try
            {
                using (var stream = new FileStream("client_secret.json", FileMode.Open, FileAccess.Read))
                {
                    credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                        GoogleClientSecrets.Load(stream).Secrets,
                        new[] { AdSenseService.Scope.AdsenseReadonly },
                        "user",
                        CancellationToken.None,
                        new PasswordVaultDataStore()
                        );
                }
            }
            catch (UwpCodeReceiver.AuthenticateException ex)
            {
                // Login failed or authorisation not granted
                credential = null;
                await LoginFailed(ex);
            }
            catch (Exception ex)
            {
                credential = null;
                await SomethingWrong(ex);
            }

Creating a client service for your API calls

Once the user has logged on and authenticated their AdSense account, and granted permissions to the app so it can access the user's AdSense details, you then create a client service to use for your API calls.  Pass the credential object created by the code above to the http initializer.

            var adSenseService = new AdSenseService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName = "AdSense Accounts Stats",
            });

Setting up and executing an API request

After the user has logged on and allowed access for the app, the next piece is to construct a valid API request, execute it and handle the response in a meaningful way.  This can be achieved along the following lines:

            var earningsRequest = adSenseService.Reports.Generate(startString, endString);
            earningsRequest.Dimension = dimensionString;
            earningsRequest.UseTimezoneReporting = true;
            earningsRequest.Metric = new List<string>{ "earnings","page_views","individual_ad_impressions","clicks",
                                                "page_views_ctr","individual_ad_impressions_ctr",
                                                "page_views_rpm","individual_ad_impressions_rpm","cost_per_click",
                                                "ad_requests_coverage" };

            var earningsResponse = await earningsRequest.ExecuteAsync();

Once you have that response object, you can use it in any way you see fit, for example use its member items as a list source etc.

Hope you enjoyed this post and if you like go grab the app from the Microsoft Store.

Cheers

MB



Google OAuth2 for UWP C# XAML Apps Example

I have previously posted on consuming Google YouTube APIs in UWP C# XAML apps, showing how to consume Google APIs using the API key technique for authentication.

That technique works well, but has its drawbacks.  Mainly, you can't access any of the non-public user specific information that the APIs expose.  In other words, to get to the juicy bits you need to make authenticated Google API calls.  To do that, you need to work out Google OAuth2 authorisation flows.

Now, that's easier said than done if you are a part time hack like myself, and not a serious developer.  Through lack of skill I need to rely on the dotnet API libraries that Google kindly provides.  There are a good number of blog posts out there that detail the API key method, but not many that have a working example for using Google OAuth2 as per Google's developers API reference samples..

This is where this post kicks in.  But it also comes with a disclaimer (see below).  The following code snippet is an actual working example for a Google API OAuth2 authentication flow.  It uses the Google provided libraries which can readily be downloaded from Nuget and implemented in your project in Visual Studio.  Just use the Nuget Package Manager and search available packages for Google.Apis.

The magic sauce here is that the good folk at Google have fixed the OAuth flow for UWP C# only in a beta release of their dotnet libraries.  Specifically version 1.31.0 beta 01.  In the package manager, make sure to tick the box to include pre-releases, or else you won't get the beta on the list of available packages.


And here is the disclaimer... the mainstream release - currently up to 1.32.0 - does NOT work.  The code will build but fail at run time.

Enough said.  Following is the example code that will manage your Google OAuth2 authentication flow for you.  It prompts the user to log in with a Google account, authorise our example App, access the user's AdSense account, grab a list of payments for the account and finally display the results as the items source on a XAML ListView. Sounds tough?  Not really, just a few lines of code 😃

Of course, instead of accessing the AdSense Management API we could access the YouTube Data API or any of the other Google APIs presumably. I have only tested AdSense and YouTube, though.

     private async void PopulateAdsenseList()
     {
         UserCredential credential;
         using (var stream = new FileStream("client_secret.json", FileMode.Open, FileAccess.Read))
         {
             credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                 GoogleClientSecrets.Load(stream).Secrets,
                 new[] { AdSenseService.Scope.AdsenseReadonly },
                 "user",
                 CancellationToken.None
                 );
         }
         var adSenseService = new AdSenseService(new BaseClientService.Initializer()
         {
             HttpClientInitializer = credential,
             ApplicationName = "Your App Name",
         });
         var myPayments = adSenseService.Payments.List().Execute();
         MyList.ItemsSource = myPayments.Items;
     }

Of course you will have to have a XAML page with a ListView (in this case called "MyList") to display the retrieved list of payments.

Just remember, don't be tempted to upgrade your Google.Api Nuget packages.  Stick with the 1.31.0. beta 01 release, or your code will break!  We'll have to wait until the devs at Google fix the libraries properly for UWP support.

Hopefully the above makes sense and you enjoyed reading this post.  If you have any questions or comments, why not drop me a line via email or comment below.

Cheers

MB


Visual Studio Team Services - 5 Good Reasons that make it a Great DevOps Toolkit for Everyone

Microsoft Visual Studio Team Services - A great DevOps Toolkit for Agile Teams

Really, I hear you ask? Why is that? Are there not more established players with better tools in the market? Well, let's give it a bit of context...

Traditionally we would run projects at work the old fashioned way, employing a traditional waterfall delivery model. Like everyone else however, we were wondering what all the hype of Agile, Lean, Scrum and goodness-knows-what was all about. You know, all this new age rage that promises to be so much more effective in delivering projects.

Not wanting to miss out, we grabbed the opportunity as soon as a software development centric project rolled along. We decided to challenge ourselves and deliver this one using Agile. But where do you start with all that? Luckily, some of us had some formal yet basic Agile training and with a bit of research and chatting to like minded folk we felt we had a good basis to get going.

We quickly decided that an Agile wall with sticky notes, cards and blutack was not for us, even though I am of the firm opinion that you can effectively manage projects in that fashion. We wanted a tool to help us, as we set out to manage our work items like Epics, Features, Stories and Tasks, needed a Git based repository for our code, and a visual way of reporting our progress.

Looking around for tools, we quickly zeroed in on the Atlassian kit as they are certainly setting the trend in a fragmented DevOps space and appear to have mature offerings that get good reviews. However, we remembered that Microsoft are playing in this space these days with their Visual Studio Team Services (VSTS) product. In fact, Gartner recognises Microsoft as a Leader in their 2017 Magic Quadrant for Enterprise Agile Planning Tools.

So we decided to have a closer look, and here is where it got interesting. VSTS has a freemium pricing model, where small DevOps teams of up to five people can join a VSTS subscription/workspace, and use this for work item management, Git repositories, load tests and other things for free. Continuous Integration and Delivery pipelines can be set up and appear to work well particularly when used in context of Microsoft's Azure cloud services.

But I digress. The purpose of this post was to outline the key reasons why I think it is worthwhile looking at VSTS if you are a small team wanting to get in on the Agile act and you are looking for a tool to help.  So here we go, in no particular order...

Five Good Reasons that make VSTS a great DevOps toolkit

1. Ease of setup and onboarding - get going fast

Just head over the visualstudio.com/team-services and sign up for free to create your workspace. Then simply create a New Project, give it a Name and Description, select your Version Control format as Git, and your Work Item Process methodology as Agile.


Voila, this will give you a new project shell, with a dashboard for visualisation, a git repository to manage your code, and a work item management area with initial iterations configure.  There is a bit more setting up to do, but it is all very intuitive and within an hour or two you will have everything exactly as you need it to start managing your project

2. It's free for up to 5 people

Yes, free.  Free private Git repos, work tracking, load testing (to a degree), CI and CD pipelines.  And if you have a MSDN subscription by chance, you don't count against the limit of 5 free people but can access it in addition.  Free stakeholder access also included

3. Seamless Git integration with Visual Studio

If you develop in Visual Studio, VSTS will seamlessly integrate.  Push and pull / synch your code to the Git repo online.  Never leave your IDE.

4. Collaborative work item management

Easily manage your backlog, plan your sprints and work collaboratively using mentions to easily keep team members up to date on progress

5. Visually track progress

Sprint burn down, cumulative flow and team velocity charts come out of the box and together with your backlog and task board views allow you to keep track of what is happening at any point during your project


VSTS really served us well and was simple and intuitive to use.  We delivered the full scope of the project right on time and budget.  Reporting and tracking was a breeze thanks to the built in charts that came right out of the box.  And did I mention it did not cost us a cent to get the tool? \

I have to admit I am a bit of a fan - not often you get a useful solution like this for free.  Give it a shot if you are out there wondering about Agile DevOps tooling to use in your next project, and let me know how you went.

Cheers

MB


Some further reading:

Visual Studio Team Services
Atlassian






Consuming Google APIs In UWP XAML / C# Apps

Google APIs and UWP - How does it all work?

Out of curiosity and for my own education, I recently started to look into Google APIs and how a Universal Windows Platform (UWP) App could consume such web APIs.  Specifically, I wanted to hook the YouTube API to easily get access to basic YouTube channel statistic on my Windows phone.

But how to get started?  As usual one turns to Google for research, and I found there was plenty of material available to get started.

I quickly decided that I wanted to have a crack at actually creating a functional app rather than just do some dry research.  After all, applying the knowledge helps with understanding and retention, right? 

Furthermore, I was curious how hard it would be to actually then publish such a working app in the Windows store.  So I set about finding out, but that will be another post in itself.

Accessing Google APIs - Authentication is Key

There is a lot of material on the web on how to access the Google provided web APIs.  Fundamentally, calls to the Google APIs have to be authenticated. And as far as I can see, there are two options:
  1. Use an API Key
  2. Use OAuth2 Authentication
The first method is simple enough to get going, the second one not so easy when you are dealing with a UWP XAML / C# app.  The main reason for that is that the Google code samples and libraries for OAuth2 actually don't work for UWP C# yet.  While you can freely download the libraries and the code will successfully build, it actually fails at run time.

Google mentioned they would address this and fix their code libraries down the track, but there is no time frame from what I can gather.

Hence I concentrated on the first method of using an Authentication Key.  To get started set up an account and log into the Google Developers API Console.  Once in, click on Enable API which will land you on the Library page where you can pick which Google API to actually enable/allow.


In my case I selected the YouTube API for my app.

Then click on Credentials on the navigator on the left, followed by the Create Credentials button.  This will create an API Key and pop up a window containing your new key.  Be sure the restrict and secure that key so others can't steal your volume allocation. And of course don't publish that key in public code repositories by accident.


Needless to say the one in this screenshot is just for illustration purposes and no longer exists so don't bother copying it ðŸ˜‰.

Let's Get Coding - Visual Studio and Google Nuget Packages

I'm not a developer, so I'm not going to pretend I know exactly what I am doing, but for the purpose of this educational exercise it was simple enough to get going.

Grab Microsoft Visual Studio - the free Community Edition will do just fine - and start your XAML / C# UWP project.  I cheated and used the newly available UWP WindowsTemplateStudio project to create a basic, Windows Store compliant UWP app.

Next I downloaded the required Google API Nuget packages, in this case Google.Apis.YouTube.V3 and I think Google.Apis.Services.  I then cobbled together a XAML UI and a button to click to fetch and display basic YouTube Channel Statistics.



Next I put some code into the button click event handler in the page's code-behind.  It's along the lines of the following:


        private void button_Click(object sender, RoutedEventArgs e)
        {
            var youtubeService = new YouTubeService(new BaseClientService.Initializer()
            {
                ApiKey = "Your-API-Key-From-Google",
                ApplicationName = "BlazingTMYouTubeViewCounter"
            });

            var channelsListRequest = youtubeService.Channels.List("snippet,statistics");
            channelsListRequest.Id = "UCkW0h_mbdmo0YChc0fzMkQw";

            var channelsListResponse = channelsListRequest.Execute();

            foreach (var channel in channelsListResponse.Items)
            {
                var channelViewCount = channel.Statistics.ViewCount.Value;
                textBox1.Text = Convert.ToString(channelViewCount);
            }

            textBox.Text = this.GetType().ToString();
        }


Now that's nowhere near actually the final working code, but you get the drift. You create a new YouTubeService object (part of the Google API Nuget packages code), and set your ApiKey and optional ApplicationName property.

Then you create YouTubeService.Channels.List request object, set a default channel ID and execute the request.  And lastly you have to process the response and display the required values in the UI.

If you are a serious developer, you are probably laughing by now at my description, but hey that's okay.  This is just for illustration purposes.

In any case, I managed to build a basic UWP XAML / C# app which was working fine on my PC and Lumia 930 Windows mobile.

As mentioned earlier in this post, I actually also went on to publish the app in the Windows Store just to get familiar with the process.  If you are curious, search the Windows Store for an app called YouTubeChannelStats, download and install for fun.  Very basic but it works.

How all that was done will be the subject of another post some time.  Hope you enjoyed this one and feel free to comment and share.

Cheers

MB
Get it from Microsoft

Most Popular Posts