An overview of the Microsoft Application Platform for developers

 Speaker: Abel Wang

Devs are the most important people anywhere. We rule the world. What we do changes the world. Writing code is more important than ever.

We used to write functional apps but today we are expecting rich web apps and mobile apps with amazing experiences. We had isolated apps but today we don’t want silos anymore, we want to combine everything. We want apps connected to business, extend business to the cloud. We need intelligent apps, to have data connected. We used to have individual stable apps with release cycles once in a couple of years, but the world now moved much faster. DevOps mindset, continuously delivering value to end users. Today there are even companies that release every day, Amazon, Netflix, Microsoft. We need to have continuous innovation at scale.

Mobile

Modern apps need to be mobile, need to span multiple devices and screens, work seamlessly from one device to the next. No longer our apps are one screen, it needs to scale. We need the power of the cloud, all the heavy lifting doesn’t happen in the app. We need to be able to scale. We need data-driven intelligence, data without insight is just data, insight without action is completely useless. We need continuous innovation.

Mobile is important but we need to be able to span multiple devices and scale screens quickly. The mobile app dilemma: native or hybrid?

  1. Native, downside is separate code base for each device. Fixing a bug for all devices takes longer.
  2. Write the app once in JavaScript and run it in the browser, problem is performance. It doesn’t look native.

The best of both worlds: use Xamarin. You are able to write native apps by writing your C# code once and compiling it down. Can you share your code on all platforms? Sometimes, up to 100% with Xamarin Forms. Around 90% if you design your code right.

Xamarin is built into Visual Studio. You cn choose iOS or Android app in the project templates. Because of Apple’s licensing, we have no way of compiling iOS code except with the Mac. We need to have a Max on the network and share between many people that we can use that we can select as a Xamarin Mac Agent in Visual Studio.

  1. Draw the storyboard, it takes a while on the first time because it has to compil
    1. Use iOS Widgets in the Toolbox
  2. Do stuff in the ViewController
  3. Run the simulator: VS remotes into the Mac and shows the simulator on the Windows machine

Any C# developer out there are mobile devs. Start building mobile apps!

Building mobile is just code, but there are some unique challenges. One of the bigger challenges is setting up a build machine, it is a serious pain and it takes a long time. Another problem is that testing becomes extremely difficult, there are many different types of mobile devices. How are we going to deploy and test against each of these devices? DevOps, CI and CD. Another problem that we have in the world of mobile is that we need to know the crash and analytics, we need to get the crash reports. We have to know is the app up or down? What are users really doing in the app itself? We need this so we know if we are still adding value. How do we get these from mobile apps? There are tools for that. Using VSTS you are able to create CI, CD, release pipelines, you can set it up to handle mobile scenarios. You can use Xamarin Test Cloud for automated UI testing running against physical devices. Hotkey App to distribute it to your testers. VSTS for build, Xamarin for test information, Hotkey Apps for crash analytics.

It would be nice to have a system that would do all of this for us. We have Visual Studio Mobile Center, mission control for mobile apps. With just of few clicks you are able to set up for CI and CD pipelines, you can see the analytics. We don’t care which OS and platform, it can be anything and everything behaves the same way. This is a new Microsoft where we embrace all the technologies.

  1. Check in code.
  2. Automatically build on push a build for simulators. It fires up a pre-configured Mac in the cloud.
  3. Set up a test pipeline to run automated UI tests in the Xamarin Test Cloud. Get device logs, test logs and test failures.
  4. Distribute app to testers. Release for groups.
  5. Get crash analytics when things break. Send back crash report and download stack trace.
  6. Analytics to see who is using the app with Audience and what are users really doing with Events.

Mobile Center currently in preview:

Cloud

Back in the days we have everything on physical machines. Then came the virtual machines. But then can the power of the cloud. What is fun is PaaS Microservices, harness the power of the cloud. Gone are the days where you have to bring your machine down, apply patches and bring is back up. You have downtime. Now you no longer have to worry about your infrastructure. Use the cloud, it saves huge amount of time.

PaaS = Functions + App Service + Service Fabric + Azure Container Service

Functions = serverless compute

Function is a tiny chunk of code which you can trigger in lots of different ways, e.g. timer. Support for any language, like C#, JavaScript.

App Service = Web and mobile

Service Fabric = prescriptive microservices framework

Microservices

Architecture useful in the cloud. Back in the days we used to build these monolithic app. If we change one thing we need to deploy this big monolithic app. Dangerous and scary to deploy it, not the DevOps world. With microservices we break everything in tiny chunks and deploy just a tiny part. Flexible and scalable.

Two reasons to use microservices: scaling and deployment. We only deploy that one service.

Azure Container Service = Container deployment and management

Containers are like mini VM but strip out all the nonsense. It will run the same way no matter where you host it. You can use .Net and Java. .Net even on Linux with .Net Core. We need to be able to do CI. Full set of tools in VS to help managing containers. To dockerize a project, all we do is Add Docker Support on the project in VS, this creates a Dockerfile in the project. Instead of IIS Express, run with Docker, which packages it up and deploys to Docker. “docker ps” in command line to see list of containers. We can set breakpoints and debug, even if it’s running on a container. Changing a file saves it and pushes it to the Docker container.

We need to build new kinds of apps that run on many kind of devices. We also need an open and scalable cloud platform that is data-driven and intelligent. We need to work in DevOps mentality.