On multiple occasions, the native camera applications opens itself. This can even happen when the phone is locked and posed an a table. Is there a way to prevent this problem, or is this a harware one ?
Sometimes buttons can get jammed, if you get a crumb (or something else) stuck in there, which makes the phone think it's constantly being depressed.
For phones that have a removable cover (like the 520), removing the cover, and cleaning with a dry microfiber cloth may dislodge it.
For phones that do not have a removable cover, the best option would be to take it to an authorised repair centre, who might charge you an extortionate amount to do the same - if you're brave, and don't mind risking voiding any warranty, you might be able to dislodge anything fouling the button with a mini-vacuum, or air blower (similar to those used for cleaning DSLR sensors). If you do try this approach use the minimum amount of force required, to risk damaging the device - if you're unsure, take it to a servicing professional.
You can try changing the side button. I had similar issues, Nokia store replaced that faulty button