The following account of the prior art relates to one of the areas of application of the present application, hearing aids. 
Space is a scarce resource in a hearing aid.  The smaller the hearing aid, the more of the design focus is associated with overcoming volume restraints.  An example of a device where such considerations are extremely important is a hearing aid comprising a part adapted for being worn in the bony part of the ear canal (a so-called deep in the ear canal type hearing aid). 
US 2008/0137891 A1 describes a deep in the ear hearing aid comprising a microphone, a speaker and an amplifier, as well as a battery connected to an electronics part, wherein the battery accommodation is arranged on the microphone side and comprises a sleeve connected to the electronics part, of which the first end pointing away from the electronics part is open for taking said battery and for providing a sound inlet in the space between said sleeve and the battery fitted therein.  The sleeve has an open end and a closed end. 
U.S. Pat.  No.  6,208,741 describes a battery enclosure for miniature hearing devices that are deeply and entirely positioned within the ear canal of an individual.  The battery enclosure is a thin encapsulation that is formed or fitted directly over the battery thus substantially assuming the shape of the encapsulated battery.  In an embodiment, the battery enclosure is coated over the battery with protruding contacts forming a battery assembly ready for electrical connection to a miniature canal hearing device. 
WO 00/25551 A1 describes a hearing aid with a housing formed with an exterior peripheral layer of a deformable material.  Electronic components located within the deformable layer can be encapsulated, at least in part, with a second deformable material.  The second material also fills voids in the interior of the deformable peripheral layer. 
U.S. Pat.  No.  6,751,327 describes a battery assembly comprising an elongated plastic shell irregularly shaped to fit optimally in anatomical cavities, particularly ear canals.  The battery assembly relies structurally on a thin plastic shell which is designed to be inexpensively formed in a variety of complex shapes, thus offering superior volumetric utilization and energy capacity when compared with conventional metal button cell designs.