Because Developers are Awesome - page 8

Recent posts

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...

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...

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...

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 ...

The three ways to execute a GraphQL query from React with AWS AppSync (and how to choose)

January 15, 2019  5 minute read  

AWS AppSync is a managed GraphQL service that can (and probably should) act as the data layer for your app. I want to take a look at how you can send a query to AWS AppSync from your React (or React Native) app. You have three basic choices: Include a query within a component using AWS Amplify. Wrap your query in the Connect component using AWS Amplify. Use the Apollo Client with the AWS AppSync SDK. Which do you choose depends on what your needs are. There is no “one size fits all”...

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’l...

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...

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. ...