- How to Hire (Henry Ward) — this isn’t holy writ for everyone, but the clear way in which he lays out how he thinks about hiring should be a model to all managers, even those who disagree with his specific recommendations.
- From the Ground Up: Reasoning About Distributed Systems in the Real World (Tyler Treat) — When we try to provide semantics like guaranteed, exactly-once, and ordered message delivery, we usually end up with something that’s over-engineered, difficult to deploy and operate, fragile, and slow. What is the upside to all of this? Something that makes your life easier as a developer when things go perfectly well, but the reality is things don’t go perfectly well most of the time. Instead, you end up getting paged at 1 a.m. trying to figure out why RabbitMQ told your monitoring everything is awesome while proceeding to take a dump in your front yard. An approachable argument for shifting some consistency checks to application layer so the infrastructure can be simpler.
- 3D Printed Ceramics to 1700°C (Ars Technica) — The key step used in the new work is to replace the standard polymers used to create ceramics with a chemical that polymerizes when exposed to UV light. (These can have a variety of chemistries; the authors list thiol, vinyl, acrylate, methacrylate, and epoxy groups.) This means they’re able to be polymerized using a fairly standard 3D printer setup. In fact, the paper lists the model number of the version the authors bought from a different company.
- Guesstimate — spreadsheet for things that aren’t certain.
R GUI, Drone Regulations, Bitcoin Stats, and Android/iOS Money Shootout
- Deducer — An R Graphical User Interface (GUI) for Everyone.
- Integration of Civil Unmanned Aircraft Systems (UAS) in the National Airspace System (NAS) Roadmap (PDF, FAA) — first pass at regulatory framework for drones. (via Anil Dash)
- Bitcoin Stats — $21MM traded, $15MM of electricity spent mining. Goodness. (via Steve Klabnik)
- iOS vs Android Numbers (Luke Wroblewski) — roundup comparing Android to iOS in recent commerce writeups. More Android handsets, but less revenue per download/impression/etc.
Turning Hello World into something useful
When we last left our application, it was running on the emulator, but didn’t do much. This week, we’ll add some more controls to our activity and wire up some functionality.
As a reminder, activities are roughly equivalent to view controllers in iOS. Right now, there’s not much in our activity, because all we have is a single label in our activity. As iOS developers, we’re used to never looking at our XIB files in the raw, because they’re pretty much human-unreadable. By contrast Android layout files (which end up in the
res/layout folder in a standard Eclipse project) are both readable and intended to be edited. At the moment, here’s what ours looks like:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" /> </RelativeLayout>
Effectively combine characteristics and qualifiers for optimum layouts
DisplayMetrics Red Flag
A search of GitHub returns more than 42,000 hits for the class name
DisplayMetrics. This is a red flag. Although there are safe and valuable uses for this information, a quick look at the code using this class reveals that most programs query it to determine screen dimensions, using code like this:
DisplayMetrics displaymetrics = new DisplayMetrics(); ((WindowManager)context.getSystemService("window")).getDefaultDisplay().getMetrics(displaymetrics); int i = Math.max(displaymetrics.heightPixels, displaymetrics.widthPixels); sScreenNailSize = i / 2; sThumbNailSize = i / 5;
The programs then make decisions about how the program should present its user interface. This is dangerous, because it tempts the programmer to make decisions with awful long-range consequences, when these decisions should be left up to the Android run-time.
How to Break Lots of Apps in One Easy Step
How dangerous is it? Pull up a random app on your Android device, go to the Settings and select Font Size, then select Huge.
Now see how many apps break:
- How many have fixed-size views in their layouts where text overflows its bounds?
- How many “fixed” that bug by setting the font size, and ignoring your preferences?
- How many make incorrect layout decisions where objects don’t quite fit?
- How many lock the app’s UI to a landscape or portrait orientation?
When you make your own decisions, based on screen dimension and other parameters, about how to present the user interface, you enter a danger zone that spawns bugs that can easily escape detection in both automated and manual testing. If bugs are caught late in the game, they create pressure to implement lame fixes.
The Only Way To Win Is Not To Play the Game
Aren’t you forced to make decisions about presentation? The answer is “No.” You should not be asking “How high, how wide, how dense, what font,” etc.
You should let Android ask the questions and make decisions about presentation. The only question, then, is how many answers you need to provide. Using multiple layouts for different configurations, and avoiding fixed values in layouts, you can make a system of layouts and let Android choose which layouts to use for different screen sizes and orientations.
Tech events you don't want to miss
Each Monday, we round up upcoming event highlights from the programming and technology spaces. Have an event to share? Send us a note.
Modern Web Applications Utilizing HTML5 APIs webcast: Ido Green covers techniques and tools for building great “modern” web apps, including tips on Chrome DevTools, HTML5 power tools, and modern web app design techniques. Register for this free webcast.
Date: 10 a.m. PT, May 30 Location: Online webcast
TechEd North America: This is Microsoft’s main conference for IT professionals and enterprise developers. Get hands-on experience with more than 200 self-paced labs. If you need to convince your boss to let you go, there’s even a guide to help. For more information and to register, visit the TechEd website.
Date: June 3–6 Location: New Orleans, LA
Email Triage, Pulse Detection, Big Building Data, and Raspberryduino Ardpi
- Triage — iPhone app to quickly triage your email in your downtime. See also the backstory. Awesome UI.
- Webcam Pulse Detector — I was wondering how long it would take someone to do the Eulerian video magnification in real code. Now I’m wondering how long it will take the patent-inspired takedown…
- How Microsoft Quietly Built the City of the Future — The team now collects 500 million data transactions every 24 hours, and the smart buildings software presents engineers with prioritized lists of misbehaving equipment. Algorithms can balance out the cost of a fix in terms of money and energy being wasted with other factors such as how much impact fixing it will have on employees who work in that building. Because of that kind of analysis, a lower-cost problem in a research lab with critical operations may rank higher priority-wise than a higher-cost fix that directly affects few. Almost half of the issues the system identifies can be corrected in under a minute, Smith says.
- UDOO (Kickstarter) — mini PC that could run either Android or Linux, with an Arduino-compatible board embedded. Like faster Raspberry Pi but with Arduino Due-compatible I/O.
- RebelMouse — aggregates FB, Twitter, Instagram, G+ content w/Pinboard-like aesthetics. It’s like aggregators we’ve had since 2004, but in this Brave New World we have to authenticate to a blogging service to get our own public posts out in a machine-readable form. 2012: it’s like 2000 but now we have FOUR AOLs! We’ve traded paywalls for graywalls, but the walls are still there. (via Poynter)
- Data Visualization Course Wiki — wiki for Stanford course cs448b, covering visualization with examples and critiques.
- Peristaltic Pump — for your Arduino medical projects, a pump that doesn’t touch the liquid it moves so the liquid can stay sterile.
Internet of Zings, Public Domain Alternate Universe, Web Engineers Tools, and Dashboards for All
- Is It The Internet of Things? — we’ve moved from “they ignore you” to “they laugh at you”. Next up, “they fight you”, then finally the earless RFID-enabled location-aware ambient-sensing Network of All wins. (via BERG London)
- The 2012 We Could Have Had — list of famous and interesting works which would have entered the public domain had we not had the 1976 extension of copyright law.
- Web Engineer’s Online Toolbox — a list of online, Web-based tools that Web engineers can use for their work in development, testing, debugging and documentation.
- Indianapolis Museum of Art Dashboard — everyone should have a HUD showing the things they care about. (via Courtney Johnston)