I love mobile apps. Apps give us the ability to perform tasks fast and on the go.
Fast and on the go...fast and on the go......fast and on the go.
As an app developer and as an app consumer, I feel that apps are not always that fast. When you pull your phone out of your pocket, you are looking to do something quickly. Think about it. We see ourselves pull our phone out of our pocket for 10 seconds at a time to check on something then we go back to what we were doing before. As an app developer, one of my passions has been to make apps as fast as possible to help my users get back to enjoying their life.
In order to make your mobile app fast, there is some work you need to do. (1) Your app needs to be quick to learn. (2) Your app needs to have a good UX to be able to complete tasks with as little clicks as possible. Those 2 items are reasonably easy to do. But there is 1 more piece you need to make an app as fast as possible: (3) Add offline support to your app. As far as offline support is goes, that task is difficult to code into an app compared to items 1 and 2.
(If you know what offline support is, go ahead and skip this paragraph) If you are not sure what "offline support" is, here is an overview. Have you ever opened an app on your phone while you were in airplane mode and you were still able to use it? You were still able to take photos, read text, or perform other tasks? That app has offline support. While your device is offline (in airplane mode), you are still able to use the app. Offline support is awesome because you are able to use the apps while you are offline and you are able to remove loading screens telling your user to wait (one of my favorite parts of offline support 😄).
Adding offline support to an app is hard
I have been building mobile apps for 5 years. Building an offline-first app has always been a difficult task. It's difficult because there are so many use cases to handle. It requires more code to get it working. It's simply easier to make apps that are not offline-first so building an app offline-first usually becomes a low priority.
Over the past few years, I have been asking myself, what makes adding offline support so hard? What excuses do I make to not add offline support when it is so important to add it to my apps?
Here are a few use cases that makes adding offline support to your app hard:
- When the user of your app performs a task in your app such as sending a message to a friend, adding an item to their to-do list, or taking a photo, how do you perform a sync with your app's remote cloud storage API to persist that task's data? What if the user's phone is in airplane mode? What if the user's WiFi connection is spotty and the API sync call fails?
- In the UI of your app, how do you show the sync status of a piece of data to your users? When someone adds an item to their to-do list in your app and their phone is in airplane mode, you need to show in the UI that a piece of data is not yet synced and is therefore "unsafe" as it's not persisted in the remote database yet.
- Error handling. What happens if your app user adds an item to their to-do list at 1pm on a Sunday afternoon while they are on an airplane in airplane mode. Then the plane lands at 7pm that night, your app attempts to save that to-do list item they added at 1pm but there is an error. How should you handle this error 6 hours later?! How do you show that error to the user and potentially have them fix it for you?
Wendy (Android version, iOS version) is a new Android and iOS open source library I created to help you make your app offline-first. The goal of Wendy is to make it so easy to make offline-first mobile apps it's stupid not to make your app offline-first.
What does Wendy do?
Wendy is a task runner. It facilitates the syncing of your app's local device data with your remote storage API.
Let me give you an example. Let's say you're the developer of a grocery list app. Your app users add grocery store items to the app and those items get saved to their account in your cloud storage API database.
Without Wendy, this is an example workflow for your app if a user adds "carrots" to their grocery list:
With Wendy, this is the workflow you would follow for your app instead to add "carrots" to the grocery list:
I believe the 2nd workflow is much more simple to follow. Plus you get some added benefits over the 1st workflow:
- No blocking UI telling the user to wait for the API to succeed.
- No more telling the user, "Please try again" error messages if a network call errors.
- All of the user's data is cached in the device's device database to be able to show the user later on when they come back to the app.
Your user will be able to open up your app, view their grocery list, add, edit and more items from their list at anytime with or without an Internet connection!
Wendy may be a newly released library of mine, but it's not a new project. I have been building it for the past 2 years with 2 apps of mine. I have continuously built, learned, iterated, and then repeat. I have learned a ton over the past 2 years on how to build offline-first mobile apps. Wendy is the result of that.
Wendy is used in 3 apps currently in production of mine. Keep in mind that Wendy is pre-1.0 at this time so the API will be changing here and there until the
v1.0 release, but I don't see major changes coming in the near future (never say never 😉).
I have this unwritten rule to myself to make all of my mobile apps offline-first. That is part of my values as an app developer. I believe every app should be offline-first. But yet, it's still a hard task to do.
I have set off to fix that. No more excuses. Add Wendy to your project, build offline-first mobile apps today.