A Xamarin wrapper for the ACS USB library for Android



A while back, we were using RFID readers made by ACS.  They make a number of decent readers and we used one of the USB models, ACR1220U, with our bespoke Android tablet.  To communicate to the reader, ACS provides libraries for Windows and Android.  The Android library comes with a .jar file and some sample (but very limited) code.  The demo showed how to connect to the reader, but didn’t have that much for getting information from the reader.

The ACS reader follows the SmartCard standards.  Their library provides the low level access to the reader.  It’s up to the consumer of the library to write the code that actual sends and receives data from the RFID reader.  If you are working with a SmartCard reader, then you’ll need to know how to create APDU packets.  An APDU, application protocol data unit, is the command packet that is sent from the reader to the card, and from the card to the reader.  When you use this reader, your code is responsible for creating and sending the packets.

The logic that I used more or less follows this flow:

  • Reader signals the application that a card has been detected (or no longer detected)
  • Applicate tells the reader to a warm reset of the card
  • Application tells the reader to set the communications protocol for talking to the card
  • Application tells the reader to transmit the APDU command to get the unique identifier (UID) from the card
  • The response from the transmit command will have the UID from the card.

And that’s just to get the UID from a card.  If you are trying to read a NDEF packet, then you have a lot more work to do.  NDEF records are stored differently, depending on what kind of card that you are reading.  If you are using RFID data from cards with the built-in NFC support that Android provides for hardware that comes with the device, you are benefiting by the low level code being handled for you.

For the last .5 decade, we’ve been using Xamarin for our Android coding.  To use the ACS reader, I created a Xamarin wrapper library for their Java library.  It basically takes and embeds the .jar file and provides a nice .NET API to their library.  I then took their sample library and did a more or less straight port from Java to C#.  If you grab that repo from Github, you’ll get the library and and the demo app.  It was created with Visual Studio on Windows, but should work on the Mac.  Should being the code word for “I didn’t do anything that was platform specific, but I didn’t test it on the Mac.”

The results of that wrapper/conversion are up on Github.  You can grab it here. The .jar file that the library is compiled with is included in the repository. It is part of an API kit that should be downloaded from https://www.acs.com.hk/en/mobile-support/. The API kit includes the API documentation in HTML format.

The library does not have the APDU code to get the data from a RFID card.  I do have that code, but at the moment it’s part of some code that I can’t share.  I’ll pull the APDU code from our business code and post it later.  In the meantime, this is the code from the OnStateChange event that gets assigned to the reader.

        public void OnStateChange(int slotNum, int prevState, int currState)
            // If the previous state and the current state are outside the range of allowable
            // values, then assign min/max of the range
            if (prevState < Reader.CardUnknown || prevState > Reader.CardSpecific)
                prevState = Reader.CardSpecific;

            if (currState < Reader.CardUnknown || currState > Reader.CardSpecific)
                currState = Reader.CardUnknown;

            // Create output string
            string outputString = "Slot " + slotNum + ": "
                    + stateStrings[prevState] + " -> "
                    + stateStrings[currState];

            // Log the status change

            // We tapped the card
            if ((prevState == Reader.CardAbsent) && (currState == Reader.CardPresent))
                // We have the right slot - opening the reader generates a spurious StateChange event
                if (slotNum == SlotNumber)
                    // read the card

                    // The APDU (smart card application protocol data unit) byte array to get the UID from the card
                    // Command  | Class | INS | P1 | P2 | Le
                    // Get Data |   FF  | CA  | 00 | 00 | 00
                    var command = new byte[] { 0xFF, 0xCA, 0x00, 0x00, 0x00 };

                    // The byte array to contain the response
                    var response = new byte[300];

                        // In order to set the Get Data command to the card, we need to send a warm reset, followed by setting
                        // the communications protocol.
                        var atr = this.Power(slotNum, Reader.CardWarmReset);

                        this.SetProtocol(slotNum, Reader.ProtocolT0 | Reader.ProtocolT1);

                        // Send the command to the reader
                        var responseLength = this.Transmit(slotNum,
                            command, command.Length, response,

                        // We appear to be getting all 9 bytes of a 7 byte identifier.  Since 9 would be considered a too
                        // large value of 7, we drop the last 2 bytes

                        if ((responseLength > ForcedIdSize) && (ForcedIdSize > 0))
                            responseLength = ForcedIdSize;

                        // If we got a response, process it
                        if (responseLength > 0)
                            // Convert the byte array to a hex string
                            var s = ByteArrayToString(response, responseLength);

                            // Add the scan to the collection and notify any watchers

                            // Notify any watchers
                            LogMsg($"UID: {responseLength} {s}");

                    catch (Java.Lang.Exception e)


This is probably as a good point as any to menton that we no longer use the ACS readers.  While their documentation is obtuse and technical support is non-existent, they do exactly what they are supposed to do.  Which is fine, but it just didn’t mesh up with our needs.

Our use case is for scanning student and driver RFID tags for our Android tablet.  We use an external RFID reader so that the students are scanned as they get on the bus.  Our tablets are securely mounted in cradles, which tends to block RFID readers that are built in to the tablets.  We had the following problems with our use of the ACS readers

  1. The ACS readers are NFC only.  RFID covers a multitude of sins.  NFC is just a subset of that.  Our customers may have RFID cards that use different technologies, like HID PROX or EM400.
  2. The steps needed to get a UID were quick, but not fast.  To get the UID. there needs to be several round trip conversations between the table, the reader, and the card.  If a student getting on the bus didn’t hold the card long enough to the reader, we ended up missing some scans.
  3. The power draw was draining school bus batteries.  The ACS readers are designed to draw power continuously from the USB port.  Because the readers are mounted to the bus, they would be drawing power all the time.  They are radios and there’s a power cost to run those radios.

These issues turned up during our initial deployment.  We found a better solution with the Elatec RFID readers, but the ACS readers are a good solution.  The ACS NFC readers are pretty much the industry standard for external FNC readers.  If I was wiring up and external RFID reader that was connected to a device with AC power, an ACS reader would be the first thing I would consider for the project.

FocusUF or how to turn off the autofocus setting of the LifeCam HD-5000 webcam

Welcome to the FuzzyCam

Why am I out of focus? It’s because I have a Microsoft LfeCam HD-5000 and I’m running Windows 10. The LifeCam HD-5000 webcam is a decent webcam with an annoying feature. The autofocus keeps shifting the focus around if you move your head slightly. It goes in and out of focus and locks in after a second or two.  When you are in a video chat, this can get very annoying (very quickly) for the other viewers. Your face will shift in and out of focus and it’s just a distraction.  Microsoft used to supply drivers for the HD-5000 and it had a control app where you could adjust the focus settings. Since Windows 8, they stopped as the OS directly supported the webcam.

I’m not able to sit motionless while on a webcam. I needed a work around. There is a registry hack that lets you turn off autofocus. I prefer to avoid hacks like that when it’s something that I could code around. So after seeing some stuff on StackOverflow on how to use the IAMCameraControl interface in DirectShow, I wrote a tiny command line app called FocusUF.

FocusUF uses the DirectShowLib library library to provide nice, friendly C# access to DirectShow. The DirectShowLib library maps the DirectShow Interfaces for use from a .NET app. With that library, it was little more than a handful of lines of code to access webcam controls. The app is hard coded to connect to a LifeCam HD-5000, but it would be easy enough to change the code for other webcam.

The code was written with Visual Studio 2017, it has not been tested with any other compiler. The source code is up on GitHub via this handy little URL.

How it works

To use the DirectShowLib library, I added it via nuget.

Install-Package DirectShowLib

The next step was to get access to the webcam. Using DsDevice from DirectShowLib, I was able to get the list of devices for the category of VideoInputDevice. Then I do a LINQ query to filter that list for the first match “Microsoft® LifeCam HD-5000”. If you are having a autofocus problem with a different brand or model of webcam, just replace that name with the name of your webcam. You can dump out the list of DsDevices and peek at the name property until you see your webcam.

Now that I have a DirectShow  sDevice that represents the webcam, I create a filter to expose the control interface of the web cam. DirectShow uses a module system called filters to expose device functionality. I create a new object that implements the IFilterGraph2 interface so that we can add a new filter. After getting that filter, I cast it to an IAMCameraControl to get access to the setter and getter methods. I get the current focus level and mode from the webcam.  I then set the focus to the current level and force the focus mode to manual.

How to use

Launch the app that will be using the webcam. Wait until it is in focus and then run FocusUF. It will detect the webcam and flip the autofocus setting to manual and lock it to the current focus setting. The setting will persist until the webcam is reset or another app changes the focus setting.

I probably looked better out of focus…

The name “FocusUF” is a tip of the hat to the YouTube channel AvE, where the host uses the phrase “Focus You F@*&” whenever his video camera loses focus.

It’s 2018, time to join that David Bowie Book Club that his son has started

Bowie’s READ poster from the American Library Association (1987)

Filmmaker Duncan Jones has started a book club of his father’s 100 favorite books and has invited everyone to join.

The first book has already been selected, Hawksmoor by Peter Ackroyd

Hawksmoor is a 1985 novel that takes place in the 18th and 20th centuries. From Wikipedia: It tells the parallel stories of Nicholas Dyer, who builds seven churches in 18th-century London for which he needs human sacrifices, and Nicholas Hawksmoor, detective in the 1980s, who investigates murders committed in the same churches.

Bowie’s list of 100 books to read can be found here.  Some of these books may be harder to find than the others.  I plan on seeing how many of them I can get through my local library.  Also check out the The Bowie Book Club and it’s accompanying podcast.  They already have a decent start on the Top 100.


What not to do on a job interview: Don’t play the arrogant card

Original image courtesy of Amtec Staffing

A few years back, we were hiring a new ASP.NET developer and did a few rounds of interviews with a set of candidates.  For this position we were experimenting with having the candidate take a programming exam as part of the process.  An exam that we ended up abandoning after that round, but more about that later on.

What was the exam?

The exam wasn’t a traditional multiple choice or fill in the blank type of exam.  We were checking for that kind of knowledge during the interviews.  This exam was all coding.  The candidate needed to create an ASP.Net app that required the user to login in and display a list of items from a database. The exam consisted of 4 or 5 steps, with each one building on the previous step.  The candidate was given the following

  • A laptop that was using Remote Desktop to connect to a virtual machine. We provided a keyboard and mouse for people who don’t like typing on laptops.
  • The virtual machine had Windows with plenty of memory
  • The virtual machine had IIS installed and configured for ASP.NET
  • SQL Server was installed on the virtual machine and had a database with the user store and the list of items to display
  • Full access to the Internet

The steps were roughly as follows

  • Create an ASP.Net web app
  • Connect the app to the SQL Server database
  • Add a login page
  • Validate a user’s login credentials from the database
  • Add a page that would display a list
  • Populate the list from the database.  The list needed to include a set of fields.

The candidate was given 2 hours in a quiet room to do the exam.  We made it clear that they could use any resource on the Internet to solve the problems.  If they copied every single line of code, that was fine as long as they could explain what each line did.  My career could be a testament to the power of Stack Overflow, it makes me smarter. After the 2 hours had elapsed, we would regroup and the candidate would walk us through the code and explain how the code worked.

We were not expecting anyone to actually complete all of the steps.  I did the exam in just under two hours.  I had the advantage of having devised the exam, but I had little ASP.NET experience at the time.  We were looking to see how the candidates worked and what their problem solving skills looked like.  We wanted to see how the sausage was made.

Getting back to the candidates, we had interviewed this guy who was off the scale in the terms of cockiness.  I don’t remember his name, so let’s call him “Sam”.  During the first interview, he was very sure of himself and said he was a “superstar” developer.  He mentioned that he had “googled” all of the developers that were part of the interview process and started listing where and what we did on the Internet.  That was a tiny bit creepy.  It’s expected to research candidates on the Internet, but a little out of ordinary to have the candidate do the reverse.  The way he did came across as bragging and we all thought it was a bit odd.

When we explained that we would like him to come back and take the programming exam, he told us that he was going to do great on it and was looking forward to taking it. Once again, just a  bit cocky.  You want someone that is confident, but he was dialed out way too strong.

So Sam came in a few days later to take the exam.  He was placed in a quiet room and given the instructions and the laptop already connected to the virtual machine.  There was a window into the office so he could be monitored.  After reading the document, he immediately started coding.  After 90 minutes, we sent Jim, our HR Manager, in to see if how he was doing and if he needed anything.

When Jim walked in, Sam just snapped. He told Jim that the exam was BS and that no one could solve it.  Sam said that it was a waste of his time and not a proper way of testing his skills.  He said this all in much more colorful language.  After venting all of that, he realized what he had done and regained his composure. He told Jim that he was doing fine and that he didn’t need anything.

At the two hour point, we halted the exam.  We then went a conference room with Sam to review his work.  He had not completed the exam and was very subdued as he explained what he had done.  After creating the web app and immediately connecting to the database, Sam decided to get fancy with the login screen.  He ended up spending most of the remaining time on the login screen and adding a lot of clever code.  When the clever code failed to work, he refused to move on and kept trying to get it to work right.  We’ve all been there.  You hit a roadblock over something simple that you just can’t see.  The more you look at at it, the more frustrated you get. It was during that part when Jim had come in.

Towards the end, Sam had realized that he had not done any of the rest of the exam. He stopped fiddling with the login page and started working on the rest of it.  He didn’t finish anything, but he had bits of pieces of the remaining steps.  As he walked us through the code that he had written, the cockiness crept back into his voice.  He explained why he took so much time on the login screen, saying he wanted to show off his skills.  We asked why didn’t just get it all running and then go back and add the “wow” factor.  He looked annoyed for a second and then said in retrospect that would have been a better way to do the test.

Afterwards, we discussed what we thought of Sam.  None of us were comfortable with having him as a co-worker.  While his attitude during our interviews had us concerned, it was the way that he had treated Jim that had tipped the scales against him.  Being able to work with your fellow employees is an absolute requirement.  We have all hit roadblocks and faced tight deadlines.  We can teach just about anyone with the desire and the ambition to be a good developer, I don’t know that is true for teaching an experienced developer how to play well with others. That pretty much ended any chance of being hired by us.

Getting back to the exam, we did drop it after using it on that round of developers.  One guy refused to take it.  He had done some contract work for us in the past, but as part of a group and we did want to see how he did on his own.  He told HR that he was offended that we were asking him to take the exam and that we should just hire him based on the contracting work he had performed for us.  The exam tested more than programming skill.  Refusing to take the exam when everyone else had done so was read as not being a team player.

Another developer completely failed the exam.  He had the skills, but his brain just vapor locked on the exam.  The ability to do the password page had completely left his consciousness.  I knew him from before the exam, I knew he had the skills but something just went wrong for him.  By the rules we had set for this round of interviews, we had to exclude him.  We had one or two others take the exam, no one completed it but they did a good job explaining how they got to where they ended up.  We ended up hiring someone through a different process.

After some discussion, we abandoned the exam.  Seeing code that a developer has written is still valuable to us, but this method wasn’t effective.  We now ask candidates to prepare something, either new or something already completed.  We may ask for something based on their resume and ask them to demo the code and explain what they did and why they did it.  We found that the candidate were a lot more comfortable and we learned more about their soft skills as well.  Developing applications is a team sport, asking someone to explain why they did a thing a certain way will give you clues for how they would work on your team.  You can learn to manage arrogant behavior, I’m an evolving experiment for that.  But when you are being interviewed, you can’t play the arrogant card and expect it to open doors for you.

That time I took a group of people to Boston for the Azure Red Shirt Dev Tour

I had tweeted out the hashtag #BostonOrBust.  Seriously, don’t do that.  I tempted Fate, and Fate called me out on it.

A couple of weeks ago, Microsoft’s Mary Baker reached out to me to see if there would be any interest for people in the Albany area to take a chartered bus to the Azure Red Shirt Dev Tour in Boston. I set up a poll on the TVUG Meetup site and emailed the members to get a feel of who would go. The numbers were high enough for Microsoft to reserve a charter bus and they asked if I would be the point of contact. This would mean keeping track of people and arranging to bring breakfast on board. Since we would be leaving from the Amtrak train station in Rennselaer at 5am, this would be a morning that would start much earlier than by my usual standards.

On the morning of the event, I went to a local Dunkin Donuts at 4:15 am and picked up an order of donuts, bagels, muffins, and coffee. Microsoft had already shipped cases of water and Gatorade to my house. I drove down to the train station and rounded up the other attendees. The bus had gone to RPI first to pick some students there. Then it came down to the train station and we boarded the bus and took off. We had 12 people, not counting myself and I sent the attendance list to Microsoft.  I was pleasantly surprised that a third of our group were college students.

Less than a minute after getting on the highway, an alarm went off. Apparently the bus was overheating and would not make it to Boston. The bus driver called for a new bus and then headed west to exit 24 of the Thruway to wait for the bus. We waited for about 45 minutes and a new bus was delivered. We carried over the food and beverages to the new bus and headed out. The delay meant that we would be arriving at the event just as it started. I emailed the contact person at Microsoft, Vanessa Diaz, to let her know that we would be delayed.

It was a pleasant ride on the Mass Turnpike. The sun was coming up, the leaves were changing colors, and there was just enough of a touch of fog to make the scenery look a bit magical.  I posted a tweet from the bus and added the hashtag #BostonOrBust. Famous last words, don’t ever do that.

After a couple of hours, we were about 40 miles out from Boston and the engine temperature alarm went off again. Same alarm, different bus. We pulled over and the driver added more coolant to the engine and we headed off again. We made it almost a mile before the alarm went off again. We pulled over again and the driver called for a new bus. He was told it would take an hour and they were sending a mechanic. It was now 9:30, the starting time for the event.

I went outside and took a picture of the bus on the side of the highway and sent it to Vanessa with a message saying that my previous ETA estimate was no longer valid. She called me right back and started working on alternative plans to get us to the event. We decided that our best option was to send a couple of taxi minivans. When I gave the actual attendance count, I neglected to include myself.  I was lucky number #13.  While I was on the phone with Vanessa, the mechanic from the bus company arrived.  He started pouring more coolant into the system and putting cases of coolant into the cargo compartment of the bus.

While the mechanic was performing various coolant related activities with the bus, the taxis arrived.  Each one could take 6 people.  That’s when we figured out that while I was 93% accurate with the attendance count, it would appear that 7% percent would not have a ride.  We were facing the possibility that we would need one more taxi.  That meant at least another 20 minute delay while we waited for the additional vehicle to arrive. Fortunately, we didn’t have to execute that option.  While we had been waiting for the taxis, a Chevy Cruze had pulled up.  Another driver from the bus company got out of the car and I had assumed that he was a supervisor of some sort and I pretty much ignored him while he talked to the first driver.

As it turns out, he was another driver for the company who just happened to be driving by and he had pulled over to see if he could be of any assistance.   When he heard that we had one too many people for the taxis, he offered to drive one of us to the destination.  So I had everyone else get in the taxis and I rode with this bus driver.  He knew Boston better than the taxi drivers and gave them detailed directions to the destination.  The taxis took off and we followed in the Cruze.

Load’em up, move’em out

The taxi drivers were fun to follow as they had only a limited understanding of how traffic lights are supposed to work.  Based on other drivers that I saw in Boston, I don’t think that is a unique behavior pattern.  For reasons only known only to themselves, the taxis took a different set of directions than what the bus driver had suggested.  And when I say “different”, I mean wrong.  To their credit, they only had to make one illegal u-turn in the middle of the street to get to the right location.

When we finally arrived, the first session was over and they were in a break. Vanessa and Mary met us outside and quickly got us registered.  We found our seats and Scott Guthrie started up a demonstration of what was new in SQL Server 2017.  He mentioned that there was a user group stranded on the way in, but we shouted out that we were here.

He then spent another hour on Azure Containers and Azure Functions.  All good stuff.  I was familiar with the concept of Azure Functions, but it had never really clicked with me before on how useful they could be.  Go watch the recording of Red Shirt Dev Tour in NYC on Channel 9.  Scott and his minions covered a lot of cool things.

We had a nice lunch and we had a couple of hours more of Good Stuff.  Seriously, go watch that video.


Scott Guthrie doing a cognitive services demo


At the very end, we were brought up to the stage to meet the Man in the Red Shirt.  This was actually a really big deal as he had to leave right after the Boston event to fly to NYC for the next day’s event.  The one that I keep telling you to watch.  Scott Guthrie was very gracious and took the time to greet each one of us and then we posed for pictures.

Scott Guthrie with the Lost Bus Riders

After taking the pictures, the Microsoft event crew gave us some cool swag to take back home.  They also arranged for a better ride home.  We went back in a nice luxurious Mercedes Sprinter passenger van.  This met with the general approval of the group.

Riding home in the rich lap of luxury. It lived up to the M-B motto, “The Best or Nothing”

Despite the transportation issues on the way in, we had a good time.  It was well worth the trip and I think that everyone learned some cool stuff.  And I can not thank the Microsoft event team enough for taking care of us.  They came through and rescued us from the side of the road near exit 12 of the Mass Turnpike.  It was incredibly awesome that Microsoft provided a bus to allow us to attend the event.

Checking Hypervisor status with PowerShell

Image courtesy of Serge Melki

I needed to find a quick way to see which hypervisor was installed.  I bounce between different development machines and some have Hyper-V enabled and some have Intel’s HAXM driver installed.  Both assist with virtual machines, but they can’t be used together.  I used to be 100% Hyper-V with running virtual machines and Android emulators.  The Microsoft Android Emulator used to be very good, but is suffering from a fair amount of bit rot.  In the meanwhile, Google’s Android Emulator has gone from being a great of sitting and watching something load very slowly to a tool that that you can use in real time.

Microsoft’s Android Emulator requires Hyper-V and Google’s Emulator really needs HAXM in order to have any level of performance.  Since I bound around from machine to machine (with the occasional repave), I wanted a quick way to see which hypervisor is installed.  Hyper-V requires a some work to turn on and off. HAXM is a kernel driver.  So I wrote a quick PowerShell script to report the status of each Hypervisor

$services = 'intelhaxm', 'vmicheartbeat'

$d = [System.ServiceProcess.ServiceController]::GetDevices() | ? {
  $services -contains $_.Name

$s = Get-Service | ? {
  $services -contains $_.Name


The first line just defines an array of names to match one. The next block of code uses GetDevices() to return the status of the HAXM driver. The block that follows returns the status of the Hyper-V Heartbeat Service. The last part just dumps out the results.

An alternative way is to pass the service name to Get-Service and it will return the status for the specified service. The problem is that it will error out if the specified service does not exist. And while that error message is a status report, it’s an ugly way to get that information

I named the script “hyper-stat.ps1” and when I run it on a machine with HAXM running, I get the following output


Status   Name               DisplayName                           
------   ----               -----------                           
Running  IntelHaxm          Intel HAXM Service 

On a machine with Hyper-V and no HAXM, I get this


Status   Name               DisplayName                           
------   ----               -----------                           
Running  vmicheartbeat      Hyper-V Heartbeat Service    

If I disable Hyper-V, I would get the following:


Status   Name               DisplayName                           
------   ----               -----------                           
Stopped  vmicheartbeat      Hyper-V Heartbeat Service             

There are few ways of scripting this task. This one was simple and I have it on the machines that I use for coding.

Edit: Right after posting this, I realized it didn’t actually work. I was originally reporting on the status of vmms, the Hyper-V Virtual Machine Management Service. If Hyper-V is installed, that service will always be running, even when Hyper-V is not enabled. The Hyper-V Heartbeat service is a better test for seeing if Hyper-V is enabled.

Time to repave (slightly) my work machine

After lunch on Wednesday, I rebooted my work PC and it did not come back.  ADB had somehow lost the ability to see my actual Android devices.  I had tried a few things and was at the “Have you turned it off and on again” step.  I shutdown it and restarted it.   Windows 10 was not very happy.  I got the light blue screen of death.  It had a useless QR code and the ever so helpful message “critical service failure” message.

After a few rounds of rebooting and trying the standard self-repair options, I surrendered and handed it over to our IT guy.  I pretty much knew what the end game would be, but decided to let someone handle it.  He did pretty much the same things that I did and we decided to let Windows reset itself.

Windows Reset is both a good thing and a bad thing.  The good thing is that it basically says that your current Windows OS is rubbish and it will install a fresh one.  One that will be hopefully less damaged than the one that you are currently using. Or in my case, not using.  All of your data files are left intact.  Or at least in the condition that they were in before the SS Minnow goes for a  three hour tour.

I’m not sure what the root cause of the problem was.  I was nearly out of space on the primary drive and it’s been my experience that Windows doesn’t behave well when it runs out of room.  I had rebooted the day before and it was just fine then.  Today I had updated the Android SDK and that pretty much chewed through the remaining free space on the primary drive.  I could have probably used used Mike Halsey’s help.  Mike Halsey has xray vision for this sort of thing.

I’m due for a new machine at work and we had ordered it the day before.  So there really wasn’t much point in completely repaving this machine.  I just needed to install the stuff that I would need for the week or so until the new machine comes in.  So it’s time to install the bare minimum I need to get what I need to work on for the next week or so.

Office 2016
We have Office 365 so this wasn’t an optional installation

Android Studio
While I do nearly all of my Android development with Xamarin, there are times where it’s useful run some code in Android Studio.

Visual Studio 2017
This is where the good stuff happens.  I installed the latest preview bits.  I usually leave the preview versions to virtual machines, but this machine will be in my hands for a week or too.

Visual Studio Code
I have a few projects that are firmware that have their own C compilers, but no IDE.  Visual Studio Code is turning into my text editor of choice.  I like the latest and greatest, so I always install the Insiders edition.

SQL Server 2016 Developer Edition and SQL Server 2017 Management Studio
I have data needs.

It’s more useful to than Edge for most stuff.  I still use Edge, but most of the time I use Chrome.

For making a quick hack of the Windows 10 background.  Why isn’t this bundled with Windows?

Sometimes I need some music to help me concentrate.  I have the attention span of a mal-adjusted toddler, playing music with a good beat tends to keep me focused.

Since I installed Android Studio before Visual Studio, it installed the Android SDK and assorted tools first.  Visual Studio installs a second set and in a separate location.  Android Studio places it a user profile folder, Visual Studio in a Program Files x86 folder.  Since I’m using Intel’s HAXM kernel driver to accelerate Google’s Android emulator, I need to know which IDE’s Android SDK installed HAXM.  When I get the new machine, I’ll install the Android SDK first and set each IDE to use that SDK.

In the meantime, I’ll starting making a list of the tools that I need to install on a new machine.  There is considerable overlap with what I install on my Macbook these days, but there are still key differences.

Vermont Code Camp 2017

So it looks like I’ll be speaking at Vermont Code Camp 2017 on September 16th.  I’ll be doing a presentation on using vector graphics with Xamarin.  If you targeting multiple platforms, using vector graphics like SVG files lets you have one set of images for multiple resolutions.  It’s a short session, but it will be useful for mobile developers of any stripe.

It’s not too late to register for #VTCC9.  You can register here and it’s free.  It’s held at Champlain College in Burlington.  It’s worth travelling up to visit Burlington in the fall.  It’s right on Lake Champlain and it’s a pretty part of the country.   You find the Vermont Code Camp on the twitters at @vtcodecamp. They have a Slack channel at vtcodecamp.slack.com and you can join at vtcodecamp.herokuapp.com.

And one other thing.  Mike Halsey has xray vision.  It’s his super power.  This has nothing to do with the code camp, but it’s worth mentioning.

Using the Multilingual App Toolkit with the Microsoft Translator service from Azure’s Cognitive Services

Image courtesy of M. Adiputra via Wikimedia Commons

The Multilingual App Toolkit (MAT) is a great tool for managing your localization workflow with Visual Studio projects.  One of the features is the ability to machine translate your string resources into another language.  You would not want to ship an application that was machine translated, but it provides a jumping off point for the actual translators that will work on your text.  When it was originally released, MAT included support for the Microsoft Translator service,  It just worked right out of the box.

Back in April (2017), the Microsoft Translator service that was part of Microsoft Datamarket was retired.  The replacement is part of Cognitive Services and is hosted in Azure.  The Multilingual App Toolkit (MAT) was using the Microsoft Translator service as the default translation provider for doing machine translations.  If you are using MAT to manage your language resource files and wish to use Microsoft’s translation services, you’ll need to make some changes.  They are documented here, but I’ll mirror the text.

Make sure that you have the latest version of MAT installed.  For VS 2017, you’ll need 4.0.6810.0 as the minimum version.  For VS 2015 or 2013, you’ll need as the minimum version.

Then, you’ll need an Azure subscription.  When you use the Translator Text API, you can pick from a number of pricing plans.  The free plan lets you translate 2 million characters a month, but does not allow overages.  The next plan charges  $10/month per million characters. And it moves up from there.  For most projects, the free tier should be sufficient

You can sign up for an Azure account at http://azure.com.  You’ll need a credit card, but you wont be charged unless you go beyond the free plans.

Once you have an Azure account, sign in to the portal and click the New button.

Type “Translation” into the “Search the marketplace” entry field.  Then select the Translator Text API.

Click the Create button

Select the free pricing tier and fill out the rest of the fields and then press the create button.

Click on image for larger version

After Azure deploys the service, it will take you to the service page.

Under “Resource Management”, click “Keys”.  Copy the value for “Key 1”.  This will be the authorization key that enables MAT to use the translation services.  Azure defines two keys, Key 1 and Key 2.  They will both work.  If you plan on sharing the service to let other people translate your code, you can revoke the key at a later date.

Open the Credential Manager in Windows.  The easiest way to launch this is to press the Windows key or Start Menu button and then start typing “Credential”.  You should see the app in the list of matching items

Select “Windows Credentials”

Click “Add a generic credential” and then fill in the fields.

For Internet or network address, enter Multilingual/MicrosoftTranslator

For User name, enter Multilingual App Toolkit

For Password, enter the authorization key that you copied from Azure.

If you copied and pasted the text, make sure that the text does not have trailing spaces at the end.

Click the OK button.

Entering the Azure key as a generic credential

Once you have added the credentials, the Multilingual App Toolkit editor will now use the translation services from Azure.


You can now register for the Dream.Build.Play 2017 Challenge

Microsoft has revived it’s indie game dev contest – Dream.Build.Play and you can register now.

Dream.Build.Play 2017 Challenge

The 2017 Challenge is a six month game contest aimed at indie devs. Teams of up to 7 (individuals can go solo if they desire) can enter one or more of the four categories available:

  • Cloud-powered game – Grand Prize: $100,00 USD
    Azure Cloud Services hands you a huge amount of backend power and flexibility, and it’s cool. So, here’s your shot of trying Azure out and maybe even win big. Build a game that uses Azure Cloud Services on the backend, like Service Fabric, CosmosDB, containers, VMs, storage, and Analytics. Judges will give higher scores to games that use multiple services in creative ways-and will award bonus points for Mixer integration.
  • PC Game – Grand Prize: $50,000
    Building on Windows 10, for Windows 10? This is the category for you. Create your best UWP game that lives and breathes on Windows 10 and is available to the more than 450 million users through the Windows Store. It’s simple: create a game with whatever technology you want, and publish it into the Windows Store. Judges will look favorably on games that add Windows 10 features like Cortana or Inking.
  • Mixed Reality Game – Grand Prize: $50,000
    Ooh, so you want to enhance this world you live in with something a little… augmented? Virtual? Come and join us in the Mixed Reality challenge and build a volumetric experience that takes advantage of 3D content in a virtual space. You’ll need to create your game for Windows Mixed Reality but you can use technology like Unity to get you kickstarted. Oh, and don’t forget the audio to really immerse us in your world.
  • Console Game – Grand Prize: $25,000
    Console gamers unite! Want to try your hand at building a game for Xbox? This category is your jam. Your UWP game will be built for the Xbox One console family, and incorporate Xbox Live Creators Program with at least Xbox Live presence. Consideration will be taken for games that incorporate more Xbox Live services such as leaderboards and statistics.

Teams will be judged on fun factor, innovation, production quality and business aspects of their entry, and winners will be selected from the top three from each of the four categories for a grand final in 2018 where the prizes will be awarded.

Visit the Dream.Build.Play site for more information.  There is a video explaining the competition on Channel 9.