Skip to main content

Posts

Showing posts from 2017

What's in a bothie?

I was recently asked in a review to talk a little bit about the technologies that drive my app, Bothie.

Bothie is an Android app that takes two pictures (a main photo from the main camera on your phone, and a selfie from the selfie camera), combining them into a single bothie.

Perhaps it’s time to write a little more about how Bothie slots together and which libraries and tools I use.

Bothie is a native Android app written in Java. I have been working on Bothie since 2014, and at the time Bothie was conceived, neither Kotlin nor the Architecture Components were available for Android. It has been a long road getting the app to where it is now, and without the help of existing libraries and SDKs it would have been almost impossible. Bothie stands on the shoulders of giants...


The camera preview you see in Bothie, for both images, is driven by Google's unofficial CameraView library. There were various choices for camera library available, and I've talked a little about them befo…

3 excellent ways to build trust with your users

"I don't see why it needs that permission!"
Android apps ask for unusual permissions sometimes, and they doesn't always make sense.
This article assumes that you are already a trustworthy developer. If you intend to harvest user details or conceal other nefarious activity on a user's device, please follow this link (US | UK) and then make your way to the nearest police station.
The Android permissions system doesn't know how to explain what it needs clearly, and some permissions lock away a group of features, when only one is needed.
For instance, this screengrab from a game demonstrates a fear response to a regularly requested permission. It was posted with the title:
"Quickest way to get your app deleted"
The app is asking for a permission called "make and manage phone calls". When the poster attempts to find out more, he reports that "it went to a screen that said the reason that needed this type of access was to provide me with rewar…

What is refactoring, and why have I got technical debt?

"It didn't used to be so expensive to change one little thing..."
Congratulations! You've put together a great team and steered the new project all the way to your first release. You've re-focussed on marketing, press releases, and you're doing some horizon scanning for new features...

Your lead developer comes to you with a serious request: She wants to refactor the project.
"What does that even mean?" you ask. The answer doesn't sound like it's worth your time - the app won't even change, but some of the wiring under the bonnet gets re-plumbed. So what? Mixed metaphors aside, it sounds like an expensive exercise that's not going to benefit you at all. Why should you bother?

It's time you learnt about technical debt.
All projects have technical debt. Technical debt increases the friction every time you want to modify your application to add a new feature or fix a bug. The amount of it you have is difficult to measure and takes effor…

Uplifting Bothie

Bothie has been a long time in development! I first created a demo app in 2014, and I've been revisiting the project regularly since then.

Bothie is an app to help you put yourself into your pictures. When you press the shutter button the first time, it takes a photo with the main camera. When you press it again, it takes another - this time with the selfie camera. Then it insets your selfie into your main photo, and lets you reposition, rotate, and zoom your pictures until you've made the perfect bothie.

Soon you'll be able to do a range of other exciting things to your pictures to create the perfect composition.

When I first published Bothie (through my company Front-Line Tech Ltd) in 2016, I quietly added it to the Play Store with no fanfare. I really wanted to develop it until I was completely satisfied with it before I launched it properly.

Since then, I've worked hard to add new features and modernise Bothie. I want it to stand out in its class as an elegant app, a…

Why are some projects so expensive? Need they be?

This article is adapted from a response I gave to the Reddit post for the Medium article "How I replicated an $86 million project in 57 lines of code" in r/coding...

The original poster, /u/javinpaul has written an article demonstrating an ANPR app - that can read number plates and compare them against an internally held database. The app itself works with a video feed from the phone's camera to process a video stream in real time.

First off, despite comments about his ego and a little name-calling, it isn't arrogant to demonstrate a working ANPR app that can operate on a live video feed, and ask why a similar looking project should cost as much as $86 million.

It is fair to say that any working solution to a problem like this cannot be as simple as a mobile app that can do ANPR. From a developer perspective that seems to be the hard problem, and a developer's instincts will tell her that that ought to be the most expensive part. It's easy to overlook everythi…

What's the best way to handle the Android camera?

This article is adapted from a response I gave on Reddit to the question "What's the best way to handle the camera?" in r/androiddev...

The Camera and Camera2 APIs are far from painless to use. If you've ever written an app that uses the camera (embedded in an activity or not), you've almost certainly come up against orientation issues, stretched previews, or weird quirks that change from manufacturer to manufacturer...

There are three good libraries out there that can save you from many common pitfalls:
Google's (unofficial) CameraView library.Mark Murphy's CWAC-Cam2 library.Dylan McKintyre's CameraKit for Android library. Each has different strengths. If you don't have time to read this whole article, here's a quick rule of thumb:
If you want to capture photos in a full-screen preview, but you don't want to have to rely on the native camera app, then use CWAC-Cam2.If you want to embed a preview into your Activity, use CameraKit. It's f…

Servicelib: for reliable Android Services

What is Servicelib?

Setting up Android Services, and binding to them isn't as straightforward as perhaps it could be. Servicelib is a library project that provides you with a number of classes to help simplify these tasks, and configure your service to run reliably in the background.

Android can destroy any Service or Activity at any time to relieve memory constraints - but this Service will hint strongly that the user has an interest in it running uninterrupted, and requests to Android that it restart as soon as conditions are favourable again. The Service will run if any activities are bound to it or not, and will start on boot.

Servicelib also provides you with an abstract Activity class that automatically binds to the Service whenever it is in use, and unbinds when it is not. This gives you access to the Service as if it were just another POJO from your Activities. The Activity can also request permissions for your app, and provides helper methods to determine if all the requi…