Does Library Bloat Make Your Smartphone App Look Fat?

While earlier smartphones seemed to manage well enough with individual applications that only weighed in at a few megabytes, a perusal of the modern smartphone software store uncovers some positively monstrous file sizes. The fact that we’ve become accustomed to mobile applications requiring 100+ MB downloads on what’s often a metered Internet connection in only a few short years is pretty crazy if you stop to think about it.

Seeing reports that the Nest app for iOS tipped the scales at nearly 250 MB, [Alexandre Colucci] decided to investigate. On his blog he not only documents the process of taking the application apart piece by piece to find out just what’s eating up all that space, but lists some potential fixes which could shave a bit off the top. Even if you aren’t planning a spelunking expedition into your pocket supercomputer’s particular variant of the Netflix app, the methodology and tools he uses here are fascinating in their own right and might be something worth adding to your software bag of tricks.

By passing the application’s files through a disk usage visualizer called GrandPerspective, [Alexandre] immediately identified some rather large blocks of content. The bundled Apple Watch version of the app takes up 23 MB, video and audio used to walk the user through the device setup weigh in at 22 MB, and localization files for various languages consumes a surprising 33 MB. But the biggest single contributor to the application’s heft is the assorted libraries and frameworks which total up to an incredible 67 MB.

Of course the question is, how much of it is really necessary? It’s hard to be sure from an outsider’s perspective, but [Alexandre] notes that a few of the libraries used seem to be redundant or obsolete. In some cases this could be the result of old code still lurking in the project, but the four different libraries used for user tracking probably aren’t in there by accident. It also stands to reason that the instructional videos could be offloaded to something like YouTube, so that only users who need to view them have to expend their bandwidth on it.

Getting a little deeper into things, [Alexandre] notes that some of the localization images appear to be redundant. As a specific example, he points to the images of the Nest itself displaying Fahrenheit and Celsius temperatures. While logically this should only be two image files, there are actually eight copies of the Celsius image, each filed away as language-specific. These redundant localization images could easily be stripped out, but with gains measured in only a few hundred kilobytes, it probably wasn’t considered worth the effort during development.

In the end there’s really not as much bloat as we might like to believe. There were some redundant files, maybe a few questionable library inclusions, and the Apple Watch version of the app could surely be separated out. All together, it might get you a savings of 30 – 40%, but still not enough to bring it down under 100 MB.

All signs point to the fact that modern smartphone software development is just a lot more burdensome than us hackers might like. Save for projects looking to put control back into the hand’s of the users, it looks like mobile operating systems aren’t going to be slimming down anytime soon.

Can Magnets Replace The Spring In A Pogo Stick?

Betteridge’s law of headlines states that any headline that ends in a question mark can be answered by the word ‘no’. It’s the case with articles asking if Millennials are responsible for all of the world’s ills, or if some technology is the future. So we come to this fascinating case of native content (amusing, veiled advertising) from a store that sells really, really powerful magnets. The title of the article asks if magnets can replace the spring in a pogo stick. The answer, of course, is no, but it does provide a fascinating look at linear versus exponential growth.

A pogo stick is simply a spring with a set of handles and footholds that is the subject of a great number of hilarious YouTube videos, at least one of which is impressive. The physics of a pogo stick is determined entirely by Hooke’s Law, and is a linear equation, not counting the strength of a spring and the yield point of steel, but this is a pogo stick we’re talking about. Magnets, on the other hand, obey the inverse square law. Is it possible to fit an exponential function to fit a linear function? No. No, it is not.

I refuse to believe this is the first use of the phrase, ‘immensely disappointing pogo stick’

But a lack of understanding of the basic forces of nature never stopped anyone, so the folks at K & J Magnetics made a really neat test. They printed out a 1/8th scale pogo stick, complete with a spring. It worked like any pogo stick would. Then they took out the spring and put a few magnets where the spring should go. How did that work? Well, it bottomed out and was an immensely disappointing pogo stick.

If a problem is worth solving, it’s worth solving wrongly, so more magnets were added. Mounting three magnets onto a pogo stick gave the same exponential force, but still not enough. Four, five, and six magnets were added to the model pogo stick, and while six magnets gave this model pogo enough force to be ‘bouncy’, there simply wasn’t enough space for the pogo stick to compress.

The takeaway from this experiment is extremely obvious in retrospect, but probably too subtle for a lot of people. There’s a difference between a linear relationship and and exponential relationship. There’s also a video, you can check that out below.

Continue reading “Can Magnets Replace The Spring In A Pogo Stick?”

Tired Of Killing Houseplants? Try Using WiFi.

Here at Hackaday, we have to admit to neglecting a few houseplants in our time. Let’s face it… a cold, hard, thinking machine can care for our green friends better than you can. Why not team up? [cabuu]’s WiFi-enabled soil moisture sensor will do the trick in case you, too, want happy plants.

This is one of those projects which would have been much more difficult even five years ago, and really shows how lucky we are to have accessible technology at our fingertips. It’s conveniently constructed from off-the-shelf electronics modules, and nestled inside a 3D-printed case. The design is attractive as well as functional, showing the status LED and allowing access to the USB charging port.

The brain is a WeMos D1 mini, while a D1 battery shield and 14500 Li-ion battery supplies power. A key point of this build is the use of a capacitive moisture sensor, which doesn’t suffer the same long-term corrosion problems that destroy cheaper resistive probes. And no project is complete without an LED, so a WS2812 shows green for good, red for dry and blue for too wet. To extend battery life, the sensor supports a sleep mode, which tests the soil periodically, and presumably disables the LED.

Of course, if you’re a habitual plant-neglector, simply having a moisture probe won’t help; those can be as easy to ignore as the plant itself. That’s where WiFi comes in. [cabuu] wrote a Blynk app to monitor the sensor on a smartphone. The app shows current moisture levels and allows you to change the wet and dry warning thresholds. When the reading exceeds these levels, the app notifies you — this feature is the one that will keep your plants around.

Continue reading “Tired Of Killing Houseplants? Try Using WiFi.”

Hacker Makes A Flawless Booby Trap, Strikes Back Against Package Thieves

[Mark Rober] was fed up with packages going missing. He kept receiving notifications that his shipments had been delivered, but when checking his porch he found nothing there. Reviewing the CCTV footage revealed random passers-by sidling up to his porch and stealing his parcels. It was time to strike back. Over six months, [Mark] and his friends painstakingly designed, prototyped and iterated the perfect trap for package thieves, resulting in a small unit disguised as an Apple HomePod. The whole scheme is wonderfully over-engineered and we love it.

The main feature of the device is a spinning cup on the top which contains a large amount of glitter. When activated, it ejects glitter in every directions. You could say it’s harmless, as it’s just glitter. But then again, glitter has a way of staying with you for the rest of your life — turning up at the least expected times. It certainly leaves an emotional impression.

Activation is quite clever; the fake package sits on the porch until an accelerometer detects movement. At that point, GPS checks to see if the package has traveled outside a geo-fence around [Mark]’s house. A signal is then sent to the four smartphones to start recording — yes, that’s right, there are 4 phones inside, one on each side to capture the reaction of the thief.

How can [Mark] be so confident that he’ll be able to recover the four phones and their footage? That’s answered by GPS tracking and a can of fart spray actuated by a 3D printed cam and DC motor, ensuring the thief won’t want this package around for long. This actuator and the glitter motor are controlled by a custom PCB, which also triggers the phones to start recording through their headphone jacks and detects the opening of the package with some microswitches. This is truly a masterpiece that outsmarts the package thieves in a way that leaves an impression while still being playful.

(Editor’s Note 2: On 12/20/18 it was announced that two of the five thieves shown in the originally video were staged, apparently without [Mark Rober’s] knowledge. Here is his statement on the matter.)

(Editor’s Note 1: [Sean Hodgins] wrote in with bonus video on how the Glitter Bomb works and how it was made.)

If booby traps are your thing, we’ve got you covered. Check out this ticking bomb style puzzle, or this crate challenge which is rigged to blow.

Continue reading “Hacker Makes A Flawless Booby Trap, Strikes Back Against Package Thieves”

Welcome Our New Insect Overlords With Arduino-Powered Ant Bot

Walking robots come in many forms, and each presents their own unique challenges. Bipedal style locomotion is considered particularly difficult to do well, however designs with more legs offer certain advantages. Hexapods offer the possibility of keeping several legs on the ground while others move, providing a useful degree of stability. [How To Mechatronics] developed this ant robot, which is an excellent example of the form.

The hexapod has as the name suggests, six legs, each of which consist of 3 joints. This necessitates 3 servos per leg, for 18 servos total just for locomotion. Further servos are then used to control the abdomen, head, and mandibles. This gives the robot strong ant credentials, above and beyond being simply a 3D printed lookalike.

Brains come courtesy of an Arduino Mega, chosen for its ability to control a large number of servos. A custom PCB is printed as a shield to ease the connection of all the necessary hardware. An HC-05 Bluetooth module is used for communication with an Android app, which controls the ant. The piece de resistance is the ultrasonic sensors in the head, which allow the ant to automatically defend itself against predators that get too close.

It’s an involved build, requiring plenty of 3D printing and over 200 fasteners. Fundamentally though, it’s a fully working and tested hexapod build with full plans available for download, ready to toil in your underground sugar caves.

If your hexapod tastes skew more anime than insectoid, check out this Ghost in the Shell build. Video after the break.

[Thanks to Baldpower for the tip!]

Continue reading “Welcome Our New Insect Overlords With Arduino-Powered Ant Bot”

Arduino One Pixel Camera Sees All (Eventually)

Taking pictures in the 21st century is incredibly easy. So easy in fact that most people don’t even own a dedicated camera; from smartphones to door bells there are cameras built into nearly electronic device we own. So in this era of ubiquitous photography, you might think that a very slow and extremely low resolution camera wouldn’t be of interest. Under normal circumstances that’s probably true, but this single pixel camera built by [Tucker Shannon] is anything but normal.

Continue reading “Arduino One Pixel Camera Sees All (Eventually)”

ULTIMATE – A Useful Tool For File System Hacking

Whether you’re at the hobbyist level or a professional, if you’re working on code for operating systems or file systems, tools can make or break the job. [Ben Lunt] is an enthusiast hacker himself, and found that over time, a series of useful utilities had proliferated beyond reasonable management. It was time to solve the problem – enter ULTIMATE.

ULTIMATE is a combination of a wide swathe of file system hacking tools that [Ben] had developed over the preceding years. Capable of dealing with most FAT variants, Ext4, ISO, [Ben]’s own FYS FS as well as other Linux ephemera, it enables a wide variety of common tasks to be executed from within a single program.

Capabilities of the tool are wide ranging. Files can be inserted into and removed from image files, boot records can be altered, and there’s even the ability to tinker with GPTs for UEFI-based systems. [Ben] has also experimented with the concept of the eMBR – an extended Master Boot Record with greater functionality for larger, modern hard drives.

ULTIMATE is a testament to [Ben]’s broad file system knowledge, and could likely serve useful to many hackers in the file system and OS community. Just be cautious, though – the software is still in an early stage of development. If you’re just getting started in this particular realm of tinkering, take our primer on file system forensics.