Tuesday, December 18, 2018

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.



from iphone hacks – Hackaday

Tuesday, November 20, 2018

[Ben Krasnow] Gasses MEMS Chips, for Science

Why in the world does helium kill iPhones and other members of the Apple ecosystem? Enquiring minds want to know, and [Ben Krasnow] has obliged with an investigation of the culprit: the MEMS oscillator. (YouTube, embedded below.)

When we first heard about this, courtesy in part via a Hackaday post on MRI-killed iPhones, we couldn’t imagine how poisoning a micro-electromechanical system (MEMS) part could kill a phone. We’d always associated MEMS with accelerometers and gyros, important sensors in the smartphone suite, but hardly essential. It turns out there’s another MEMS component in many Apple products: an SiT 1532 oscillator, a tiny replacement for quartz crystal oscillators.

[Ben] got a few from DigiKey and put them through some tests in a DIY gas chamber. He found that a partial pressure of helium as low as 2 kPa, or just 2% of atmospheric pressure, can kill the oscillator. To understand why, and because [Ben] has a scanning electron microscope, he lapped down some spare MEMS oscillators to expose their intricate innards. His SEM images are stunning but perplexing, raising questions about how such things could be made which he also addresses.

The bottom line: helium poisons MEMS oscillators in low enough concentrations that the original MRI story is plausible. As a bonus, we now understand MEMS devices a bit better, and have one more reason never to own an iPhone.



from iphone hacks – Hackaday

Wednesday, October 31, 2018

Helium can Stop Your iPhone — Maybe Other MEMS, Too

Sometimes hacking isn’t as much about building something, it’s about getting to the root of a particularly difficult problem. [Erik Wooldrige] was facing a problem like that. He’s a system specialist at a hospital near Chicago. Suddenly a bunch of iPhones and Apple watches were failing or glitching. The only thing anyone could think of was the recent install of an MRI machine.

Sure, an MRI machine can put out some serious electromagnetic pulses, but why would that only affect Apple products? Everything else in the hospital, including Android phones, seemed to be OK. But about 40 Apple devices were either dead or misbehaving.

It took some detective work, but they think they know what was the cause. The MRI machine uses liquid helium to cool its powerful magnets. Turns out the helium had leaked and over 5 hours about 120 liters of liquid helium vented into the air. Helium is notoriously hard to contain because, like hydrogen, it is a tiny little atom even by atomic standards. It also expands about 750 times when it turns into a gas, according to the post’s analysis.

Gathering more data, they found that many of the phones would eventually recover and that all the devices were at least an iPhone 6 or an Apple Watch. So even older iPhones seemed to be immune. Some speculated that the helium is small enough to get into the MEMS devices like the accelerometer or gyroscope that is in most modern phones and affect its operation. But why would that effectively brick phones? And why wouldn’t that affect most phones Android or otherwise?

The best theory — and it seems plausible to us — is that Apple stopped using quartz crystals for the phone’s internal clocks. Instead, they are using MEMS oscillators from a company called SiTime. Supposedly the MEMS oscillators are smaller and work better at temperature extremes. If the mechanical clock element got gummed up with helium, that would explain all the observed evidence.

[Erik Wooldrige] reading about the issue on Reddit, did an experiment where he subjected an iPhone to helium in a plastic bag. Granted, this is a lot more concentration of helium than the hospital probably got. but they also had five hours of exposure. In the video, below, you can see Erik’s phone stopped keeping time just after the three-minute mark on the video, eight and a half minutes of exposure.

It turns out if you read the iPhone user’s guide it reportedly says:

“Exposing iPhone to environments having high concentrations of industrial chemicals, including near evaporating liquified gasses such as helium, may damage or impair iPhone functionality. … If your device has been affected and shows signs of not powering on, the device can typically be recovered. Leave the unit unconnected from a charging cable and let it air out for approximately one week. The helium must fully dissipate from the device, and the device battery should fully discharge in the process. After a week, plug your device directly into a power adapter and let it charge for up to one hour. Then the device can be turned on again.”

Apparently, SiTime also is aware of this problem and says its newer devices are “impervious to all small-molecule gasses.” But they admit older parts were not immune.

Unless you spend a lot of time blowing up balloon animals, this probably won’t affect you. Still, we thought it was an interesting piece of detective work and one of those things that you might remember in a few years when you have some wacky failure in your blimp fleet. Of course, we were supposed to be running out of helium, so if that were true, this problem would eventually take care of itself.

 

 



from iphone hacks – Hackaday

Saturday, September 22, 2018

Wonderful iPad Mini 2 Home Made Spiral Notebook Case

Part of the joy of hacking is the joy of discovery, of seeing how things go right as well as wrong. That’s one cool thing about this iPad Mini 2 case build by [Eric Strebel]: in the video, he details the things that went wrong as well as those that went right. For instance, he used glue on one version that melted the foam core he built the iPad holder from. The end product is wonderful, though. It combines an iPad Mini 2 case and a spiral-bound notebook so you can use both digital and paper mediums, with the iPad cleverly hidden behind a panel that both protects it and turns the screen off when not in use.

The case is made from a Pentalic 7 x 10 wire-bound sketchbook, with some of the pages removed. These are replaced by an iPad holder made from foam core and matte board, which should protect the iPad from drops and knocks. A notch at the bottom allows for a charging cable, and an additional notch at the top lets you lift out the iPad if needed.

It’s a great, clean build that looks as good as a commercial case, and is more practical. I love the idea of combining an iPad with a sketchbook with removable paper pages: sometimes, you just need that feel of pen or pencil on paper to work. My only suggestion for improvement might be a couple more indentations at the bottom of the iPad holder to allow the sound to escape from the speakers a little better.

We’ve seen lots of cool projects from [Eric Strebel] before, including his molded Atari 800XL case restoration and his home-made wireless charger, so his YouTube channel is well worth subscribing to.



from iphone hacks – Hackaday

Sunday, August 26, 2018

You Can Add Wireless Charging to iPhone… Kinda

We could watch cellphone teardown videos all day long. There’s something pleasing about seeing how everything is packed into such a small enclosure. From the connectors, to that insidious glue, to the minuscule screws, [Scotty Allen] has a real knack for giving us a great look at the teardown process. Take a look at his latest video which attempts to add wireless charging to an iPhone. I think there’s a lot to be said for superb lighting and a formidable camera, but part of this is framing the shots just right.

Now of course we’ve taken apart our fair share of phones and there’s always that queasy “I think I’m going to break something” feeling while doing it. It’s reassuring that [Scotty] isn’t able to do things perfectly either (although he has the benefit of walking the markets for quick replacement parts). This video is a pretty honest recounting of many things going wrong.

The iPhone 6 and 7 are not meant to have wireless charging, but [Scotty’s] working with a friend named [Yeke] who created an aftermarket kit for this. The flexible PCB needs to be folded just right, and adhesive foam added (along with a magical incantation) to make it work. That’s because the add-on is a no-solder job. Above you can see it cleverly encircles one of the mating connectors and relies on mechanical pressure to make contact with the legs of that connector. Neat!

In the second half of the video [Scotty] meets up with [Yeke] to discuss the design itself. We find it interesting that [Yeke] considers his work a DIY item. Perhaps it’s merely lost in translation, but perhaps [Yeke’s] proximity to multiple flexible PCB manufacturers makes him feel that this is more like playing around for fun than product design. Any way you look at it, the ability to design something that will fit inside that crazy-tight iPhone case is both impressive and mesmerizing. Having seen some of the inductive charging hacks over the years, this is by far the cleanest way to go about it.

We caught up with [Scotty] during last year’s Supercon. We may not be able to drop everything and move to Shenzhen, but hearing about the experience is just enough to keep us wanting to!



from iphone hacks – Hackaday

Friday, April 13, 2018

The Ultimate iPhone Upgrade

While Apple products have their upsides, the major downside with them is their closed environment. Most of the products are difficult to upgrade, to say the least, and this is especially true with the iPhone. While some Android devices still have removable storage and replaceable batteries, this has never been an option for any of Apple’s phones. But that doesn’t mean that upgrading the memory inside the phone is completely impossible.

[Scotty] from [Strange Parts] is no stranger to the iPhone, and had heard that there are some shops that can remove the storage chip in the iPhone and replace it with a larger one so he set out on a journey to try this himself. The first step was to program the new chip, since they must have software on them before they’re put in the phone. The chip programmer ironically doesn’t have support for Mac, so [Scotty] had to go to the store to buy a Windows computer first before he could get the chip programmer working right.

After that hurdle, [Scotty] found a bunch of old logic boards from iPhones to perfect his desoldering and resoldering skills. Since this isn’t through-hole technology a lot of practice was needed to desolder the chip from the logic board without damaging any of the other components, then re-ball the solder on the logic board, and then re-soldering the new larger storage chip to the logic board. After some hiccups and a lot of time practicing, [Scotty] finally had an iPhone that he upgraded from 16 GB to 128 GB.

[Scotty] knows his way around the iPhone and has some other videos about other modifications he’s made to his personal phone. His videos are very informative, in-depth, and professionally done so they’re worth a watch even if you don’t plan on trying this upgrade yourself. Not all upgrades to Apple products are difficult and expensive, though. There is one that costs only a dollar.

We sat down with him after his talk at the Hackaday Superconference last November, and we have to say that he made us think more than twice about tackling the tiny computer that lies hidden inside a cell phone. Check out his talk if you haven’t yet.



from iphone hacks – Hackaday

Tuesday, March 20, 2018

Test Ideas Now With Sensors Already In Your Pocket

When project inspiration strikes, we’d love to do some quick tests immediately to investigate feasibility. Sadly we’re usually far from our workbench and its collection of sensor modules. This is especially frustrating when the desired sensor is in the smartphone we’re holding, standing near whatever triggered the inspiration. We could download a compass app, or a bubble level app, or something similar to glimpse sensor activity. But if we’re going to download an app, consider Google’s Science Journal app.

It was designed to be an educational resource, turning a smartphone’s sensor array into a pocket laboratory instrument and notebook for students. Fortunately it will work just as well for makers experimenting with project ideas. The exact list of sensors will depend on the specific iOS/Android device, but we can select a sensor and see its output graphed in real-time. This graph can also be recorded into the journal for later analysis.

Science Journal was recently given a promotional push by the band OK Go, as part of their OK Go Sandbox project encouraging students to explore, experiment, and learn. This is right up the alley for OK Go, who has a track record of making music videos that score high on maker appeal. Fans would enjoy their videos explaining behind-the-scene details in the context of math, science, and music.

While the Science Journal app has provisions for add-on external sensors, carrying them around would reduce its handy always-available appeal. Not that we’re against pairing smartphones with clever accessories to boost their sensing capabilities: we love them! From trying to turn a smartphone into a Tricorder, to an inexpensive microscope, to exploring serious medical diagnosis, our pocket computers can do it all.

[via Engadget]

 



from iphone hacks – Hackaday