Finding the Answers

Episode #45 of the Stack Exchange podcast featured Eric Lippert, who got some great advice from his first manager at Microsoft:

I want you to be a recognized industry expert on something. ... But don't pick something that's too big. ... Find a source of questions, answer every question that you know the answer to that is in that domain, and if there is a question that you not know the answer to, make it your business to find out.

This is why Eric Lippert answers so many Stack Overflow questions.

This is why everyone should be answering more questions and sharing their expertise. It makes you better at what you do.

iOS and Android Icon Sizes

Every once in a while, I have to tell a graphic designer all the sizes needed for iOS and Android icons. So I'm putting together a summary here for easy reference.

iOS

For more details on requirements and guidelines for iOS app icons, see iOS Human Interface Guidelines: Icons and Image Sizes and Technical Q&A QA1686: App Icons on iPad and iPhone.

All icons must be in PNG format with 24-bit color.

App Icons

For an app for iOS 7 and later, we need icon image files in these sizes:

  • 1024 x 1024
  • 512 x 512
  • 228 x 228
  • 180 x 180
  • 152 x 152
  • 120 x 120
  • 87 x 87
  • 80 x 80
  • 76 x 76
  • 58 x 58
  • 40 x 40
  • 29 x 29
  • 144 x 144 (if supporting iOS 6.1 or earlier)
  • 114 x 114 (if supporting iOS 6.1 or earlier)
  • 100 x 100 (if supporting iOS 6.1 or earlier)
  • 72 x 72 (if supporting iOS 6.1 or earlier)
  • 57 x 57 (if supporting iOS 6.1 or earlier)
  • 50 x 50 (if supporting iOS 6.1 or earlier)

iOS icons are opaque. Note that iOS will automatically round the corners and add the glossy shine effect when it displays the icon. You may want to pre-render the shine effect if you want more control over how it looks.

Toolbar, Navigation Bar, and Tab Bar Icons

  • Use pure white and transparent regions
  • Do not include a drop shadow
  • Use anti-aliasing

For toolbar and navigation bar icons, create images with these sizes:

  • 22 x 22
  • 44 x 44 (high resolution)

For tab bar icons, create images with these sizes:

  • 25 x 25
  • 50 x 50 (high-resolution)

For each toolbar, navigation bar, or tab bar icon, you may provide a single image, which iOS will treat as a template to generate unselected and selected appearances, or you may provide two images: one for the unselected appearance and another for the selected appearance.

Note that the sizes given for toolbar, navigation bar, and tab bar icons here are approximate. Images may be slightly larger or slightly smaller than these sizes. Give all icons in a bar a similar visual weight.

Apple Watch Icons

If the iOS app includes an Apple Watch app, the following icons are needed:

Notification Center Icons

  • 29 x 29 (38mm watch)
  • 36 x 36 (42mm watch)

Long Look Notification Icons

  • 80 x 80 (38mm watch)
  • 88 x 88 (42mm watch)

Home Screen Icon and Short Look Icon

  • 172 x 172 (38mm watch)
  • 196 x 196 (42mm watch)

Menu Icons

  • 70 x 70, with content size 46 x 46 (38mm watch)
  • 80 x 80, with content size 54 x 54 (42mm watch)

Watch Companion Icons

  • 58 x 58
  • 87 x 87

Android

App Icons

For an Android app launcher icon, we need PNG image files in these sizes:

  • 512 x 512 (Google Play)
  • 144 x 144 (xxhdpi)
  • 96 x 96 (xhdpi)
  • 72 x 72 (hdpi)
  • 48 x 48 (mdpi)

Note that Android app icons don't have to be square: the alpha channel can be used to create transparent areas, so an icon should have a distinct silhouette.

If the app generates notifications, then we need a 24 x 24 icon image. Notification icons must be entirely white except for transparent regions.

For more details on requirements and guidelines for Android app icons, see Launcher Icons and Iconography

Action Bar Icons

  • 96 x 96 (xxhdpi)
  • 64 x 64 (xhdpi)
  • 48 x 48 (hdpi)
  • 32 x 32 (mdpi)

Small/Contextual Icons

  • 48 x 48 (xxhdpi)
  • 32 x 32 (xhdpi)
  • 24 x 24 (hdpi)
  • 16 x 16 (mdpi)

Notification Icons

  • 72 x 72 (xxhdpi)
  • 48 x 48 (xhdpi)
  • 36 x 36 (hdpi)
  • 24 x 24 (mdpi)

REST Client Testing for Google Chrome

After years of using curl to test web interfaces, like cavemen did, I've finally started using more sophisticated tools.

There are a couple of applications for Google Chrome that I like:

They have similar feature sets. Postman is prettier and a bit easier to use, but Advanced Rest Client makes it easier to manipulate the response data.

Half Marathon Denied

I was supposed to run the Berry Half Marathon today. This would have been my first half marathon, and I've been training for the past two months to run it.

Unfortunately, the event was cancelled due to lightning and poor course conditions after several hours of thunderstorms. So all I got out of it was a very expensive t-shirt.

A Web Page for Reformatting JSON Text

After I published my OS X Automator Service for Reformatting JSON Text, one commenter said that he always uses http://jsonformat.com/. I have used that, but I hate the output it produces. Its output is more readable than JSON with all the whitespace stripped out, but not by much.

It also seemed a little silly for such a web page to require a back-end service to do the work. I figured I could whip up a simple web page that wouldn't require any server round-trips to do its work, and that produced reformatted output that wouldn't make me cry.

Here it is: JSON Reformatter

You can look at the source here: https://gist.github.com/kristopherjohnson/5073681

Enjoy!


Update 2014-05-29: New version, implemented using AngularJS: http://undefinedvalue.com/2014/05/28/web-page-reformatting-json-text-using-angularjs

An OS X Automator Service for Reformatting JSON Text

Note: This is an old post. I now use jq (http://stedolan.github.io/jq/) instead of the formatjson Node script described below, and I recommend that you do too.

I had some JSON files that were not indented consistently. I edit these files by hand, so I wanted a way to easily reformat them.

My text editor has a reformatting command, but I really hate what it produces, so I decided to make my own JSON reformatting service for OS X that I could use in any application.

Git GUI Clients for OS X

I have recently evaluated a few Git GUI apps for OS X. Here are my impressions.

iOS UI Automation Cheatsheet

I have just learned about Apple's UI Automation testing framework. Unfortunately, I don't have an iOS project to work on at the moment, so I am probably going to forget all about it. This is my cheatsheet. It may not help you at all.

Tutorials

Documentation

Tips

  • Use the Tuneup library: https://github.com/alexvollmer/tuneup_js
  • Assign an accessibilityIdentifier to each UI element.
  • Set UIATarget.onAlert to handle externally generated alerts.
  • Use UIAElement.logElementTree() to figure out how to navigate the visual hierarchy.
  • If a value doesn't change when expected, try adding UIATarget.delay(1);

Amazon Marketplace 5-Star Rating Extortion

I recently bought my wife a coat from an Amazon Marketplace seller. We are happy with the coat, but I was troubled when I saw this notice bundled with it:

Leave a 5-Star, Positive Review ~ Receive a Free One Year Warranty!*

Dear Valued Customer,

If you are COMPLETELY SATISFIED with this purchase, please RATE us 5 STARS and write a POSITIVE Customer Review on amazon.com within the next 7 days. This will activate your FREE ONE YEAR WARRANTY* and give you PRIORITY customer service.

[...]

*FREE ONE YEAR WARRANTY covers defects in material and workmanship. Merchandise may be returned for repair, replacement or store credit at company's sole discretion. To qualify for this warranty, customer must have left a 5-star rating and a positive customer review on amazon.com within 7 days of receipt of merchandise."

That's right: they offer a warranty that covers defects, but only if you help them sell their products to other unsuspecting customers. It's little wonder that they have an average 4.9-star rating.

This kind of gaming of rating and review systems really bugs me, so I contacted Amazon customer support. They told me that this is indeed a violation of their Marketplace policies, and that sellers who do this kind of thing can be banned from Amazon.

So, if you ever see something like this, go to http://www.amazon.com/gp/help/reports, select "Report a violation of our rules" and provide the details. Amazon will investigate and take appropriate action.

Also, leave the seller a one-star review. They deserve it.

"Takers"

There is one hot-button issue that will always draw me into a rant: the assertion that anyone who draws a paycheck from the government is a "taker" rather than a "maker".

My wife is a science teacher in a public school. She worked her way through college and obtained a Masters degree and a Ph.D. She could have taken a position in university academia, but decided she could do more good in a classroom with students.

She works in one of the wealthiest districts of one of the wealthiest counties in the state. She teaches the children of dentists, lawyers, and accountants who spend their weekends on the golf course complaining about being crushed by taxes and arguing about which model of BMW to buy this year.

She always works over 60 hours per week. She works harder than anyone I've ever seen in private industry.

Her pay has been cut by about 25% over the past five years. A big chunk of what income she has left goes toward buying supplies that the school system and parents won't provide.

She's a taker. She's a leech sucking society's blood. She should stop teaching science to children and go do something useful, right?

Syndicate content