Category Archives: Uncategorized

Thank you JavaScript/KC!

Thank you to everyone who attended my “Absolute Beginner’s Guide To Mobile Apps” talk at the JavaScript KC group tonight!  This was easily the biggest meetup group I’ve had the chance to address (almost approaching Cory House numbers!).

I made mention a couple times that a version of tonight’s talk was given back in May to the Xamarin meetup, though that presentation was much more targeted at Xamarin than the JavaScript frameworks.  That said I will readily admit that my blog post for Links and References is already slightly out of date and I’m going to work on revising it and will make updates to that blog post.  The biggest wildcard back in May: that talk was before Microsoft //Build, Google’s I/O, and Apple’s WWDC event — and there might have been a Chrome or PWA event during that time as well.  The point being: I’m going to update that post.  I’ll post on Twitter — @dotNetMike — when there are updates.

I lost 60 pounds teaching Xamarin!

Well… I did lose over 60 pounds so far this year and the best before-and-after photos I have are of me giving talks to devs about Xamarin. If you haven’t tried public speaking yet I HIGHLY recommend it. As for the weight loss effects… your results may vary.  🙂

I'm about 295 pounds in this photo...

I’m about 295 pounds in this photo. This was March 22, 2016 and I’m talking to the KC .NET Developers Group about Xamarin (which was still non-free as of this talk —  the //Build announcement was the next week). Thank you to Heather Downing for taking this photo with my iPhone!

Still 6'5" but now I'm under 230 pounds as of Nov. 12, 2016. Still talking about Xamarin!

Still 6’5″ but now I’m under 230 pounds as of Nov. 12, 2016. Here I’m talking about Xamarin Native to the Kansas City Xamarin Dev Days attendees. Like the March talk where announcements the following week rendered a bunch of things obsolete, this was four days before the announcements at Connect() rendered a huge portion of this talk obsolete as well! Thank you to Duane Newman for giving me this photo!

Getting Started Links for my talk at the DevUp Conference

Thank you to everyone who attended my session at DevUp!  As promised, here’s a non-exhausitve list of resources for getting started mobile application development!

VMWare Workstation and Xamarin Development: It could have been so good

I’ve been doing Xamarin Development for almost two years now.  Until a few weeks ago my preferred environment has been Xamarin Studio on a MacBook Air, which worked fine for the mobile apps themselves but not so well for writing and editing the Azure/ASPNET MVC service layers; for that I really need Visual Studio.  I considered getting a MacBook Pro and running Visual Studio in a Parallels or VMWare Fusion VM, but what I really wanted was the ability to run several VMs at once, especially dedicated VMs for SQL Server and SharePoint.  This latter consideration rules out the MacBook Pro as we know it currently: 16GB of RAM isn’t enough for MacOS and Xamarin Studio, a VM for Visual Studio and IIS, and a VM for SqlServer (16GB is barely enough for Chrome, but I digress).

Since I don’t see Apple releasing a MacBook Pro with 32GB of RAM anytime soon (or selling it for less than $4000 when they do), I opted to get a Lenovo P50 with a quad-core i7, 64GB of RAM, and a 1TB NVMe SSD (for just $2200 — top that, Apple!).  Part of the goal here is to have separate and isolated client VMs so that the work I do for Client A is in it’s own VM, Client B in another VM, etc.  This is especially useful when a client requires archaic versions of Visual Studio or Sql Server (as recently happened on a DTS 2000 to SSIS 2012 migration project).

To accomplish this VM strategy I downloaded a 30 day trial of VMWare Workstation Pro 12 and used the last Windows 10 Pro license I had on hand.  I created a pristine base image and then created a Linked Clone for the first client project.  In that clone (let’s call it Client-A-Stable) I then installed Visual Studio 2015 Professional, all of the bits for Xamarin development, and all of the Android SDK components and tools for APIs 19 – 23.

Now the fun part: programming!  I pulled down the code for the client’s Xamarin app, performed the initial build (made longer by Nuget restores and some “works on my machine” config updates to get things to run) and was ready to launch the app in an Android emulator… which is where this story goes wrong.  On Windows, there are three choices in Android emulators: the Google supplied emulators (slowest), Genymotion (fast but requires Virtual Box which I would prefer to avoid), and Microsoft’s Hyper-V based emulators for Android which are the fastest option available.  I installed the Microsoft Hyper-V emulator and upon launch was met with the first problem: Hyper-V support in a VMWare Workstation VM.  Officially, VMWare doesn’t support Hyper-V currently though they do have an unsupported Hyper-V mode which makes the operating system in a VM think that it’s running in a proper Hyper-V environment.  Okay, let’s give it a try now: no-go.  Even though, per VMWare’s sparse documentation on the topic, Hyper-V features should be working at this point, the Microsoft Hyper-V emulator refused to run, with a dialog box citing that Hyper-V support was absent.

No big deal, I still have a couple more options left. Next I created a Linked Clone from Client-A-Stable (Client-A-Genymotion) and downloaded and installed Genymotion. More dramatically, Genymotion, which is built atop Virutal Box, detected that it had been installed in a VM and flat-out-refused to even try to launch. Okay, delete that Linked Clone, at which point I’m thinking this linked clone business is awesome: if I want to experiment with something that could potentially muck up or destabilize my VM, just create a linked clone, give it a try, and delete it if the experiment fails.  But as nice as that is, I really need an Android emulator to work sooner than later or I’m going to be up a creek fast!

Last option: the Google supplied emulators. Initially this was a no-go (no Vt-x support was detected). Fortunately the client had a physical Android device I could attach to my laptop and use for debugging until I could get the emulator mess figured out.  After a couple weeks I discovered that having Hyper-V enabled in the VM (or the base operating system) makes it appear to apps that VT-x is not available even though my i7-6820HQ CPU most certainly has this ability. The solution, as I learned, is to turn off Hyper-V in the VM and specifically enable emulated VT-x, at which point I could FINALLY get the Google/Intel HAXM Android emulators to run.  Well, “run” really isn’t the right term… crawl is more accurate.  So slow that clicking on the “apps grid” button allowed me to see in janky detail, over a period of a few seconds, the animation of the button grow to full screen, totally cover the whole screen of the emulator, and then do an animated disappearing act, revealing the grid of apps loaded in the emulator.  And this was after waiting more than a full minute for the emulator to load. There are only two words to describe this state of affairs: completely unsatisfactory.

In summary: the high performance Hyper-V android emulator won’t run in a VM even though it’s in hyper-v mode, and VMWare won’t support VMs in this mode so I’m on my own and out of luck on this option.  Genrymotion is a no-go because it detected it wasn’t running on the base operating system and refused to even start. And the Google/HAXM emulators are a no-go because they take too stinking long to actually do anything… which will always lead to other things. At least for this client engagement I can use their physical Samsung device tethered to my machine for development and testing, and while this certainly work, there are a few problems. First, this device belongs to the client and if they suddenly have a need for the loaner device I have then I’m on my own again. Secondly, this device represents only one of the API levels being supported for this app.  The app is officially supported on APIs 19 -23 (and 24 before the end of the month) but the testing device I have is API 22.  Lastly, by being restricted to the physical device I’m locked into thinking of the app in that aspect ratio and screen size only.  You always need to make sure the app looks and acts well whether you’re running on a 10″ tablet or a 4″ Nexus 4. Emulators are perfect for this kind of smoke testing — but I cannot run an emulator and get work done in a reasonable amount of time.

Ideally I would be able to run the Microsoft Hyper-V emulators in a VMWare hyper-v-enabled VM and just get my work done quickly, but this doesn’t seem to be an option with the current state of VMWare Workstation.  Looks like my only recourse is to install Visual Studio and all other once-per-client software requirements in the base OS (Windows 10 Pro) and hope the time between erase-and-reinstalls on this machine is minimal.

Xamarin 3D Questions and Answers (belated)

As promised, here are some answers to the questions raised at the “Xamarin 3D” meetup back in May. If you have more questions please feel free to contact me via Meetup or at @dotNetMike.

My apologies for not posting this much sooner… Kunjan is my witness that I emailed this reply to him the day after the presentation back in May (though I’ve updated the TFS question this morning since I have more info). I plan to completely re-do this talk with an emphasis on demonstrating everything I’m covering rather than just saying “Trust me, it’s cool and you can do it.”

Questions and Answers

Q. Can I developing Windows Mobile apps on a Macintosh?
A. No. You’ll either need a Windows VM on your machine (or an Azure VM to which you can remote?) or an actual Windows machine for this.

Q. What is the C++ interop story for Xamarin?
A. I’m linking to two articles, one which addresses building and debugging C++ libraries in Xamarin.Android with Visual Studio, and another which discusses using Visual C++ for cross-platform mobile development. Mac: I’m not sure if, in aggregate, this answers your question. If I understood it correctly, you were curious whether you can write both an Android and iOS app from the same IDE. While these articles don’t specifically say yes to this, I’m going to dig deeper on the Xamarin forums and see if I can make contact with someone engineers at Xamarin who can answer this question completely.

Link: https://blog.xamarin.com/build-and-debug-c-libraries-in-xamarin-android-apps-with-visual-studio-2015/
Link: https://msdn.microsoft.com/en-us/library/dn707591.aspx

Q. How much of the CI/CD pipeline can I do with on premises TFS?
A. Per a friend of mine who is a TFS expert: TFS on prem can do what VSTS can do. For local iOS builds you’ll need a Mac for hosting an iOS build process but TFS can connect to it and everything should Just Work.

Other Notes and Links

I mentioned Calabash as an alternative tool for creating tests for use locally or in the Xamarin Test Cloud. More information about Calabash can be found at: http://calaba.sh/

The videos that didn’t play:

The first was a section from the HockeyApp & DevOps talk at Xamarin Evolve, specifically the portion of the video which addressed the annotation and user feedback features of HockeyApp:
https://www.youtube.com/watch?v=AEWAPZ4J6eo&feature=youtu.be&t=23m7s

The second video is a later section of that same presentation which dealt with setting up automated (or manual, if you prefer) distribution pipelines such that an app could be auto-published to the app stores after passing tests and getting required authorizations from managers and testers:
https://www.youtube.com/watch?v=AEWAPZ4J6eo&feature=youtu.be&t=27m28s

I highly recommend watching the whole video as it really does a good job covering the DevOps/CI/CD story that is possible with the Xamarin & Microsoft (VSTS) tool chains:
https://youtu.be/AEWAPZ4J6eo

Last is this two and a quarter minute high-level overview of the features of HockeyApp… short enough to be digest-able by most managers:
https://www.youtube.com/watch?v=gVEpupXd3W8

Switching to Windows Phone: The Google-Free Zone

While I am almost completely happy with my switch to Windows Phone, the lack of apps from Google is rather annoying.

Google ships exactly one app for Windows Phone: their Google Search app.  This used to really get on my nerves since I use Gmail for my email and had switched to using Hangouts instead of iMessage for chat/instant messaging but I think I understand — at least partly — why Google is doing this.  Sure, part of it is competition: they are rivals with Microsoft on several levels.  Then again, Google is also in competition with Apple in the phone market as well but yet they provide numerous apps for the iPhone and iPad.  So what’s the difference? The underlying phone’s SDK.

If you wrote Windows Phone 7 apps you know that these had NOTHING in common with the Windows Mobile 6.x apps from the WinCE days. I don’t recall if Windows Phone 7.5 required major rewrites but I seem to recall that WP7 apps had to at least be re-comiled for 7.5.  Ditto WP8.  And Microsoft is now talking about “Universal Windows Apps” starting with Windows 10 (and whatever number the Windows Phone OS happens to be) which will replace the current Windows Store apps on Windows proper and the apps on Windows Phone.  Given that the state of the API on Windows Phone is less stable than the politics of eastern Syria it’s no wonder a company would avoid Windows Phone for now (even a company with a bazillion programmers such as Google).

So while I initially wanted to hold it against Google for not providing apps for Windows Phone, on second thought I can’t really blame them.  This is a mess Microsoft has made for themselves over and over.  Ironically, Xamarin might be their savior on this front.

Switching to Windows Phone: it Just Works

I was planning to get all cute with the title of this blog post, making reference to the default dark color scheme of the Windows Phone, by calling this the “Welcome to the Dark Side” installment.

But honestly, that’s just too dramatic for this phone, which is the real theme of this piece: it just works.  No drama, no needing to reboot the device because the Audible app has hung (again!). There is nothing flashy about this phone or the O/S to the point it’s almost boring.  But on second thought, isn’t that a good thing?  I’m not fighting this phone to get it to do what I want: the Podcasts app works as expected (though I really wish I had a button to go back 30 seconds and hear the last few sentences again).  The music app just works.  There were no headphones that came with this phone so I can’t say they “just work” but the $20 Amazon Basic headphones (ostensibly for their Fire Phone) work like they were made for this phone.

In the last post I ranted about what the phone is missing in terms of apps, but it’s missing something else as well: frustration and configuration headaches.  Need to sync your contacts and calendars from both your Google and iCloud accounts? No problem! Need to import all of your music from your iTunes library? Microsoft has an app for that (which works on Windows and Mac) which does it’s job well and nothing more.  I want to expand on this last point a bit.  If you have a Mac and an iPhone then you know the “joy” of having your Mac happily launching a bevy of applications as soon as it sees your iPhone connected (you know, because if iTunes doesn’t automatically back up your phone’s state, or iPhoto doesn’t upload your photos, and iCal doesn’t do whatever the heck it’s doing when it sees your phone then you’ll never remember to do it on your own!).  Not only will a Mac, like an over-eager puppy wetting itself at the return of its master, launch a bunch of apps upon the connection of an iPhone, there’s a photo import process related to iPhoto which sucks up so much memory that my habit was to reboot my Mac after syncing and disconnecting my iPhone (16GB is enough RAM for mobile application development in Xamarin Studio along with a bazillion Safari and Chrome tabs open, but not enough for an iPhone apparently).

I know… First World problems, but my Lumia 635 doesn’t give me any of that drama… and isn’t this more in line with what we want our phones to be?

Switching to Windows Phone: Where are the apps?

Introduction

On the day after Thanksgiving I bought a Nokia Lumia 635: a Windows Phone. It wasn’t a dare, I wasn’t under duress, my iPhone wasn’t broken — I wanted to buy a Windows Phone. Over the next few blog posts I’m going to write about my experiences in switching from an iPhone to a Windows Phone.

First a little background. My history of smartphones is pretty basic: a couple cheap Androids, an iPhone 4S, followed by an attempt to like Android again (about a month with an LG F3 Android running 4.1.x) followed finally by a 64GB iPhone 5s. My expectations for the Windows Phone are simple: function as a suitable replacement as a music and podcast client, do basic things like texting, email, Facebook, and Twitter, and allow me to run several useful apps. Oh — and make phone calls at least as well as the iPhone did.

Where are the apps?

“Why do Windows Phones run so fast? They don’t have any apps to slow them down!” There are many versions of this joke but the stereotype is based in fact: there simply aren’t as many apps for Windows Phone as there are for iOS and Android. While I knew this to be the case I wasn’t prepared for just how few apps there are for Windows Phone. Which apps are missing? Here’s a rundown of the apps I’m missing most right now:

  • Gmail: Yes, you can set up mobile Outlook to connect to Gmail but the advantage of the Gmail app is searching: it searches your email on the Gmail servers as opposed to the email on your phone.  I’ve been using Gmail since the days when you needed an invite to join and have so much email in my account that downloading it all to my phone in order to make it all searchable is a no-go.
  • AMEX Mobile, Schwab Mobile: I do my banking with Schwab and have an American Express card I use as my primary credit card and got hooked on the iPhone apps for these just in time for my switch to Windows Phone.  I’m considering changing my bank and credit card based on who has a Windows Phone version of their mobile app.
  • YouTube: There is a Microsoft-created “app” for YouTube, but it’s just a shortcut to launch YouTube’s mobile website in the phone’s web browser. A shortcut to a website isn’t an app.
  • Google Hangouts: I realize this is a newer app but Google is a freaking software company — and they can’t make a Windows Phone version of an app? In anticipation of leaving iPhone I have been using iMessage a lot less and using Hangouts a lot more expecting that Hangouts is surely supported on Windows Phone.
  • MS Word and Excel: I had Word, Excel, and even Power Point on iPhone but never thought that these would be missing on Microsoft’s own mobile platform.
  • Google Drive and Dropbox: I don’t really want to move everything to SkyDrive, especially since I have 1TB of storage on GDrive and real people with whom I share files use Dropbox.
  • Amazon Cloud Drive: With unlimited photo storage for Amazon Prime members I have become a huge fan of this app. I’m hoping Amazon releases a WinPhone version of this soon.
  • Amazon Music: Obviously iTunes-purchased music won’t auto-sync through the air with a Windows Phone, but I figured that at least I wouldn’t need to side-load my Amazon-purchased music to my Windows Phone.

There are more apps which have no Windows Phone version — Meetup.com; all of my Amateur Radio apps, especially EchoLink; Yahoo Sports — which I use less frequently.  All of that said, one of the reasons I decided to give Windows Phone a try is because I keep hearing that the tens of people who have them LOVE them… and despite the lack of apps mentioned above I am liking this phone so far.

More on that in the next installment.

2015 Annual Goals

Where I work we’re required to come up with three goal we want to achieve in the coming year. Remembering how hard this was last year I came up with six this year hoping that at least three of them would pass muster. Here’s what was accepted:

  • Earn at least one certification by July 1, 2015 (I’m aiming for Xamarin Certified Developer)
  • Present at least one Lunch & Learn by Dec 31, 2015 (no topic set; I’m thinking Xamarin, Javascript, or programming for Docker containers)
  • Attend at least one conference

For the conference it would be most awesome if my employer sends me to both Xamarin’s Evolve conference and Kansas City Developer’s Conference.  My other goals include learning Apache Cordova and publishing an app in the Blackberry Store (because I can’t do that using the Xamarin tools), presenting at a local user group, and being accepted to present at a conference.  The last one is really beyond my ability to make happen; conferences get a lot of submissions for all kinds of talks so if more well-known people want to present on the topic you’ve submitted or the conference organizers aren’t interested in the topics you’ve submitted then you’re out of luck.  I presented on Angular versus Ember last year and my coworkers seemed to like it (at least that’s what they said).  Mobile is hot and Javascript is hot, and now that Visual Studio 2015 is including support for Cordova “in the box” I’m considering this as my topic for lunch & learn, presenting to a local user group, as well as submitting to present at a conference.

The most creative abuse of C#…

My coworker JSR has, by presenting on the topic, staked out the position of Lead C# Expert where I work.  So it is with no small amount of relish that I enjoy finding code samples that either stump him or make him want to gag.  In a blog post I found what is perhaps the most “creative abuse” of C# I’ve ever seen.  The scenario is this: I have a variable of the type Animal, and among it’s various subclasses in the program is the type Dog and I want to run some logic on an instance of animal, but only if it’s a Dog… and I only want to run it once. Here’s one possibility:

for (Dog dog = animal as Dog; dog != null; dog = null) {
//put your “only if it’s a dog” code here
}

Admittedly, this is a hack, and an ugly one at that… but it works perfectly fine. It’s also a case of code that is so obtuse as to be incomprehensible to junior developers, and probably more than a few seasoned ones as well. The more sane way to accomplish the same in only one more line of code is this:

Dog dog = animal as Dog;
if (dog != null) {
//put your “only if it’s a dog” code here
}

But hey, if saving a single line of code is worth making your logic unreadable the feel free to use the for() construct above. More on this manner of code abuse at: http://stackoverflow.com/a/7113387.