How should the magnets be attached to my device?
If a magnet needs to be attached to a device, you can use either mechanical means or adhesives to secure the magnet in place.
Adhesives are often used to attach magnets. When magnets are bonded to uneven surfaces, an adhesive with a lot of "body" is required so that it conforms to the uneven surface. Hot glues work well for bonding magnets to ceramics, wood, fabric, and other materials. For magnets glued to metal, "super glues" can be used very effectively.