The battery life of iPhones and MacBooks are currently measured in hours. But what if it could be measured in days or weeks? That might be possible in the future, a new invention from Apple shows.

An Apple Inc. patent granted by the U.S. Patent and Trademark Office on Tuesday, titled “Fuel Cell System to Power a Portable Computing Device,” details a new way to power its iOS devices and MacBooks. The company’s invention uses energy sources such as hydrogen, methanol or other types of fuel cell sources and converts that into electrical power. The technology could enable devices to run continuously for days or weeks. But Apple notes in its invention that designing a cost effective and portable fuel cell can be challenging, according to Patently Apple.

Fuel Cell patent Apple Apple's fuel cell could use MagSafe or another connector to power portable devices. Photo: USPTO/Apple Inc.

In one embodiment, Apple’s fuel cell would live outside a MacBook as an external battery pack through a MagSafe connector. But the company notes that the invention would use any connector that provides power as well as bidirectional communication between the device and fuel cell. This could open its fuel cell technology up to other devices such as its iPhones and iPads.

And in other embodiments, the connected device would also have the ability to control the fuel cell through data provided over the power cable, such as temperatures, remaining fuel and voltages.

Fuel Cell patent connector An illustration on how Apple's fuel cell can be connected to a portable device such as an iPhone. Photo: USPTO/Apple Inc.

As with most of Apple’s published patents, it’s not known if or when Apple plans to integrate fuel cell technology into its product line. But in recent months the company has stepped up its efforts to improve the battery life of its devices.

Last week, Apple introduced a new MacBook featuring a “terraced battery cell,” which is designed to fill more space that would otherwise be wasted with a traditional rectangular battery. And it is also involved in a lawsuit from battery company A123 Systems, which alleges Apple poached several of A123’s engineers to build its own battery division.

The patent first filed on Aug. 3, 2010, credits Apple engineers Bradley Spare, Vijay Iyer, Jean Lee, Gregory Tice, Michael Hillman and David Simon for the invention.