Posts by Category

Android

Adding a pre-build step to Android Studio builds

January 20, 2020  2 minute read  

I’m currently writing a cloud-native app with an Android (and iOS) front end. I’ve got my backend configuration written using Terraform, and it outputs a file called infrastructure.json that describes the backend in a JSON format. Now, the question becomes “how do I get that infrastructure.json file into my front end code?” A simple version of this would be to ensure I copy the file every single time I update it. However, a better solution would be to ensure the file exists and to copy it...

Mocking Android resources with Mockito and Kotlin

January 03, 2020  3 minute read  

I bumped into an issue that was a little harder than I expected to solve, so this is the documentation. Requirement: Load a JSON file from the res/raw resource directory. Actually, that wasn’t the problem. The problem was how do you test that functionality? The library I have a basic configuration library that is constructed like this: class Configuration internal constructor(jsonContext: String): Map<String, Any> { internal constructor(stream: InputStream) : this(stream.buf...

Unit testing asynchronous Android network libraries

January 01, 2020  5 minute read  

I’m writing a network library for Android at the moment, and specifically looking at unit tests. In my last article, I looking at mocking the Android context and other Android specific libraries. Since I am writing a network client library, I need to go a step further and deal with the network connection itself. How can I test the asynchronous network calls in a repeatable manner? Fortunately, there’s a library for that. Square, the same people that brought you OkHttp, also produce a moc...

Two tips for unit testing Android libraries

December 24, 2019  3 minute read  

I’m busy writing a networking library for one of my Android apps. The question today is “how do I properly test the library?” There are a few problem areas, and I’ll cover two of them today. How do I properly mock classes that aren’t really Android specific, like android.location.Location and android.net.Uri? How do I properly mock the Android context? Android Studio already integrates the excellent JUnit packages for unit testing. I don’t want to have to write a visual app just to...

Build a better RecyclerView Adapter

December 13, 2019  3 minute read  

Many of my Android apps end up including listst, which are implemented via a RecyclerView. More importantly, I know all the items in the list ahead of time. Every single blog and tutorial always uses the same methodology. This ends up being a lot of boilerplate code. Create a view holder class Create a list adapter Attach the list adapter to the recyclerview Update the view holder class to implement the UI Check out the requirements around clicking Arrange for the list of item...

Validating permissions on Android with Kotlin

October 07, 2019  2 minute read  

I’m continuing my educational coding exercise, developing a new photo sharing app. Recently, I completed my user authentication and registration process and I’m now quite happy with it, so I moved on to taking photographs. I’ve got an activity with a toolbar and a floating action button: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/r...

Using Azure App Configuration for Remote Config with Android

September 22, 2019  11 minute read  

I’ve been playing with a new app recently. I decided I needed some support from the cloud around feature flags (turning on and off features for specific people so I can test things) and for remote configuration. Fortunately, Azure has a service in preview - App Configuration - and it does both of these things. There are preview libraries to go along with it for .NET, Java 8, JavaScript, and Python. Sadly, there is no library for Android Java. Fortunately, we can fix that! Let’s take a l...

Tailwind Photos: Registration (The Azure Function)

September 21, 2019  13 minute read  

A quick recap - we’ve got three identity providers integrated into our app, set up an Azure Functions App in our backend using ARM, and we’ve set up authentication on that function app. We’ve also swapped our identity provider authentication token for an Azure App Service authentication token so we can use it on our backend. Now it’s time to consider the actual Azure Function for registration. You want to store profile information in your backend. In my case, it allows me to communicate w...

Tailwind Photos: Registration (Authentication on Android)

September 15, 2019  7 minute read  

We are almost at the end of “registration and authentication” - and it’s been a seriously long way, which just goes to show the amount of complexity in the subject. Thus far, we’ve authenticated with Facebook, Google, and Microsoft, handled silent login and configured the backend resources. In the last article, we configured the backend resources to handle authentication, allowing us to swap a social identity provider token with a ZUMO token that we can use for further authentication. A...

Tailwind Photos: Registration (Authentication)

September 10, 2019  4 minute read  

In the last article, I introduced the resources necessary for my mobile backend, driven mostly by the serverless capabilities of Azure Functions. I also provided a mechanism for deploying the resources automatically using Azure Resource Manager (or ARM). Today, I want to look at the next step - authentication. In my Android app, I’ve already integrated the various identity providers (or IdP) for Facebook, Google, and Microsoft accounts. Having the IdP access token is great if you want to ...

Tailwind Photos: Registration (The Backend Resources)

September 03, 2019  13 minute read  

Over the last five blog posts, I’ve incorporated various social media authentication mechanisms and worked on silent authentication so that the user only ever has to log in once; if the user is logged in, they won’t ever see a sign in prompt. However, dealing with three distinct authentication mechanisms is not ideal. What happens when I add a fourth authentication type, or decide to do something custom like a username and password? Every time I use a new authentication scheme, my backend ...

Tailwind Photos: Silent Login

August 23, 2019  8 minute read  

Thus far in our story, we’ve covered Facebook, Google, and Microsoft authentication. There is one more to do - Twitter. Unfortunately, Twitter doesn’t have a nice vendor-provided SDK to do the work. In fact, Twitter is fairly hostile to app developers, so I decided to forego the Twitter login (sorry!). Instead, I’m going to cover the changes I made to support silent login. Up until now, everything has been in “managers” - one for each authentication provider. This has done all the work ...

Tailwind Photos: Microsoft Login

August 21, 2019  5 minute read  

Today, I am continuing with the authentication story for my app - Tailwind Photos - and tackling Microsoft authentication. The story so far: The Splash Screen Facebook Login Google Login You will see a lot of the same techniques as previous methods - just updated for todays topic. Let’s get started! The bright side of todays topic is that, with a few twists, you can use this same code if your app targets enterprise users. There is a point in the configuration where you need to s...

Tailwind Photos: Google Login

August 19, 2019  7 minute read  

Thus far in this series, I’ve established a decent splash screen and auth trigger page, and integrated Facebook authentication into my app. The next authentication technique is Google Auth. If you followed along with the Facebook auth integration, you will know that I separated the actual Facebook part of it into a separate class, allowing me to clean up the code in the actual activity. I also established provider-agnostic models for the authenticated user, which I will re-use in this post...

Tailwind Photos: Facebook Login

August 17, 2019  9 minute read  

In my last post on Tailwind Photos, I set up the splash screen and the buttons I want to use for signing in to the app - social media buttons for Facebook, Google, Microsoft, and Twitter. In this article, I’m going to go through the process of authenticating Facebook. The Facebook side of things All social media companies have their own methods for setting up authentication, and Facebook is no different. The instructions I have here are correct as of writing, but you should realize the ai...

Tailwind Photos: The Splash Screen

August 15, 2019  11 minute read  

I’m building a demo Android app that is sort of like Instagram, but with some new cloud features (which I will mention as I go along) and a different design to make it different. I plan to build this with the latest architecture for Android, in Kotlin, and learning a bunch of Android dev tricks along the way. As with everything, there is a start, and this is that post. I’m not going to tell you how to build your first Android app - there are plenty of tutorials on that. I’m just going to ...

Authentication with AWS Amplify and Android: Fraud Protection and Analytics

November 05, 2018  4 minute read  

This will be an in-depth series on authentication with AWS Amplify. Here are the topics I am going to cover, and I will update each blog with the links as I complete the articles. The basics - a username/password system. Customizing the UI. Authenticating with Facebook. Authenticating with Google. Using third-party authentication providers. Using Time-based One-time passwords (TOTP). Using Biometric authentication. Doing fraud protection and analytics. Over the last seven ...

Authentication with AWS Amplify and Android: Integrating Biometrics

October 29, 2018  8 minute read  

This will be an in-depth series on authentication with [AWS Amplify]. Here are the topics I am going to cover, and I will update each blog with the links as I complete the articles. The basics - a username/password system. Customizing the UI. Authenticating with Facebook. Authenticating with Google. Using third-party authentication providers. Using Time-based One-time passwords (TOTP). Using Biometric authentication. Doing fraud protection and analytics. This is the sevent...

Authentication with AWS Amplify and Android: Integrating TOTP

October 22, 2018  9 minute read  

This will be an in-depth series on authentication with [AWS Amplify]. Here are the topics I am going to cover, and I will update each blog with the links as I complete the articles. The basics - a username/password system. Customizing the UI. Authenticating with Facebook. Authenticating with Google. Using third-party authentication providers. Using Time-based One-time passwords (TOTP). Using Biometric authentication. Doing fraud protection and analytics. Over the last five...

Authentication with AWS Amplify and Android: 3rd Party OIDC Providers

October 15, 2018  10 minute read  

This will be an in-depth series on authentication with [AWS Amplify]. Here are the topics I am going to cover, and I will update each blog with the links as I complete the articles. The basics - a username/password system. Customizing the UI. Authenticating with Facebook. Authenticating with Google. Using third-party authentication providers. Using Time-based One-time passwords (TOTP). Using Biometric authentication. Doing fraud protection and analytics. In the last two ar...

Authentication with AWS Amplify and Android: Google Login

October 08, 2018  8 minute read  

This will be an in-depth series on authentication with [AWS Amplify]. Here are the topics I am going to cover, and I will update each blog with the links as I complete the articles. The basics - a username/password system. Customizing the UI. Authenticating with Facebook. Authenticating with Google. Using third-party authentication providers. Using Time-based One-time passwords (TOTP). Using Biometric authentication. Doing fraud protection and analytics. This is part 4 — a...

Authentication with AWS Amplify and Android: Facebook Login

October 01, 2018  8 minute read  

This will be an in-depth series on authentication with [AWS Amplify]. Here are the topics I am going to cover, and I will update each blog with the links as I complete the articles. The basics - a username/password system. Customizing the UI. Authenticating with Facebook. Authenticating with Google. Using third-party authentication providers. Using Time-based One-time passwords (TOTP). Using Biometric authentication. Doing fraud protection and analytics. This is part 3 — a...

Authentication with AWS Amplify and Android: Customizing the UI

September 23, 2018  9 minute read  

This will be an in-depth series on authentication with AWS Amplify. Here are the topics I am going to cover, and I will update each blog with the links as I complete the articles. The basics - a username/password system. Customizing the UI. Authenticating with Facebook. Authenticating with Google. Using third-party authentication providers. Using Time-based One-time passwords (TOTP). Using Biometric authentication. Doing fraud protection and analytics. This is part 2 - cus...

Authentication with AWS Amplify and Android: The Basics

September 18, 2018  11 minute read  

This will be an in-depth series on authentication with AWS Amplify. Here are the topics I am going to cover, and I will update each blog with the links as I complete the articles. The basics - a username/password system. Customizing the UI. Authenticating with Facebook. Authenticating with Google. Using third-party authentication providers. Using Time-based One-time passwords (TOTP). Using Biometric authentication. Doing fraud protection and analytics. I’m not going to cov...

Let your analytics drive engagement: Endpoint profiles with AWS Amplify and Android

September 11, 2018  6 minute read  

In my last article, I showed the current best way of integrating analytics into your Android app using Kotlin. The events are only half the story for engagement. You need to be able to segment your users so that you can send them appropriate signals to draw them back to your app. That means understanding your users — where they are, whether they have authenticated (and how), and what they are interested in. Amazon Pinpoint and the AWS Mobile SDK for Android provides some demographic informat...

Integrate Analytics into your Android applications with AWS Amplify

September 04, 2018  5 minute read  

I’ve become a big fan of Kotlin development for my Android apps. I also think that analytics should be integrated into every single app I write. I’ve covered integrating Amazon Pinpoint before via AWS Mobile Hub. Recently, AWS Amplify announced an updated CLI that provides support for native applications and bypasses the need to use the AWS web console for creating resources. Naturally, I wanted to try it out. Integrating analytics is now really easy. Here is how I do it: Start Local You do...

Native Android Development with AWS Amplify

August 27, 2018  5 minute read  

Up until this point, the experience for developing native iOS and Android apps with AWS has been a bit fragmented. There was AWS Mobile Hub; a web console that makes it easy to provision serverless cloud resources and get a configuration file back that describe the endpoints your app needs to communicate with. But because it is a web-based console, it requires the developer to switch back and forth between their local development machine and the browser. There is also the awsmobile CLI, but t...

Converting types with Room and Kotlin

August 08, 2018  5 minute read  

I’ve been working on a personal project, trying to get to grips with the various Android Architecture Components and Kotlin. One of the things I came up with was the requirement to deal with type conversion when using a SQLite database and the Room persistence library. Room is a nice abstraction to the internal SQLite database that converts models to tables within SQLite. It’s nice because it works alongside LiveData and RxJava to provide observable objects — when the database changes, the ob...

Implement Search-on-type in Android with RxJava

June 20, 2018  6 minute read  

I’m working on a new sample which, as is typical, communicates with a backend service for data through a serverless API. In this particular example, it’s a search capability that I am developing and one of the features I want to implement is “search while you type”. Not a problem, you might think. Just put a search box on the page (probably in the action bar), wire up the onTextChange event handler, and do the search. So, that’s what I did: override fun onCreateOptionsMenu(menu: Menu?): Boo...

Unit Testing in Android Studio with Kotlin

May 12, 2018  5 minute read  

I made myself a promise a couple of months ago. My next app would be fully unit tested for the non-UI components and fully instrument-tested for the UI components. That’s a tall order, especially since I’m using the latest and greatest Android Studio Canary. I ran into a few problems. Some can’t be solved and some can. Let’s start with a simple test. I’ve got a class that looks this: data class Note(val id: String = UUID.randomUUID().toString()) { var updated: Long = System.currentTimeMil...

Easy EditText content validation with Kotlin

April 11, 2018  3 minute read  

One of the things that I always deal with in my apps is the need to validate the input fields of a form. I can easily do this with this sample fragment of code (for example, for a length check): field.addTextChangeListener(object: TextWatcher { override fun afterTextChanged(s: Editable?) { val content = s?.text.toString() s?.error = if (content.length >= 6) null else "Minimum length = 6" } override fun beforeTextChanged(s: Editable?) { } override fun onTextChanged(s: Edita...

Using dependency injection with Koin

April 06, 2018  6 minute read  

In a recent post, I described how I can do app analytics by using the AWS Mobile SDK and an AWS Mobile Hub project. This is a great way to get usage analytics for your app, but it requires a tight coupling between the provider (the AWS Provider and AnalyticsClient) and the app. You need to initialize the provider early on (preferably in the Application wrapper or the first activity). That causes a tight linkage between the activities where it is used and the client object. This has several i...

Lessons in Kotlin: Toolbar Icons and Reflection

April 01, 2018  5 minute read  

There are many tutorials online on how to produce an Android app bar with an options menu — so much so that it can be boiled down to a few steps, and I’ll reproduce them here: Step 1: Create resources You actually need two resources. The first is a menu: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/mainActionCamera" an...

Lessons in Kotlin Threading: An Animated Splash Screen

March 29, 2018  2 minute read  

I find quite a lot of Android apps have splash screens. Some splash screens are for showing off the logo; others for hiding the extensive data load times. Whatever the reason, it’s a way for a little bit of creativity to shine through. My first effort My new app needs a splash screen. Splash screens aren’t hard until you need to do something that takes some time, and there are many tutorials on how to produce one out on the Internet. I’m going to focus on the one problem I had. Let’s take a...

Why I’m refactoring to Kotlin

March 21, 2018  5 minute read  

One of the things that is really cool about software development is that we are continually learning and adjusting. I spent a day recently learning Kotlin. I was so impressed with the language, I decided to refactor my entire Family Photos app. It did not take long. Why do I love Kotlin? I have to admit, I was skeptical at first. After all, I tried Swift for iOS as an alternate language and it felt foreign. Admittedly, Objective-C isn’t much better, but Swift definitely had some issues for ...

Back to top ↑

Azure

Create an App Registration for RBAC with PowerShell and Microsoft Graph.

January 19, 2024  5 minute read  

I’m currently working on some automation within Azure to deploy a hub-spoke web application. This web application authenticates with Entra ID using an App Registration and Role-Based Access Controls (RBAS) using App Roles. So, I need to create an app registration, enterprise app, and create the app roles.

Azure Mobile Apps: Supporting tables with int Id

December 22, 2023  14 minute read  

One of the persistent questions I get asked about Azure Mobile Apps is how to support older tables. Let’s say you have an older application that was never designed for mobile applications. It likely has a model like this:

Deleting Azure resources the right way.

July 12, 2023  3 minute read  

If you are an Azure developer, you likely spin up an application, do some work, then shut it down again. However, shutting down resources and deleting them has an order to them. If your service is network isolated (in a virtual network), then you can’t delete the application until the private endpoints are shut down. Budgets don’t get deleted with the resource group. Diagnostic settings can’t be deleted if the resource no longer exists. There is an order you should do things:

Purge Azure API Management soft-deleted services with ease.

January 20, 2023  4 minute read  

I work a lot with Azure API Management, which means I turn up and down services quite a few times a day. Azure API Management has an awesome feature that prevents you from accidentally deleting a service, called soft-delete. Instead of immediately deleting the service, it marks it as soft deleted and purges it later on. Unfortunately, that means that you can’t immediately reuse that service name. In production, this is a great thing to have. In development, it turns into a pain. That’s b...

Type-checking Bicep arrays and objects

November 28, 2022  3 minute read  

As you may have guessed by now, I’m delving heavily into the world of Bicep right now, mostly in order to describe the infrastructure for my personal projects in a readable way. JSON and YAML (used by ARM) is most definitely not readable for the average consumer. Part of that work was learning about bicep modules, which I love for modularizing my code. However, there is one distinctive problem with this.

Bicep, loops, and defaults

November 21, 2022  3 minute read  

I’ve been playing around a lot with bicep recently. I like it because it is much more readable than ARM templates and lets me modularize my deployments easily. Recently, I was writing a module for creating named values in Azure API Management. Here is my service.bicep:

Build a GraphQL API on Azure API Management using Bicep

October 10, 2022  5 minute read  

When I build a service in the cloud, I describe the infrastructure as a blob of code. There are lots of solutions out there for this. Azure has the Azure Resource Manager (or ARM), which has it’s own JSON or YAML format, for example. Terraform is cross-cloud capable, as is the Serverless Framework. Since I mostly work in Azure, these days, I’be been working more and more with Bicep for my Infrastructure as Code standard. Bicep uses declarative syntax to deploy Azure resources (much like ...

Building a serverless MUD infrastructure in Azure

August 25, 2022  12 minute read  

If you went to college back in the 1980’s or 90’s and studied computer science, then it is likely you bumped into the MUD (multi-user dungeon) craze. Back then, computer science was different. The primary languages were the languages of the day - Pascal and C were big. We had access to UNIX systems and would write text-based multi-user games that users would telnet into to get access. We didn’t have the web back then. I learned a lot from writing a MUD - from parser design to network comm...

Building repositories for Azure Mobile Apps with ASP.NET 6

November 12, 2021  7 minute read  

Over the last four days, I’ve delved into how to build a data sync service using Azure Mobile Apps on ASP.NET Core 6. I’ve covered the template, authentication, authorization, and logging. The basic setup is really good when you have a 1:1 relationship between the table and the DTO and you don’t need to do anything special, like support a non-EF Core ORM, or integrate real-time alerting. There are all sorts of reasons you don’t want to use the standard repository.

Logging and Options for Azure Mobile Apps with ASP.NET 6

November 11, 2021  2 minute read  

Over the past three articles, I’ve covered a lot of the ins and outs of a typical Azure Mobile Apps service. I’ve covered scaffolding, authentication, and complex authorization. There are just a few more topics to cover on the basic cases.

Controlled access for Azure Mobile Apps for ASP.NET Core

November 10, 2021  5 minute read  

In the last two articles, I’ve gone over how you can create a basic datasync service and add authentication to the service. What if you want to do something more complex? Authorization that is an on/off switch is reasonable as a first pass, but rarely allows you to handle the cases you actually need to implement.

Add authentication to Azure Mobile Apps for ASP.NET Core

November 09, 2021  3 minute read  

In my last article, I introduced the new ASP.NET Core edition of Azure Mobile Apps, including how to set up Entity Framework Core and in-memory stores. Today, we are going to introduce simple authentication. What do you need to do to secure your entire API? We’ll cover more complex authentication schemes (such as protecting a single API, or doing DTO transforms based on the identity of the user) next time.

Introducing Azure Mobile Apps for ASP.NET 6

November 08, 2021  8 minute read  

It’s release day for .NET 6, and I couldn’t be happier to introduce Azure Mobile Apps for ASP.NET 6 being released on the same day. When I started developing the new code-base, I had several aims:

Adding an API Key to Azure Mobile Apps with API Management

June 29, 2021  3 minute read  

I’ve written in the past that API keys are not security. They do not authenticate the app or user and they are easily interceptable (or extracted from distributed mobile apps). Despite that, that are good for a bunch of things, including figuring out which version of the app is being run, and ensuring that a certain version of the app you are running is using a specific backend or a specific set of policies. API keys are useful. I’m continually asked to support API keys.

Service Routing for Azure Mobile Apps with API Management

June 15, 2021  6 minute read  

Todays topic is “how do I upgrade the service backend to support the new ASP.NET Core service without affecting my current customers?” Let’s assume, for a moment, that I have already created an API Management service, and added caching to my API. Finally, I’ve adjusted the client application so everything is routing through the API Management service instead of direct to the backend.

Enabling caching for Azure Mobile Apps with API Management

June 11, 2021  7 minute read  

In my last article I introduced API Management and showed how it can be used to provide a front door to the REST API that is exposed by Azure Mobile Apps. What I implemented was a simple pass-through. It didn’t support authentication, and if a link was returned (for example, the “next-page” link in a query result),it pointed right back at the original source. It wasn’t much of an improvement. I’m going to change that today with a couple of improvements:

Using API Management with Azure Mobile Apps

June 08, 2021  6 minute read  

Over the years, I’ve been asked for several features within Azure Mobile Apps that I’ve been reluctant to support out of the box. Azure Mobile Apps provides a toolkit in the context of the Node.js and ASP.NET Framework environments, so you can - theoretically - provide a lot of this functionality yourself. You can also use external services to provide that functionality.

Choosing a hosting option for your web app in Azure

March 10, 2021  6 minute read  

Azure, like all the other clouds, has a plethora of mechanisms for getting your web site published. You have Static Web Apps, Azure App Service, Azure Blob Storage, Web Apps for Containers, and then there are the compute ones like virtual machines, and Azure Functions. It can be a little overwhelming. For this analysis, I’m going to assume you want to deploy a stand alone web site - either straight HTML, CSS, and JavaScript or a React, Angular, Vue, or similar app. I’m going to break it d...

Deploy your React app to Azure

April 04, 2020  7 minute read  

I’ve got to the point with my template where I am thinking about deployment options. There is already a great option (the gh-pages module) for deploying to a github.io site. However, I am going to be running most of my services on Microsoft Azure. I want to deploy my service automatically and copy the web application to a web site on Azure.

Back to top ↑

Cloud

Top Ten things to consider when taking your GraphQL service into production

November 07, 2022  9 minute read  

It’s a somewhat well-known facet of development that we don’t consider production problems until it is too late in the development cycle. When we look at taking a Web API into production, we use API management solutions to provide protection, control, and visibility into our APIs so that we ensure we don’t get woken up by a production outage. The things we need to consider are well understood in APIs in general, but what about GraphQL?

Building an efficient Logger in TypeScript

June 30, 2019  6 minute read  

Just about every project needs a logging system. In the early days of development, you need to output data to the console so you aren’t setting breakpoints in your code all over the place (or you are running the code in the browser, where breakpoints are more difficult). Later on, you want logging to let you know where people are spending their time, or how much usage a particular feature gets. It also helps with diagnosing problems early so that you can get ahead of the issues. There are...

Where do you start with GraphQL? I asked four engineers

February 06, 2019  6 minute read  

There has been a lot of discussion on GraphQL. In time, it may rank up there alongside REST as a defining protocol for client-server computing. It is at least trending that way right now. REST has got longevity going for it — years of top engineers thinking about the best ways to structure a REST-based API and thoughts on how to handle it. GraphQL hasn’t got the longevity. It does, however, have senior professional developers who constantly think about APIs and development in order to answer ...

What AWS service should you use to publish a web site?

January 31, 2019  4 minute read  

There are at least five different services you can use to publish a web site on AWS: Amazon S3 + Amazon Cloudfront AWS Amplify Console Amazon Lightsail AWS Elastic Beanstalk Do-it-yourself compute / storage / network stack Which one of these do you choose? Well, “it depends” is a great answer to this question, but I hope that this article will demystify the strengths of each choice and give you a roadmap to make a choice. This article is not designed for the person who knows a ...

Early return from GraphQL Resolvers with AWS AppSync

January 03, 2019  3 minute read  

I am currently developing a “reviews” app, written in React Native and using a suite of services surrounding AWS AppSync for the data backend. Yesterday, I ran into a problem. This is how I solved that problem. First, let’s take a look at the problem. I have a query that is submitted like this: { me { id name locations { totalCount } reviews { totalCount } favorites { totalCount } } } The query is used to generate a header on a “My Information” page. Eventually, I’...

Handling File Uploads with AWS AppSync

December 18, 2018  9 minute read  

GraphQL does not handle files. It may seem an obvious statement, but it needs to be said. GraphQL does not handle files. It handles structured data. Which isn’t to say that GraphQL does not have a role to play within file handling — just that the upload and download of files needs to be done outside the confines of GraphQL. In this article, I’m going to present one way that you can handle the upload and download of files whereby the URL of the files are presented via GraphQL using AWS AppSy...

Backend GraphQL: How to trigger an AWS AppSync mutation from AWS Lambda

October 26, 2018  14 minute read  

This blog will explore a technique that opens up a whole new world of possibilities for notifying clients of results within a serverless application. Let’s say you have built a nice mobile and web versions of a chat application that uses a GraphQL API built on top of AWS AppSync. Users authenticate with Amazon Cognito user pools Users table is stored in DynamoDB Changes to the users table are communicated to the app via subscriptions How does the users table get updated? A naive a...

Build a GraphQL Service the easy way with AWS Amplify Model Transforms

August 29, 2018  8 minute read  

Creating a functional GraphQL API is hard. You have to create a GraphQL schema, decide on authentication and database structures, implement the schema in a GraphQL service, wire up the authentication, hook up the database sources, ensure the whole thing is scalable, worry about logging and monitoring, and then write your app. AWS AppSync helps you with everything except the GraphQL schema and the app. Now, AWS Amplify is helping you with the GraphQL schema by introducing model transforms. Th...

How to deploy a GraphQL API on AWS with the Serverless Framework

August 14, 2018  8 minute read  

In previous posts, we’ve explored how to deploy a GraphQL service based on AWS AppSync and Amazon DynamoDB using AWS CloudFormation. The articles reinforce how automatic and repeatable deployments are central to moving towards a DevOps mindset. However, there are a few problems with the AWS CloudFormation template. The most notable issue is the inability to separate the schema and resolver mapping templates from the actual CloudFormation template. Overcoming this obstacle requires developers...

Build a GraphQL Weather API with OpenWeatherMap and AWS AppSync

July 20, 2018  6 minute read  

I love GraphQL even for the small apps. Generating a simple API allows me to change out back end details without re-compiling my front end. It also allows me to rotate API keys easily, handle authentication, and get in depth monitoring of the individual fields being used. So, naturally, when I am building a new weather app (don’t judge — everyone makes one), I naturally want to use a weather API based on GraphQL. Except there isn’t one. So I created one using AWS AppSync — a managed offline ...

Build a Universal Search API with GraphQL and AWS AppSync

June 19, 2018  5 minute read  

Have you ever looked at a feature of a mobile app and wondered how they do something? Me too! I like to figure out how they built those features and build them into my own apps. Take, as an example, universal search. You can find this sort of search box at the top of the Facebook app. So, how do they implement it? I’ve not seen their codebase, but I imagine it’s something similar to the following proof of concept. The schema I have a GraphQL API already built within AWS AppSync with the fol...

How developers can authenticate and authorize users with AWS AppSync

June 01, 2018  7 minute read  

AWS AppSync provides four distinct methods of authorizing users to optimize and restrict data being transferred AWS AppSync is a managed GraphQL data service that supports offline and real-time scenarios. The service allows the developer to optimize the data transfer between client and server. Any non-trivial application will need to authenticate users. It’s the only way to identify a distinct real person using the application. That association is required for private data storage and c...

Deploy an AWS AppSync GraphQL API with CloudFormation

April 17, 2018  15 minute read  

There are lots of tutorials about creating an AWS AppSync API from the ground up using the console. However, sooner or later, you are going to want to create an API for production. You could, just as simply, point-and-click your way around the console to produce the same API. However, that is fraught with problems. You can’t check that API into source code control, nor can you repeatedly deploy the API. Ultimately, you’ll want to automate your deployments. This article is about how you can ...

Building a service in the Cloud

May 08, 2017  7 minute read  

I’ve been thinking about providing services in the cloud for a few years now. A common question I see time and time again is this: “What pieces of the cloud do I need to build my solution?” The answer is always “it depends.” This post is about those options. A service – whether it be a mobile backend, web server or public API – generally has different kinds of content. A web site, for example, will have images, stylesheets and other static content. However, that same web site may als...

Back to top ↑

React Native

Bootstrapping a React Native App: A Comparison

December 10, 2018  7 minute read  

It’s been a while since I have worked on a React Native app. In that time, create-react-native-app (CRNA) has been deprecated, and expo-cli has taken its place as the advised route. There is still react-native init, and Infinite Red has ignite. That is four different ways of bootstrapping a React Native app. Before I continue, let me be clear on what I want: I want to use “best practices” in my app architecture - for state, communication with my AWS-based backend, navigation, and so on. ...

Creating a React Native bridge library

January 19, 2018  7 minute read  

React Native is really good at straddling the line between native and JavaScript. There is a bridge between the two that allows you to call native code from JavaScript. This is awesome for including things that require a special touch. Most React Native developers will never need to worry about the bridge because libraries exist to wrap a lot of the common native libraries that you see in Android and iOS. But what if you want to create a bridge library of your own? That’s a whole other effor...

AsyncStorage, TypeScript, and Async/await in React Native

August 21, 2017  4 minute read  

In the last few posts, I’ve been working on a Notes app in a master-detail pattern for React Native using TypeScript. This is the last post about that project. So far, I’ve: Worked out how to handle orientation changes. Worked out how to implement swipe-to-delete. Figured out the best way to use TypeScript. Integrated MobX for the Flux pattern. Fixed up the project for universal iOS apps. Finally written the Master-Detail pattern. That’s a lot of stuff. This last post is about...

Building a Master-Detail Pattern in React Native

August 16, 2017  5 minute read  

I’m in the middle of writing a simple Notes app in React Native. Thus far, I’ve: Worked out how to handle orientation changes. Worked out how to implement swipe-to-delete. Figured out the best way to use TypeScript. Integrated MobX for the Flux pattern. Fixed up the project for universal iOS apps. Now it’s time to get to the master-detail pattern itself. Master-Detail is a basic pattern that incorporates a list (the master) and a detail page. On phones (and tablets in portrait m...

Universal iOS Apps with React Native

August 14, 2017  less than 1 minute read  

This is one of those short “tip” posts. I was developing a nice React Native app and blogging about it. However, I bumped into a problem where my iOS simulator runs always appeared as if they were on an iPhone. If I ran the app on an iPad, it would still act as if it were on an iPhone. The fix for this is buried inside XCode. Open XCode and then open the .xcodeproj file, which is inside the ios folder of your project. Then click on the project name. You will see a section like this: Note...

Integrating React Native, TypeScript, and MobX

August 11, 2017  5 minute read  

In my last article, I psted about getting TypeScript working with React Native. I’m building a flexible, best-practices, Notes App in React Native. This means I need a backing store, and it has to be local for offline capabilities. React has a definite way of building data into the UI and the manipulation of that data is an architecture known as Flux. Flux isn’t a concrete implementation, however. Normally, I would use Redux as the concrete implementation. However, I have recently started wor...

Debugging React Native with TypeScript and Visual Studio Code

August 09, 2017  2 minute read  

One of the things I really miss from React Native was the support for TypeScript. TypeScript helps me immensely, but it really comes into its own with React programming as the PropTypes are specified for you (no more propTypes static). I’m also getting into MobX as a flux implementation and that uses decorators, which is native in TypeScript. There is lots to love in TypeScript. However, every single guide I saw for implementing TypeScript within React Native was flawed. Specifically, there ...

Implementing swipe-right on a React Native FlatList

August 07, 2017  6 minute read  

I’m progressing on my “master-detail” pattern for a react-native app. The actual implementation of master-detail is shockingly simple (more on that later). However, I bumped into some specific issues when I was implementing it. The first of these was covered last time – how to detect orientation changes in React Native. The next is this. How do I implement swipe-right so that I can add a swipe-to-delete function to a FlatList. Let me explain a little further. The latest edition of React Nati...

Handling orientation changes in React Native

July 26, 2017  3 minute read  

I’ve just returned to my JavaScript days and am trying to learn React Native again. One of the things I like to do is to produce a “perfect” app – one that will work on both tablet and phone in any orientation and that includes all the best practices. Things like my Notes App on Android, for example, took me off to learn content providers. React Native is no different. There are a bunch of things you just have to know. One of the things I want to do is to produce a single app that does maste...

Which is better - React Native or Xamarin Forms?

May 25, 2017  5 minute read  

Let’s talk about a loaded question. After my recent forays into both React Native and Xamarin Forms, I got asked on Twitter – which is better, React Native or Xamarin Forms? Further, I should answer this for JavaScript experts, C# XAML experts and for developers with experience in both. After all, both produce native apps and both use a common codebase. The Short Version There isn’t a clear winner here. If I am a JavaScript expert, I’ll gravitate towards React Native. If I’m a C# exper...

Back to top ↑

Tailwind Photos

Tailwind Photos: Registration (The Azure Function)

September 21, 2019  13 minute read  

A quick recap - we’ve got three identity providers integrated into our app, set up an Azure Functions App in our backend using ARM, and we’ve set up authentication on that function app. We’ve also swapped our identity provider authentication token for an Azure App Service authentication token so we can use it on our backend. Now it’s time to consider the actual Azure Function for registration. You want to store profile information in your backend. In my case, it allows me to communicate w...

Tailwind Photos: Registration (Authentication on Android)

September 15, 2019  7 minute read  

We are almost at the end of “registration and authentication” - and it’s been a seriously long way, which just goes to show the amount of complexity in the subject. Thus far, we’ve authenticated with Facebook, Google, and Microsoft, handled silent login and configured the backend resources. In the last article, we configured the backend resources to handle authentication, allowing us to swap a social identity provider token with a ZUMO token that we can use for further authentication. A...

Tailwind Photos: Registration (Authentication)

September 10, 2019  4 minute read  

In the last article, I introduced the resources necessary for my mobile backend, driven mostly by the serverless capabilities of Azure Functions. I also provided a mechanism for deploying the resources automatically using Azure Resource Manager (or ARM). Today, I want to look at the next step - authentication. In my Android app, I’ve already integrated the various identity providers (or IdP) for Facebook, Google, and Microsoft accounts. Having the IdP access token is great if you want to ...

Tailwind Photos: Registration (The Backend Resources)

September 03, 2019  13 minute read  

Over the last five blog posts, I’ve incorporated various social media authentication mechanisms and worked on silent authentication so that the user only ever has to log in once; if the user is logged in, they won’t ever see a sign in prompt. However, dealing with three distinct authentication mechanisms is not ideal. What happens when I add a fourth authentication type, or decide to do something custom like a username and password? Every time I use a new authentication scheme, my backend ...

Tailwind Photos: Silent Login

August 23, 2019  8 minute read  

Thus far in our story, we’ve covered Facebook, Google, and Microsoft authentication. There is one more to do - Twitter. Unfortunately, Twitter doesn’t have a nice vendor-provided SDK to do the work. In fact, Twitter is fairly hostile to app developers, so I decided to forego the Twitter login (sorry!). Instead, I’m going to cover the changes I made to support silent login. Up until now, everything has been in “managers” - one for each authentication provider. This has done all the work ...

Tailwind Photos: Microsoft Login

August 21, 2019  5 minute read  

Today, I am continuing with the authentication story for my app - Tailwind Photos - and tackling Microsoft authentication. The story so far: The Splash Screen Facebook Login Google Login You will see a lot of the same techniques as previous methods - just updated for todays topic. Let’s get started! The bright side of todays topic is that, with a few twists, you can use this same code if your app targets enterprise users. There is a point in the configuration where you need to s...

Tailwind Photos: Google Login

August 19, 2019  7 minute read  

Thus far in this series, I’ve established a decent splash screen and auth trigger page, and integrated Facebook authentication into my app. The next authentication technique is Google Auth. If you followed along with the Facebook auth integration, you will know that I separated the actual Facebook part of it into a separate class, allowing me to clean up the code in the actual activity. I also established provider-agnostic models for the authenticated user, which I will re-use in this post...

Tailwind Photos: Facebook Login

August 17, 2019  9 minute read  

In my last post on Tailwind Photos, I set up the splash screen and the buttons I want to use for signing in to the app - social media buttons for Facebook, Google, Microsoft, and Twitter. In this article, I’m going to go through the process of authenticating Facebook. The Facebook side of things All social media companies have their own methods for setting up authentication, and Facebook is no different. The instructions I have here are correct as of writing, but you should realize the ai...

Tailwind Photos: The Splash Screen

August 15, 2019  11 minute read  

I’m building a demo Android app that is sort of like Instagram, but with some new cloud features (which I will mention as I go along) and a different design to make it different. I plan to build this with the latest architecture for Android, in Kotlin, and learning a bunch of Android dev tricks along the way. As with everything, there is a start, and this is that post. I’m not going to tell you how to build your first Android app - there are plenty of tutorials on that. I’m just going to ...

Back to top ↑

JavaScript

Deploy your React app to Azure

April 04, 2020  7 minute read  

I’ve got to the point with my template where I am thinking about deployment options. There is already a great option (the gh-pages module) for deploying to a github.io site. However, I am going to be running most of my services on Microsoft Azure. I want to deploy my service automatically and copy the web application to a web site on Azure.

Add unit testing to your React app

April 02, 2020  9 minute read  

Thus far, in my journey to produce a customized toolchain for my React development, I’ve covered a lot of ground. See part 1 and part 2 for that coverage. I’ve come to the point where I need to discuss testing, which is a complex area. First, there are at least four types of testing you need to do: Unit testing is something you should be running on a regular basis - a series of tests that test each component to ensure that the functionality is correct from the outside. Integration te...

Add visual testing to your React app with Storybook

March 31, 2020  7 minute read  

In my last article, I started a React app from scratch, then integrated Parcel as the bundler, TypeScript for language support, SASS, ESLint for linting the code, and Stylelint for linting the style sheets. I didn’t include any testing capabilities, so that is next on my agenda. Let’s write a simple component to get started with testing. The component takes an “isBusy” flag. If it is true, then one icon is displayed. If false, a different icon is displayed. I’ll use text nodes in this v...

Building a React app with Parcel, Typescript, SASS, and ESLint

March 29, 2020  9 minute read  

create-react-app (CRA) is great for getting started super-fast. It has just about everything you need for building all but the most demanding apps. It is, however, opinionated in how things get set up, and I’ve been chafing at the limitations for a while.

Introducing Zwift Routes - my latest app

March 13, 2020  5 minute read  

I wrote an app for figuring out which routes I need to ride on Zwift so that I can collect a badge. It’s optimized for a phone device (since that is where I used it). You can use it for free. Where to get it. You can find it at Zwift Routes or http://bit.ly/zwiftroutes. Point your mobile phone browser to the site, then pin the site to your home screen. How to use it There are only two screens - the list screen and the details screen. At the top of the list screen is a menu button th...

Integrating Microsoft Login and MSAL with React and Redux

March 06, 2020  9 minute read  

I have a new app I am working on. It’s sort of a 1990’s style text MUD, but I’m bringing it “up to this century” with a host of new features. I’m writing the first front-end in React. So, what does a modern MUD app look like? Well, I’m not into storing usernames and password any more, so I’m going to use a Microsoft OAuth service instead of a user database. My front end application handles state through Redux. Configuring Redux I’ve got a store set up as follows: import { applyMiddlew...

Back to top ↑

React

Deploy your React app to Azure

April 04, 2020  7 minute read  

I’ve got to the point with my template where I am thinking about deployment options. There is already a great option (the gh-pages module) for deploying to a github.io site. However, I am going to be running most of my services on Microsoft Azure. I want to deploy my service automatically and copy the web application to a web site on Azure.

Add unit testing to your React app

April 02, 2020  9 minute read  

Thus far, in my journey to produce a customized toolchain for my React development, I’ve covered a lot of ground. See part 1 and part 2 for that coverage. I’ve come to the point where I need to discuss testing, which is a complex area. First, there are at least four types of testing you need to do: Unit testing is something you should be running on a regular basis - a series of tests that test each component to ensure that the functionality is correct from the outside. Integration te...

Add visual testing to your React app with Storybook

March 31, 2020  7 minute read  

In my last article, I started a React app from scratch, then integrated Parcel as the bundler, TypeScript for language support, SASS, ESLint for linting the code, and Stylelint for linting the style sheets. I didn’t include any testing capabilities, so that is next on my agenda. Let’s write a simple component to get started with testing. The component takes an “isBusy” flag. If it is true, then one icon is displayed. If false, a different icon is displayed. I’ll use text nodes in this v...

Building a React app with Parcel, Typescript, SASS, and ESLint

March 29, 2020  9 minute read  

create-react-app (CRA) is great for getting started super-fast. It has just about everything you need for building all but the most demanding apps. It is, however, opinionated in how things get set up, and I’ve been chafing at the limitations for a while.

Introducing Zwift Routes - my latest app

March 13, 2020  5 minute read  

I wrote an app for figuring out which routes I need to ride on Zwift so that I can collect a badge. It’s optimized for a phone device (since that is where I used it). You can use it for free. Where to get it. You can find it at Zwift Routes or http://bit.ly/zwiftroutes. Point your mobile phone browser to the site, then pin the site to your home screen. How to use it There are only two screens - the list screen and the details screen. At the top of the list screen is a menu button th...

Integrating Microsoft Login and MSAL with React and Redux

March 06, 2020  9 minute read  

I have a new app I am working on. It’s sort of a 1990’s style text MUD, but I’m bringing it “up to this century” with a host of new features. I’m writing the first front-end in React. So, what does a modern MUD app look like? Well, I’m not into storing usernames and password any more, so I’m going to use a Microsoft OAuth service instead of a user database. My front end application handles state through Redux. Configuring Redux I’ve got a store set up as follows: import { applyMiddlew...

Back to top ↑

ASP.NET

Azure Active Directory Authentication for Blazor WASM (Part 4: SignalR)

September 23, 2022  3 minute read  

I really thought I was through with Azure Active Directory! Honest! However, another key piece came up. My CloudMud is a real-time pub/sub application that uses SignalR. How do I authenticate to the SignalR connection? Well, like most things, there is a recipe. So let’s get to it.

Azure Active Directory Authentication for Blazor WASM (Part 3: Production)

September 03, 2022  12 minute read  

Recently, I’ve been working on integrating authentication with Azure Active Directory into my Blazor app. I’ve covered the server side and the client side, so what’s left? Well, firstly, I left “secrets” in my client app in the form of an appsettings.json file. They aren’t exactly secret values, but having specific values in there means I can’t have different values for different environments. Similarly, I can’t change those values over time - I have to re-build the app in order to change...

Azure Active Directory Authentication for Blazor WASM (Part 2: The Client)

September 02, 2022  7 minute read  

I’m in the middle of adding authentication to my Blazor WASM app. In the last article, I introduced the service side of things to consider when integrating Azure Active Directory authentication. It’s now time to complete the work by considering the Blazor WASM client. As there was last time, this is [well documented], but comes with some wrinkles when you consider bringing authentication into an app later.

Azure Active Directory Authentication for Blazor WASM (Part 1: The Server)

September 01, 2022  8 minute read  

Continuing my foray into Blazor WASM, I decided to tackle authentication. The Microsoft documentation has an excellent article on how to do this using the built-in tooling to create an AAD-enabled Blazor WASM application. However, I’m beyond the tooling at this point. My Blazor app is created. I need to augment the solution with the right code to enable authentication. I also want to make sure that I am not leaking secrets and the same code will work from development, through staging, to...

Building Stylesheets for Blazor with SASS

August 26, 2022  8 minute read  

As I mentioned in my last article, I’m building a cloud-based MUD using all the modern techniques that I have available to me. One of the things I decided was that I was going to use an ASP.NET Core application hosting a single-page web application written in Blazor and I’m going to be running that inside a Docker image so I can deploy it onto Azure Container Apps. Scaffolding the app out is easy:

Back to top ↑

Swift

Rounded corner panels and masks in SwiftUI

May 03, 2020  3 minute read  

I’ve been working on my UI developer skills recently (and I’ve done a few other posts about this as well). If you look at any of the recent design trends on Dribbble or UPLabs, you will see plenty of rounded corners. SwiftUI makes it simple to create rounded corners on all the corners - just add .cornerRadius(radius) as a modifier to the view. What happens when you only want a couple of corners rounded? For this, you need to dive into custom shapes and masks. Let’s set up a view to exper...

Handle location and geocoding with SwiftUI

November 05, 2019  5 minute read  

I’m continuing on my Weather app research in SwiftUI. My next problem is this: How do I get the current location (as a longitude / latitude) and a place (like a city) in my app such that the UI is updated when location updates happen? It turns out that this is a fairly easy problem, but it does come with some knowledge that you just have to know. Here is the list: How can I update the UI based on programmatic changes to the value? How can I listen for location updates? How can I c...

Create a bubble background in SwiftUI

November 02, 2019  3 minute read  

I’m continuing to explore SwiftUI, trying to recreate user interfaces that I see on design labs. The latest one is a task list app, found on Uplabs, and created by Rudi Hartano. I liked the design so I decided to replicate it from the Adobe XD file that he provided. One of the pieces he uses is a bubble background: The Adobe XD file shows me that I can use a linear gradient between two colors. However, there are also two slightly translucent circles on the top of it. If I were in Andr...

Why SwiftUI might just convert me to an iOS developer

October 31, 2019  9 minute read  

Confession time. I hated iOS development. First, there was Objective-C (which was a nightmare of epic proportions for cryptic syntax), then there was the Storyboards. Both of them forced you into using what is quite possibly the worst IDE on the market today (XCode), all so you could fit into the Apple ecosystem walled garden, where everything is controlled. Then Swift came along, so I took another look. I loved the direction that Swift was going, but Storyboards and the unintuitive IDE ...

Back to top ↑

Xamarin

Bottom Bar Tabs for your Xamarin Forms app

May 15, 2021  3 minute read  

Following on from last weeks article, I am continuing on my UI journey for my contacts app. My app design calls for a bottom app bar, with three sections - contacts, groups, and profile. The contacts and groups will be lists, and the profile will be a detail page for your own details with an editor.

Adding an icon font to your Xamarin Forms apps

May 09, 2021  5 minute read  

I’ve started building a new app using Xamarin Forms from scratch. The idea is that I have a list of contacts stored in the cloud. There isn’t anything revolutionary about that, but I’m going to allow sharing of specific lists with others. You could, for example, create a tag called “Cycling Buddies”, and then tag your friends with that. Everyone who subscribes to the same list gets the same information. Even better, you can “broadcast” your information to certain groups, allowing other p...

Which is better - React Native or Xamarin Forms?

May 25, 2017  5 minute read  

Let’s talk about a loaded question. After my recent forays into both React Native and Xamarin Forms, I got asked on Twitter – which is better, React Native or Xamarin Forms? Further, I should answer this for JavaScript experts, C# XAML experts and for developers with experience in both. After all, both produce native apps and both use a common codebase. The Short Version There isn’t a clear winner here. If I am a JavaScript expert, I’ll gravitate towards React Native. If I’m a C# exper...

Back to top ↑

Mobile

Learn to build mobile and web apps with AWS Amplify and Serverless Framework

October 02, 2018  3 minute read  

There has always been a bit of a problem between deploying your backend and then integrating that same backend with your front end code. The front end needs to know where the back end is located. The traditional approach is to create a configuration file for the purpose. But how? The AWS Mobile team created the awsmobile CLI and followed that with the AWS Amplify CLI. These tools are great for new projects. They provide for best practices deployment capabilities on the backend — and automati...

Testing Mobile Apps: A Primer

March 11, 2018  10 minute read  

Why should you test your mobile app? A recent study showed that almost a quarter of users only use a mobile app once, and a shocking 95% abandon an app within the first month. Some of the reasons that users abandon an app are due to content and engagement. The biggest non-content reasons for abandonment are application crashes and security concerns. No one can prevent all application crashes. The mobile ecosystem is too broad and unpredictable to provide a 100% guarantee. However, testing ens...

The Six Mobile Apps You Should Write

March 10, 2018  2 minute read  

Take a look at the mobile apps on the app stores and you will see patterns emerge. The same pattern is repeated time and time again. It’s crazy to think about this, but you only need to learn how to write six mobile apps that implement the common patterns. You can then pretty much write any app that is out there. Your First App: Notes or Task List There is a reason that just about every beginner tutorial uses the Todo app or the Notes app as the base. It’s a solid basic app that has a varie...

Back to top ↑

iOS

Universal iOS Apps with React Native

August 14, 2017  less than 1 minute read  

This is one of those short “tip” posts. I was developing a nice React Native app and blogging about it. However, I bumped into a problem where my iOS simulator runs always appeared as if they were on an iPhone. If I ran the app on an iPad, it would still act as if it were on an iPhone. The fix for this is buried inside XCode. Open XCode and then open the .xcodeproj file, which is inside the ios folder of your project. Then click on the project name. You will see a section like this: Note...

The things I like (and don’t like) about Swift?

June 19, 2017  6 minute read  

Recently, I’ve given myself the task of learning the “native” mobile development platforms. That means Java or Kotlin for Android and Swift or Objective-C for iOS development. Kotlin is a ways behind Java for Android development and I already knew (somewhat) the Java language, so that one was relatively easy. Swift is the new kid on the block, but it’s obviously the way to go for iOS Development.

Back to top ↑

Web

Run TypeScript Mocha Tests in Visual Studio Code

July 04, 2018  7 minute read  

I’m spending my July 4th getting back to basics and learning some data structures and algorithms. I’ve decided to do my stuff in TypeScript since it’s been a while since I’ve played with TypeScript and I wanted to see what has changed at the same time. This is not a blog post about how to do data structures and algorithms in TypeScript, JavaScript or any other language. If you are studying for an interview or classes, there are plenty of places on the Internet you can go to do that. Personal...

The React Toolbox - 2018 Edition

March 23, 2018  5 minute read  

It’s been a while since I’ve been in web development. I’ve mostly been concentrating on mobile development instead. But this week I had cause to delve again. It’s amazing how much change there has been in the web world in just 2 years. React has become the force in web frameworks (Sorry Angular — I never liked you anyway) and developers are starting to coalesce around libraries and tools that make their life easier. I thought I’d put down my thoughts on the libraries that are making it into m...

Back to top ↑

TypeScript

Reducing the deployment size of your JavaScript Azure Functions

January 12, 2020  1 minute read  

I’m doing some Azure Functions development in JavaScript at the moment, using the new azure-functions-core-tools. One of the features it has is command line publication, like this: $ func azure functionapp publish my-function-app I have a single function right now (called ping). Running the publish step creates a ZIP file: $ npx func azure functionapp publish my-function-app Getting site publishing info... Creating archive for current directory... Uploading 187.62 MB [##-...

Deploying an Azure Function App with Terraform

October 23, 2019  7 minute read  

You may have caught this from my previous blog posts, but I like automated deployments. I like something where I can run one command and magic happens, resulting in my whole deployment changing to a new state. I’ve recently been looking around at options for Azure, checking out Serverless Framework, Azure Resource Manager (ARM), and others. My favorite thus far has been Terraform. These are the instructions for deploying a basic Azure Function app with TypeScript code from start to finish.

Back to top ↑

Documentation

Documenting open-source projects

February 12, 2019  6 minute read  

Over the last 25 years, I’ve contributed to and written a lot of technical documentation, whether it is in the form of official documentation, blogs, tutorials, or books. Tech writers, who have nothing but access to engineers to work with, turn conversations into a guide that is equally suitable for a complete beginner and an expert. If you are an engineer, you definitely need to institute a “Tech Writer Appreciation Day”. That being said, learning research is rooted in psychology. The way w...

Back to top ↑

Flutter

Pre-build steps for Flutter using Visual Studio Code

February 20, 2020  2 minute read  

Flutter is not a build system. I know, it’s a terrible way to start, but you have to accept that you need to produce a build system for Flutter. There are build systems written in Dart (such as this one), and I’m sure this situation will get better, but right now? There isn’t a good build system. So I use the node package manager. Here is my basic flow: Run npm init -y. Edit the produced package.json file to use flutter under the covers. Run flutter with npm start instead of the ...

Back to top ↑

Entra

Create an App Registration for RBAC with PowerShell and Microsoft Graph.

January 19, 2024  5 minute read  

I’m currently working on some automation within Azure to deploy a hub-spoke web application. This web application authenticates with Entra ID using an App Registration and Role-Based Access Controls (RBAS) using App Roles. So, I need to create an app registration, enterprise app, and create the app roles.

Back to top ↑