Fixing the Windows IoT Core Dashboard device detection when running Windows on Parallels

Just a short tip: When you are running on a Mac Book (like I do) and use Parallels for all your Windows related stuff, you might run into the problem that the Windows IoT Core Dashboard does not find your Windows IoT Core devices.

If so, the problem often seems to be, that the virtualised Windows machine is unable to scan the network for other devices due to restrictions of the network connection that is shared between your Mac and Windows VM. To solve this, simply change the virtual machine’s network source to a Bridged Network in the Parallels settings. No your VM should be able to see the Windows IoT Core device.

Screen Shot 2016-08-20 at 17.20.25

How to upload your UWP app to HockeyApp right

HockeyApp provides a neat and easy to use service for developers to provide apps to their testers and track anonymous usage data, crashes and feedback. As the Windows 10 (UWP) support is still in preview, the documentation on how to provide a Universal Windows App to your testers right is quite poor. So let’s take a look at the easiest way.

The problem

hockeyapplogoTo install a Windows 10 application without the official store but via side-loading, multiple files are needed: The application package, of course and a certificate that the user needs to install previously. Some Windows platforms also need a specific PowerShell Script to install the app. When creating an App Package with Visual Studio, all these files will be generated but HockeyApp only accepts one single file per release to distribute.

Additionally, Windows apps are getting installed differently regarding to the platform. On Windows Desktop systems, the user can simply run the PowerShell Script and follow its instructions. Other platforms like Windows 10 Mobile for example, do not support PowerShell and the user needs to install the certificate and application manually. So in contrast to Android for example, where developers can pack all these into one APK file, Windows developers need to consider different scenarios.

The solution

Unfortunately, the solution to this problem is not very satisfying but it works and is the only way at the moment to target both, Desktop and Mobile with one HockeyApp project. After creating the App Package, pack all its outcomes into one single ZIP file and send this to HockeyApp. Desktop users can simply unzip it and run the PowerShell script, Mobile users have to download a Zipping app first (yep, that really sucks) to unpack the file and can install the certificate and app manually then.

CreateUWPAppPackageFast

The zipping and uploading of the app can completely be done in Visual Studio with the integrated HockeyApp tools. Simply right-click on your project, and select the Distribute App… option. The following dialog guides you through the process.

Please notice that the dialog selects the most recent app package but does not create a package for you! You definitely need to create an App Package on your own, first.

UploadUwpToHockey

Recently I wrote an article for users about how to install a UWP app distributed by HockeyApp that I link in the release notes of all my UWP HockeyApp projects, so that users get a tutorial on how to install it. You can check it out here.

Analyze a photo with Microsoft’s Cognitive Services Vision API on Xamarin.Android

Microsoft’s Cognitive Services are intelligent machine trained APIs that analyzed text, images, videos and more for you in the cloud and sends you back meta information about the provided content. They are free to use until a specific threshold and a nice easy to use thing to integrate in your applications. You can either use classic REST calls or the client SDK (NuGet) if it is available for your platform. I just stumbled on providing the right picture format to the Computer Vision API and decided to write this blog post.

So if you want to get your picture analyzed, you need to give a Stream object to the VisionServiceClient.AnalyzeImageAsync() method. On Android, you mostly work with streams when accessing the file system but not when taking pictures. In these cases you often need to deal with byte[] or Android.Graphics.Bitmap objects. You can convert both to a Stream easily, if you know how:

Converting a byte[] or Bitmap to a Stream

Especially when working with the camera, you might end up with a Bitmap object. You streamify it with the Compress() method, but as you already used the stream once then, you need to “revert” it afterwards (that’s where I stumbled). Otherwise the SDK will throw an exception.

If you already have a byte[] you don’t need the first two lines of the using statement and can create the MemoryStream directly out of it with var stream = new MemoryStream(yourByteArray).
Hope that helps somebody to save time.

How to install an UWP app distributed with HockeyApp

The HockeyApp platform is one of the most popular ways of distributing pre-release software to testers and collect their anonymous usage data, crashes and feedback. As it is quite easy to install Android or iOS apps on your devices, when it comes to Windows things are getting a bit more complicated. So if you are a tester of any Windows 10 app and don’t know how to install it, this article is for you!

What you get

HockeyApp provides you an own bundle for each version of the app. If the developer did his job right, you will get a .zip file from HockeyApp with the following content.

hockeyuwpzipcontent

While you can ignore most of these files, there are three of them that might be important for you. You will learn which one to use on which device in the following sections.

  • APPXBUNDLE File – YourApp.appxbundle – This is the actual application
  • Security Certificate – YourApp.cer – This is the security certificate that your device needs to install
  • Windows PowerShell ScriptAdd-AppDevPackage.ps1 – An installer script for some devices

Installing the app on Windows 10

Classical Windows 10 Desktop systems are the easiest ones to install the app on. Due to you have PowerShell here, you can simple run the installation script Add-AppDevPackage.ps1. Do this by right-clicking on it and selecting Run with PowerShell. Consider, that you will need administrator rights for this.

hockeyuwpzipcontentRunPS

When doing this for the first time, PowerShell might ask you for permission a couple of times. Always answer positively to get your app installed. After a couple of seconds, the script should be completed and your app got installed. Happy testing!

Installing the app on Windows 10 Mobile

If you are running Windows 10 Mobile and want to install the app on a Phone, things are getting a little more complicated. We don’t have PowerShell or any Unzipper App here by default so we need to do the things manually, that the PowerShell script does for us on the desktop.

First, we need to extract the .zip file. Make sure, that you download an app for this that actually extracts the content and not just opens the zip-container. I cannot recommend 8 Zip Lite, which worked well for me. Now open the Files app and navigate you the folder, you extracted the content of the zip-container to. Here you should find the same files as seen above. Unfortunately, the Files app is not exactly brilliant and does not show you the file endings, which is why it might be hard to identify the files.

Tip: Long press on one file to see its symbol. The explanation can be found in the image below. Don’t ask me, why they decided to show black icons on a black background…

appxcertmarked

 

The PowerShell Script is useless for us on phones, so we need to install the certificate and application by hand.

  1. Start with the certificate by clicking on it and follow the instructions.
  2. Once the certificate is installed, you can install the APPXBUNDLE – again by clicking on it. Follow the instructions and wait some seconds.

I am sorry to say that but you won’t get any feedback whether it worked. Just wait approximately 30 seconds and check your app list, if the new app appeared. If not, try installing certificate and app again until it works.

Conclusion

When comparing the process of installing apps from outside the store on Android and iOS with Windows, one can clearly see that Microsoft has to do some work here. While advanced users might be happy with the PowerShell script, sideloading apps in Windows 10 Mobile is a click and pray at the moment. Due to the lack of any feedback it can get very frustrating. Let’s hope Microsoft will catch up here soon…

How to disable Security Warning for untrusted sources in Visual Studio

VSSecurityWarning

Better safe than sorry, no doubt and security is important but sometimes exaggerated care can get annoying. Visual Studio sometimes is a candidate for that in my eyes, especially when asking me if I trust solutions that I created by myself. The warning is absolutely right, you should definately not trust any solution you download from the web and run it on your machine. But I am organizing my code on a network share and that is rason enough for Visual Studio to ask me every time, if I really want to open a project that I created. By myself. In Visual Studio…

If you have similar problems, here it how to disable the warning. Simply head over to the Tools -> Options menu, search for the Projects and Solution cathegory and disable the Warn user when the project location is untrusted settings. No more  “You should only open projects from a trustworthy source” warning for you!

VSSecurityWarningDisableSettings

Xamarin free for everyone – What developers need to know

Microsoft + Xamarin = C#

At //build 2016 conference, Microsoft announced to include Xamarin into their existing offers and make the cross-platform solution free for everyone. Now as Xamarin is part of Visual Studio 2015, some things are changing for developers so let’s take a look at what how the Xamarin ecosystem will transform.

TL;DR: Yes, Xamarin is free. Or at least free of charge for everyone who is elightable for the for the free Visual Studio Community edition or a subscriber of one of the Visual Studio MSDN plans.

 

On Windows, Visual Studio is your choice now so that Xamarin Studio will disappear here but will still be the IDE to work with when using a Mac. Here you will also have access to a free Community edition and a paid Business one, that comes with a Visual Studio subscription and offers additional business features like the superior Visual Studio versions on Windows do. Detailed feature comparision here

 

Oh, and did it mention that Xamarin is open source now?

Pricing

First of all: Yes, it’s true! Xamarin is available free of charge now for almost everyone due to it is not only included into the charged versions of Visual Studio but also into the free Community Edition. The latter has some limitations regarding the commercial usage but might be the right choice for independent developers and small teams.

Of course there are some benefits for paid users that are subscribing the Visual Studio Professional or Enterprise plans. Those have access to the technical support, might get special account for Xamarin University or get access to some special features like the Profiler or Test Recorder IDE add-ins. But the core of Xamarin development is fully included and not restricted in the free subscription. So if you don’t need premium features – no costs for you! Head over to the regarding Xamarin page if you need more detailed information.

Store Xamarin

What about Xamarin Studio?

Yes, I know: Visual Studio everywhere. But what if you are working on a Mac? Bad news first: We won’t see a Mac Version of Visual Studio in the near future. Xamarin Studio is still the way to go, when developing cross-plattform applications in C# on an Apple machine.

Xamarin Studio will retire on Windows due to there is no need for it anymore. You can and should use the free Visual Studio Community edition here. Xamarin Studio will be continued on the Mac only and will be split into two versions: The Community edition will have the same license terms as its Visual Studio brother on Windows and will be the right choice for indie developers, students and small teams. The Xamarin Studio Business edition will have all the features of the Community edition, plus some of the business features that the superior Visual Studio editions will offer. So if you have an existing Visual Studio Professional or Enterprise subscription, you will get Xamarin Studio automatically, if not, stay with the free version.

Additionally, Xamarin Studio is getting some new and advanced features like the ability to read and open UWP projects. Yep sorry, just read and open, no UWP compilation on a Mac at the moment. But hey, it’s a first step in the right direction!

Visual Studio Comparison Chart Xamarin

 

How can I get Xamarin now?

When you start the Visual Studio installer right now, you can opt-in an installation of Xamarin as one of the features to be installed. Of course you can always add Xamarin to your Visual Studio installation later by re-running the installer or via a dedicated installer. On the Mac you can download Xamarin from the Dashboard on the website. When logging into Xamarin Studio the first time, it decides whether it becomes a Community or Business edition, depending on the Visual Studio subscription that is connected with your account.

Open source

Additionally they announced to give the Xamarin code the the community and contribute it to the .NET Foundation as an open source project that can be found on GitHub in the future. With these changes, .NET is now open source and native on every single device, from mobile to desktop to cloud. Of course also Xamarin.Forms is getting open sourced, too.

What about the other Xamarin products?

Over the years Xamarin created more than just a development framework. With several other products like Xamarin University, a high class learning platform or Xamarin Test Cloud, where developers can test their apps on thousands of physical devices they provided great tools for every mobile developer. Xamarin University will include new Microsoft focused lectures on the power of Azure and UWP as well as continuing to offer a first class learning environment for mobile developers. Xamarin Insights, a telemetry framework will join Microsoft’s HockeyApp. Test Cloud will be continued to provide it as a standalone product, where Microsoft will be investing heavily in its future.  The official Xamarin Developer Certification will also continue to exist in the future.

 

I personally really like what’s happing with Xamarin at the moment. I love how Microsoft does not devour it completely but tries to keep the brand alive. Together with Microsoft, they can now offer Xamarin for free and who knows, maybe writing cross-platform applications using C# might be the most normal thing in the future.

Bring your Windows 10 Apps to Xbox One

At Build Conference 2016, Microsoft finally announced that they will open the Xbox One store for your UWP apps in summer. From now on, the developer program for the gaming console is open and we can take a first look at how to bring new or existing Windows 10 apps to Xbox One. I tried it out and will guide you through the first steps.

DevPreviewXbox

Join the Xbox One developer program

To join the preview program for developers you simply need to register for the Windows Insider program with the account that you use on your Xbox One. You will also need a Windows Dev Center account, if you don’t already have one. Afterwards, you can download the Dev Mode Activation app directly from the Xbox store.

Important: If you take already part in any Xbox One Beta program, you will need to leave it first, due to Xbox does not allow two programs at the same time at the moment. This can take up to 48 hours.

Register your console for development

After the download has finished, you can start the application and follow the process to register your console for the development program. It will you provide a code, that you need to enter at the new Windows Dev Center section for Xbox. Once your console got registered there, it will claim for an update that contains the new developer mode. Once it got installed, you can start the Dev Mode Activation app again and switch your console into developer mode.

Connect Visual Studio with your Xbox One

Now you can connect your IDE to it and deploy and debug your app. First, make sure that your console is connected to the same network as your development machine. Start the Dev Home app and pair your console with Visual Studio by clicking the according button. A pairing pin appears, that you will need later.

Once the console is ready for pairing, you can open Visual Studio, create a new Universal Windows project or open an existing one and set a Remote Machine as your target device. After entering the IP address of your Xbox, you will be asked for the pin that your Xbox created recently. Enter it and enjoy your apps and games on Xbox One for the first time.

connectvswithxbox

Advanced debugging features

As you might have noticed while scanning the Dev Home app on your console, you can do a little bit more than just connecting it to Visual Studio. By activating the Remote management, you can access your Xbox One via web browser by entering https://XboxOne:11443 to it. Now you will see a portal where you can get an overview of your console’s performance, manage the installed applications and even take a deeper look at its storage.

May the debug gods be with you and have fun testing your apps on a gaming console. I can’t wait to upload my applications to the Xbox store in summer and am looking forward to see yours there!