The application relates to a portable device comprising a substrate, a number of electronic components, and a battery comprising an anode and a cathode for energizing at least some of the components. The application further relates to a method of protection a portable device against corrosion and to the use of a portable device. The object of the present application is to protect selected metallic parts of a bodyworn electronic device against corrosion in a flexible and controlled manner. The problem is solved in that the portable device comprises a sacrificial anode. This has the advantage that corrosion can be contained at a specific location. The invention may e.g. be used for portable listening devices, e.g. hearing aids or headsets or earphones comprising a part adapted for being worn at or in an ear of a user.