My favorite Amazon Alexa commands

July 14, 2016

I don’t use my Amazon Echo for a lot of things, but there are a few that I find incredibly convenient because the experience is totally hands-free.

Seamlessly switch Spotify playback from a phone to Echo

“Alexa, play Spotify”

If you’re playing music from Spotify on a phone (or tablet/PC), you can seamlessly switch the music playback over to Echo’s speaker by simply saying “Alexa, play Spotify” (after setting up Spotify). Alexa will continue playing your music exactly where it left off, never skipping a beat. It will also continue to play your playlist, album, etc. after the song is over.

This is perfect for me when I’m in my apartment playing music on my phone and want to switch to a better speaker to fill my apartment with sound. It’s also perfect for when you were listening to music in the car and want to keep playing it when you walk in the door.

Identify a song on Pandora

“Alexa, what song is this?”

When a song catches your ear while listening to a song on Pandora using Echo (after setting up Pandora), simply say “Alexa, what song is this?” and Alexa will tell you the current song. It’s a great way to know what the current song is without having to pull out your phone.

Order stuff

“Alexa, order trail mix”

My first magical moment with Alexa came when I was standing in front of my kitchen cupboard and realized I was low on trail mix. I reached in my pocket to grab my phone, but then I paused. Although I had never tried it before and wasn’t sure if it was going to work, I said “Alexa, order trail mix.” Sure enough, Alexa looked in my Amazon order history to get the exact brand of trail mix that I like, read the price, and asked if I would like to buy it. After a quick confirmation virtual high five, the order was placed and I got an email confirmation a few moments later.

If you haven’t ordered a particular product type before, Alexa will respond with something like “Amazon’s choice for [product type] is [product name]…” and you can decide whether you’d like to buy the item sight unseen.

(By the way, if you have an Amazon Echo, is there really a need for an Amazon Dash Button?)

What else?

What are your favorite Alexa commands? Let me know on Twitter.

How to make a secondary tile resizable to wide and large tile sizes

July 14, 2016

A secondary tile is a live tile that an app can pin to a user’s Start menu or Start screen that deep links into a page in an app (ex: the specific flight for your trip home). Creating a secondary tile for a Windows 10 Universal Windows Platform (UWP) C#/XAML app using adaptive tiles is pretty straightforward, but by default the tile will only be resizable to small and medium tile sizes:

Small and medium secondary tiles

Solution

To make the tile resizable to wide and large sizes, specify the Wide310x150Logo and Square310x310Logo properties, like this:

secondaryTile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/WideLogo.png");
secondaryTile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/LargeLogo.png");

Make sure to add assets named “WideLogo.png” (310px x 150px) and “LargeLogo.png” (310px x 310px) to a folder named “Assets” in the project.

The full helper method would look something like this:

private static async Task<bool> PinSecondaryTileAsync(string id)
{
   // Check whether the secondary tile already exists.
   if (SecondaryTile.Exists(id))
   {
      return false;
   }

   // Create the secondary tile.
   var secondaryTile = new SecondaryTile(
      id,
      "Display name",
      id,
      new Uri("ms-appx:///Assets/Logo.png"),
      TileSize.Default);

   // Provide wide and large tile size assets.
   secondaryTile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/WideLogo.png");
   secondaryTile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/LargeLogo.png");

   // Returns true if the secondary tile was successfully pinned.
   return await secondaryTile.RequestCreateAsync();
}

Now, when the secondary tile is pinned, the tile can be resized to all sizes:

Small, medium, wide, and large secondary tiles

In order for the wide and large tiles to show content (like in the screenshot above), don’t forget to send a local tile notification or a periodic tile notification with the TileWide and TileLarge properties properly set.

Welcome to my blog!

July 14, 2016

I created this blog to share thoughts that can’t be captured in 140 characters, develop my writing skills, and learn more about web design and development (after a couple year break).

This blog runs on WordPress, styled with a simple and responsive theme that I developed on my own from the ground up.

The source code for my blog and personal website is available on GitHub.

Thanks for visiting, and let me know on Twitter what you’d like me to write about.