The Learning Curve: Apple iPhone

I like to challenge myself when I can, and go a different direction with software or hardware than I’m used to. So this week, I broke from my decade-long Android trance and picked up an iPhone 7 Plus instead. Even Tina decided to make the switch. So we’re purely an iPhone family now.

As a former Android app developer, I felt just a bit more comfortable with an Android in my pocket, since I always had the option to code up anything that I need. However, it’s been years since I needed to write any code for Android, so I was inclined to try something new. It’s never good for an engineer to get complacent with their environment, so the switch sets the stage for another era of personal innovation for me.

So far, there have been a few trying moments while learning the differences, but it hasn’t been nearly as bad as I expected.

Pain Points

The biggest aggravation so far has been integrating the phones with Home Assistant‘s presence detection. I’ve been using the Nmap presence detection that’s built into HA, so I didn’t have install a third-party app on my phone. However, the iPhone’s visibility to HA is intermittent, at best. Of course, it’s possible that the iPhone is dropping from the WIFI network also. But that seems unlikely, given that I have multiple access points and a strong WIFI signal throughout my home. It’s a bit irritating for all the lights to go out while you’re cooking dinner, when both phones drop off of HA. I’ve had to temporarily disable some of HA’s automations until I can figure this out.

The fingerprint authentication method is a nice attempt at biometric security, but I have two issues. First, it doesn’t work many times for me. I inputted both of my thumbprints, and it fails to recognize either at times. Other times it works great, and it’s super convenient. My second issue – is it actually secure? I’ve been afraid to Google the answer, but one of these days I will.

Big Plusses

Wow, the camera. The multi-rear-facing-camera setup on the 7 Plus is impressive. The “live photos” are really rad also. But is it really the camera hardware that’s better, or is it the integration of software that works some post-processing magic on the images? I’m not convinced that software isn’t the culprit behind the remarkable images.

My previous Android, the Droid Turbo, was also an impressive machine. It never really glitched on me, the GPS worked perfect every time (contrary to my experiences with prior Samsung phones), and it was quite fast after fully booted. The iPhone, however, seems just a tad bit tighter in all those respects – just slightly, but I would definitely give it the edge.

I was initially concerned that there would be some software gaps, but every app I need has been ready and waiting for me on the app store. In fact, it seems like there is actually better app support on the iPhone, which surprised me.

AirPlay and AirDrop have proven much nicer, since I have all Apple hardware everywhere else. It casts nicely to my AppleTV and syncs quickly with my MacBook.

The Verdict

I can’t make assumptions about anyone else’s comfort levels or loyalties, and it’s too soon to tell what my long term opinion will be. However, at first glance, I say try it out if you’re thinking about switching. If you hate it, you’ll always have the opportunity to switch back in two years. And for the interim, it’s a totally usable phone.

Alexa + AWS Lambda Hello World in Javascript

Here is the Javascript version of my earlier tutorial Hello World in AWS Lambda + Amazon Alexa:

'use strict';

function buildResponsePayload( title, output, repromptText, shouldEndSession ) {
	return {
		outputSpeech: {
			type: 'PlainText',
			text: output
		},
		card: {
			type: 'Simple',
			title: 'alexaHelloWorld - ' + title,
			content: 'alexaHelloWorld - ' + output
		},
		reprompt: {
			outputSpeech: {
				type: 'PlainText',
				text: repromptText,
			},
		},
		shouldEndSession,
	};
}

function buildResponse( sessionAtts, speechResponse ) {
	return {
		version: '1.0',
		sessionAtts,
		response: speechResponse,
	};
}

function sayHelloWorld( callback ) {
	const sessionAtts = {};
	const cardTitle = 'alexaHelloWorld';
	const textOutput = 'Hello Javascript World';
	const shouldEndSession = false;

	callback( sessionAtts, buildResponsePayload( cardTitle, textOutput, textOutput, shouldEndSession ) );
}

exports.handler = ( event, context, callback ) => {
	try {
		sayHelloWorld( ( sessionAtts, speechResponse ) => {
			callback( null, buildResponse( sessionAtts, speechResponse ) );
		} );
	} catch( e ) {
		callback( e );
	}
};

Enjoy!